*hwcap = 0; while (fgets(buf, sizeof(buf), f)) { if (av_strstart(buf, "Features", NULL)) { if (strstr(buf, " edsp "))
*hwcap |= HWCAP_ARM_EDSP; if (strstr(buf, " tls "))
*hwcap |= HWCAP_ARM_TLS; if (strstr(buf, " thumbee "))
*hwcap |= HWCAP_ARM_THUMBEE; if (strstr(buf, " vfp "))
*hwcap |= HWCAP_ARM_VFP; if (strstr(buf, " vfpv3 "))
*hwcap |= HWCAP_ARM_VFPv3; if (strstr(buf, " neon ") || strstr(buf, " asimd "))
*hwcap |= HWCAP_ARM_NEON; if (strstr(buf, " fp ")) // Listed on 64 bit ARMv8 kernels
*hwcap |= HWCAP_ARM_VFP | HWCAP_ARM_VFPv3; break;
}
}
fclose(f); return0;
} #endif
int ff_get_cpu_flags_arm(void)
{ int flags = CORE_CPU_FLAGS;
uint32_t hwcap;
if (get_auxval(&hwcap) < 0) #ifdefined __linux__ || defined __ANDROID__ if (get_hwcap(&hwcap) < 0) if (get_cpuinfo(&hwcap) < 0) #endif return flags;
#define check_cap(cap, flag) do { \ if (hwcap & HWCAP_ARM_ ## cap) \
flags |= AV_CPU_FLAG_ ## flag; \
} while (0)
/* No flags explicitly indicate v6 or v6T2 so check others which
imply support. */
check_cap(EDSP, ARMV5TE);
check_cap(TLS, ARMV6);
check_cap(THUMBEE, ARMV6T2);
check_cap(VFP, VFP);
check_cap(VFPv3, VFPV3);
check_cap(NEON, NEON);
/* The v6 checks above are not reliable so let higher flags
trickle down. */ if (flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON))
flags |= AV_CPU_FLAG_ARMV6T2; elseif (flags & (AV_CPU_FLAG_ARMV6T2 | AV_CPU_FLAG_ARMV6)) /* Some functions use the 'setend' instruction which is deprecated on ARMv8 *andserializingonsomeARMv7cores.Thisensuressuchfunctions
* are only enabled on ARMv6. */
flags |= AV_CPU_FLAG_SETEND;
if (flags & AV_CPU_FLAG_ARMV6T2)
flags |= AV_CPU_FLAG_ARMV6;
/* set the virtual VFPv2 vector mode flag */ if ((flags & AV_CPU_FLAG_VFP) && !(flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON)))
flags |= AV_CPU_FLAG_VFP_VM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.