Changeset 132890 in webkit


Ignore:
Timestamp:
Oct 30, 2012 3:50:42 AM (11 years ago)
Author:
rgabor@webkit.org
Message:

Optimize vclip for NEON in VectorMath
https://bugs.webkit.org/show_bug.cgi?id=100737

Reviewed by Zoltan Herczeg.

Speed up vclip in VectorMath with NEON intrinsics.

  • platform/audio/VectorMath.cpp:

(WebCore::VectorMath::vclip):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r132889 r132890  
     12012-10-30  Gabor Rapcsanyi  <rgabor@webkit.org>
     2
     3        Optimize vclip for NEON in VectorMath
     4        https://bugs.webkit.org/show_bug.cgi?id=100737
     5
     6        Reviewed by Zoltan Herczeg.
     7
     8        Speed up vclip in VectorMath with NEON intrinsics.
     9
     10        * platform/audio/VectorMath.cpp:
     11        (WebCore::VectorMath::vclip):
     12
    1132012-10-30  Alexandru Chiculita  <achicu@adobe.com>
    214
  • trunk/Source/WebCore/platform/audio/VectorMath.cpp

    r131459 r132890  
    656656
    657657    // FIXME: Optimize for SSE2.
    658     // FIXME: Optimize for NEON.
     658#if HAVE(ARM_NEON_INTRINSICS)
     659    if ((sourceStride == 1) && (destStride == 1)) {
     660        int tailFrames = n % 4;
     661        const float* endP = destP + n - tailFrames;
     662
     663        float32x4_t low = vdupq_n_f32(lowThreshold);
     664        float32x4_t high = vdupq_n_f32(highThreshold);
     665        while (destP < endP) {
     666            float32x4_t source = vld1q_f32(sourceP);
     667            vst1q_f32(destP, vmaxq_f32(vminq_f32(source, high), low));
     668            sourceP += 4;
     669            destP += 4;
     670        }
     671        n = tailFrames;
     672    }
     673#endif
    659674    while (n--) {
    660675        *destP = std::max(std::min(*sourceP, highThreshold), lowThreshold);
Note: See TracChangeset for help on using the changeset viewer.