[Webkit-unassigned] [Bug 74048] A function of vector multiply with SSE optimization is needed in VectorMath.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 9 10:06:28 PST 2011


--- Comment #2 from Raymond Toy <rtoy at chromium.org>  2011-12-09 10:06:28 PST ---
(From update of attachment 118323)
View in context: https://bugs.webkit.org/attachment.cgi?id=118323&action=review

Please include a Changelog entry too.

> Source/WebCore/platform/audio/VectorMath.cpp:231

Add comment saying vmmul performs an element-by-element multiply of two vectors, with user-specified strides for the sources and destination.

> Source/WebCore/platform/audio/VectorMath.cpp:232
> +void vmmul(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess)

Why is it named vmmul instead of vmul?  What does the extra m mean?

> Source/WebCore/platform/audio/VectorMath.cpp:237
> +        int n = framesToProcess;

Since this is common to both SSE and non-SSE, move it to the top?  Also, why do we need the extra variable n?  Can't we use framesToProcess?

> Source/WebCore/platform/audio/VectorMath.cpp:265
> +                destP += 4;

As mentioned in another patch, it might be useful to add a macro to encapsulate the very similar code here and the branches below.  Something like

#define SSE2_MULT(s1Load, s2Load, dstore) \
  pSource1 = _mm_##s1Load##_ps(source1P); \
  pSource2 = _mm_##s2Load##_ps(source2P); \
  dest = __mm_mul_ps(pSource1, pSource2); \
  _mm_##dstore##_ps(destP, dest); \
  source1P += 4; \
  source2P += 4; \
  destP += 4\

Then use it:
  SSE2_MULT(load, load, store);

And SSE2_MULT(load,load, storeu); below and so on.

I think it makes it easier to see the similarity and differences between the branches.  Up to you do include this or not.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list