From 66deed24b8f50a3e08976910bcd668bab86611df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 27 Jun 2014 20:13:46 +0300 Subject: [PATCH] Implement WelsCPUFeatureDetect for AArch64 Previously it actually didn't return any cpu flags at all. --- codec/common/src/cpu.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/codec/common/src/cpu.cpp b/codec/common/src/cpu.cpp index 895abfc3..8489760f 100644 --- a/codec/common/src/cpu.cpp +++ b/codec/common/src/cpu.cpp @@ -280,7 +280,19 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) { WELS_CPU_NEON; } #endif -#else /* Neither X86_ASM nor HAVE_NEON */ +#elif defined(HAVE_NEON_AARCH64) + +/* For AArch64, no runtime detection actually is necessary for now, since + * NEON and VFPv3 is mandatory on all such CPUs. (/proc/cpuinfo doesn't + * contain neon, and the android cpufeatures library doesn't return it + * either.) */ + +uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) { + return WELS_CPU_VFPv3 | + WELS_CPU_NEON; +} + +#else /* Neither X86_ASM, HAVE_NEON nor HAVE_NEON_AARCH64 */ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) { return 0;