Bug 1266112 - Remove unnecessary alignment checks from AudioNodeEngine.cpp; r?padenot draft
authorDan Minor <dminor@mozilla.com>
Fri, 29 Apr 2016 08:35:30 -0400
changeset 357798 55523f1846b2e1f3bc88d732e6b72f257bc3826f
parent 357771 8c3fd523d75bd30f691ca2d6cfdad18d576392a1
child 519710 41d37d91cc1a58e4f5de1a56761f254a75ff8948
push id16850
push userdminor@mozilla.com
push dateFri, 29 Apr 2016 12:38:43 +0000
reviewerspadenot
bugs1266112, 1266405
milestone49.0a1
Bug 1266112 - Remove unnecessary alignment checks from AudioNodeEngine.cpp; r?padenot Assuming that Bug 1266405 fixed the underlying cause for the unaligned buffers we were seeing, the checks in AudioBufferAddWithScale and AudioBlockCopyWithScale shoudl no longer be necessary. MozReview-Commit-ID: 4OQ4qQVjEP3
dom/media/webaudio/AudioNodeEngine.cpp
--- a/dom/media/webaudio/AudioNodeEngine.cpp
+++ b/dom/media/webaudio/AudioNodeEngine.cpp
@@ -73,20 +73,17 @@ void AudioBufferAddWithScale(const float
 #ifdef BUILD_ARM_NEON
   if (mozilla::supports_neon()) {
     AudioBufferAddWithScale_NEON(aInput, aScale, aOutput, aSize);
     return;
   }
 #endif
 
 #ifdef USE_SSE2
-  // TODO: See Bug 1266112, we should either fix the source of the unaligned
-  //       buffers or do as much as possible with vector instructions and
-  //       fallback to scalar instructions where necessary.
-  if (mozilla::supports_sse2() && IS_ALIGNED16(aInput) && IS_ALIGNED16(aOutput)) {
+  if (mozilla::supports_sse2()) {
     AudioBufferAddWithScale_SSE(aInput, aScale, aOutput, aSize);
     return;
   }
 #endif
 
   if (aScale == 1.0f) {
     for (uint32_t i = 0; i < aSize; ++i) {
       aOutput[i] += aInput[i];
@@ -117,20 +114,17 @@ AudioBlockCopyChannelWithScale(const flo
 #ifdef BUILD_ARM_NEON
     if (mozilla::supports_neon()) {
       AudioBlockCopyChannelWithScale_NEON(aInput, aScale, aOutput);
       return;
     }
 #endif
 
 #ifdef USE_SSE2
-    // TODO: See Bug 1266112, we should either fix the source of the unaligned
-    //       buffers or do as much as possible with vector instructions and
-    //       fallback to scalar instructions where necessary.
-    if (mozilla::supports_sse2() && IS_ALIGNED16(aInput) && IS_ALIGNED16(aOutput)) {
+    if (mozilla::supports_sse2()) {
       AudioBlockCopyChannelWithScale_SSE(aInput, aScale, aOutput);
       return;
     }
 #endif
 
     for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; ++i) {
       aOutput[i] = aInput[i]*aScale;
     }