aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/aarch64/cpu.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2023-10-23 11:27:29 +0300
committerMartin Storsjö <martin@martin.st>2023-10-31 12:23:27 +0200
commitf05948ada435d95fed3cc9279cec0ccef8a10a2c (patch)
tree6601e737a3495e0de653f3f5e166a402cdc75498 /libavutil/aarch64/cpu.c
parentae72412aa83d8bd81a2e437030285c9c58004421 (diff)
downloadffmpeg-f05948ada435d95fed3cc9279cec0ccef8a10a2c.tar.gz
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>
Diffstat (limited to 'libavutil/aarch64/cpu.c')
-rw-r--r--libavutil/aarch64/cpu.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index bd780e8591..2b50c426bc 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -30,11 +30,9 @@
static int detect_flags(void)
{
int flags = 0;
- unsigned long hwcap;
-
- hwcap = getauxval(AT_HWCAP);
#if defined(HWCAP_CPUID)
+ unsigned long hwcap = getauxval(AT_HWCAP);
// We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and
// HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers
// 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)
flags |= AV_CPU_FLAG_I8MM;
}
-#else
- (void)hwcap;
#endif
return flags;