aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Steed <george.steed@arm.com>2024-02-07 15:38:54 +0000
committerJames Zern <jzern@google.com>2024-02-13 19:48:14 +0000
commit9972ec4bdfbf4412b3ecafc9f76fc582080afbf8 (patch)
treeecf4ae64a0d5967613781d75e329e3664e5ecd79
parent5f16a838d3f2236d2473d95d78e882f6d89f81bc (diff)
downloadlibaom-9972ec4bdfbf4412b3ecafc9f76fc582080afbf8.tar.gz
aarch64_cpudetect.c: Don't read AT_HWCAPs if they are not needed
If FEAT_I8MM is not supported by the compiler then we do not test the value from getauxval(AT_HWCAP2), leading to an unused variable warning. To suppress this, only read the variable if we are going to use it, which for now is only to check FEAT_I8MM. Also do similarly for AT_HWCAP to match. Bug: aomedia:3543 Change-Id: I855c255105cbfc448f64df317507dd9184731479 (cherry picked from commit 2036fbe2d8449c1054b4fb8bdf22c78f92655afc)
-rw-r--r--aom_ports/aarch64_cpudetect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/aom_ports/aarch64_cpudetect.c b/aom_ports/aarch64_cpudetect.c
index 43d5a149c..13299a688 100644
--- a/aom_ports/aarch64_cpudetect.c
+++ b/aom_ports/aarch64_cpudetect.c
@@ -108,8 +108,13 @@ static int arm_get_cpu_caps(void) {
static int arm_get_cpu_caps(void) {
int flags = 0;
+#if HAVE_ARM_CRC32 || HAVE_NEON_DOTPROD || HAVE_SVE
unsigned long hwcap = getauxval(AT_HWCAP);
+#endif
+#if HAVE_NEON_I8MM
unsigned long hwcap2 = getauxval(AT_HWCAP2);
+#endif
+
#if HAVE_NEON
flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
#endif // HAVE_NEON