You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
aarch64: Simplify the linux runtime cpu detection code
Skip doing the whole getauxval(AT_HWCAP) if HWCAP_CPUID isn't defined. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@ -30,11 +30,9 @@
|
|||||||
static int detect_flags(void)
|
static int detect_flags(void)
|
||||||
{
|
{
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
unsigned long hwcap;
|
|
||||||
|
|
||||||
hwcap = getauxval(AT_HWCAP);
|
|
||||||
|
|
||||||
#if defined(HWCAP_CPUID)
|
#if defined(HWCAP_CPUID)
|
||||||
|
unsigned long hwcap = getauxval(AT_HWCAP);
|
||||||
// We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and
|
// We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and
|
||||||
// HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers
|
// HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers
|
||||||
// a trap, handled by the kernel). However the HWCAP_* defines for these
|
// a trap, handled by the kernel). However the HWCAP_* defines for these
|
||||||
@ -53,8 +51,6 @@ static int detect_flags(void)
|
|||||||
if (((tmp >> 52) & 0xf) == 0x1)
|
if (((tmp >> 52) & 0xf) == 0x1)
|
||||||
flags |= AV_CPU_FLAG_I8MM;
|
flags |= AV_CPU_FLAG_I8MM;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(void)hwcap;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
Reference in New Issue
Block a user