Path: blob/main/multimedia/aom/files/patch-aom__ports_aarch32__cpudetect.c
18157 views
- Assume NEON is enabled on armv71- Implement runtime detection on FreeBSD23--- aom_ports/aarch32_cpudetect.c.orig 2023-11-30 23:18:12 UTC4+++ aom_ports/aarch32_cpudetect.c5@@ -12,7 +12,7 @@67#include "arm_cpudetect.h"89-#if !CONFIG_RUNTIME_CPU_DETECT10+#if !CONFIG_RUNTIME_CPU_DETECT || defined(__ARM_NEON)1112static int arm_get_cpu_caps(void) {13// This function should actually be a no-op. There is no way to adjust any of14@@ -55,9 +55,23 @@ static int arm_get_cpu_caps(void) {15return flags;16}1718-#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)19+#elif defined(__linux__) || defined(__FreeBSD__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)2021#include <sys/auxv.h>22+23+#if defined(__FreeBSD__)24+static unsigned long getauxval(unsigned long type)25+{26+ /* Only AT_HWCAP* return unsigned long */27+ if (type != AT_HWCAP && type != AT_HWCAP2) {28+ return 0;29+ }30+31+ unsigned long ret = 0;32+ elf_aux_info(type, &ret, sizeof(ret));33+ return ret;34+}35+#endif3637// Define hwcap values ourselves: building with an old auxv header where these38// hwcap values are not defined should not prevent features from being enabled.394041