ref: fc3777b44c0449180073665eb78070d388b11738
parent: 60519f04f0ad5b19c0a1cebed35fb631a52ff3dd
author: Dale Curtis <[email protected]>
date: Thu Apr 25 19:21:56 EDT 2019
Fix unused function warning on parse_proc_cpuinfo() for Android
--- a/src/arm/cpu.c
+++ b/src/arm/cpu.c
@@ -31,7 +31,9 @@
#include "src/arm/cpu.h"
-#if defined(HAVE_GETAUXVAL) && ARCH_ARM
+#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
+// NEON is always available; runtime tests are not needed.
+#elif defined(HAVE_GETAUXVAL) && ARCH_ARM
#include <sys/auxv.h>
#ifndef HWCAP_ARM_NEON
@@ -77,10 +79,8 @@
COLD unsigned dav1d_get_cpu_flags_arm(void) {
unsigned flags = 0;
-#if ARCH_AARCH64
+#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
flags |= DAV1D_ARM_CPU_FLAG_NEON;
-#elif defined(__ARM_NEON)
- flags |= DAV1D_ARM_CPU_FLAG_NEON;
#elif defined(HAVE_GETAUXVAL) && ARCH_ARM
unsigned long hw_cap = getauxval(AT_HWCAP);
flags |= (hw_cap & NEON_HWCAP) ? DAV1D_ARM_CPU_FLAG_NEON : 0;
@@ -90,10 +90,6 @@
flags |= (hw_cap & NEON_HWCAP) ? DAV1D_ARM_CPU_FLAG_NEON : 0;
#elif defined(__ANDROID__)
flags |= parse_proc_cpuinfo("neon") ? DAV1D_ARM_CPU_FLAG_NEON : 0;
-#elif defined(__APPLE__)
- flags |= DAV1D_ARM_CPU_FLAG_NEON;
-#elif defined(_WIN32)
- flags |= DAV1D_ARM_CPU_FLAG_NEON;
#endif
return flags;