Bug 1131960 - Check for NEON capability before using NEON code. r=derf
authorGian-Carlo Pascutto <gcp@mozilla.com>
Fri, 13 Feb 2015 05:13:00 -0500
changeset 229120 ff356750af3abe09c279ea5f39077edb26b1c866
parent 229119 83b65d75fcf70d118dc96940e29f1989fcb7e0d9
child 229121 20ffb3ebb7c5d01b319700a35199455fc423730e
push id28282
push usercbook@mozilla.com
push dateMon, 16 Feb 2015 15:06:35 +0000
treeherdermozilla-central@09f4968d5f42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersderf
bugs1131960
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1131960 - Check for NEON capability before using NEON code. r=derf CLOSED TREE
media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c
media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_rdft.c
--- a/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c
+++ b/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c
@@ -1399,17 +1399,21 @@ int WebRtcAec_CreateAec(AecCore** aecIns
     WebRtcAec_InitAec_SSE2();
   }
 #endif
 
 #if defined(MIPS_FPU_LE)
   WebRtcAec_InitAec_mips();
 #endif
 
-#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON)
+#if defined(WEBRTC_DETECT_ARM_NEON)
+  if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
+    WebRtcAec_InitAec_neon();
+  }
+#elif defined(WEBRTC_ARCH_ARM_NEON)
   WebRtcAec_InitAec_neon();
 #endif
 
   aec_rdft_init();
 
   return 0;
 }
 
--- a/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_rdft.c
+++ b/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_rdft.c
@@ -574,12 +574,16 @@ void aec_rdft_init(void) {
 #if defined(WEBRTC_ARCH_X86_FAMILY)
   if (WebRtc_GetCPUInfo(kSSE2)) {
     aec_rdft_init_sse2();
   }
 #endif
 #if defined(MIPS_FPU_LE)
   aec_rdft_init_mips();
 #endif
-#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON)
+#if defined(WEBRTC_DETECT_ARM_NEON)
+  if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
+    aec_rdft_init_neon();
+  }
+#elif defined(WEBRTC_ARCH_ARM_NEON)
   aec_rdft_init_neon();
 #endif
 }