ref: b3fa8dd334796292dcba4cc014ec571878f21a9b
parent: 2f2801dc780701f361818aaad2b4bfb659f34685
parent: ef7e05d47d4c002d5a22dbd2aaba33bdedd32964
author: volvet <[email protected]>
date: Fri Mar 7 04:15:17 EST 2014
Merge pull request #418 from mstorsjo/ios-neon-detection Use the __ARM_NEON__ built-in compiler define for identifying neon capability on iOS
--- a/codec/common/cpu.cpp
+++ b/codec/common/cpu.cpp
@@ -42,9 +42,6 @@
#ifdef ANDROID_NDK
#include <cpu-features.h>
#endif
-#ifdef APPLE_IOS
-#include <sys/utsname.h>
-#endif
#include "cpu.h"
#include "cpu_core.h"
@@ -245,18 +242,12 @@
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors)
{
uint32_t uiCPU = 0;
- struct utsname sSystemInfo;
- uname (&sSystemInfo);
- if ((0 != strcmp(sSystemInfo.machine, "iPhone1,1")) && //iPhone 2G
- (0 != strcmp(sSystemInfo.machine, "iPhone1,2")) && //iPhone 3G
- (0 != strcmp(sSystemInfo.machine, "iPod1,1")) && //iPod 1G
- (0 != strcmp(sSystemInfo.machine, "iPod2,1"))) //iPod 2G
- {
- uiCPU |= WELS_CPU_ARMv7;
- uiCPU |= WELS_CPU_VFPv3;
- uiCPU |= WELS_CPU_NEON;
- }
+#if defined(__ARM_NEON__)
+ uiCPU |= WELS_CPU_ARMv7;
+ uiCPU |= WELS_CPU_VFPv3;
+ uiCPU |= WELS_CPU_NEON;
+#endif
return uiCPU;
}
#elif defined(__linux__)