WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
79441
IPP optimization for functions vsma, vsmul, vadd, vmul and vmaxmgv
https://bugs.webkit.org/show_bug.cgi?id=79441
Summary
IPP optimization for functions vsma, vsmul, vadd, vmul and vmaxmgv
Gao Chun
Reported
2012-02-23 21:47:52 PST
Implement VectorMath::vsma(), VectorMath::vsmul(), VectorMath::vadd(), VectorMath::vmul() and VectorMath::vmaxmgv() with Intel Integrated Performance Primitives(IPP).
Attachments
Implement VectorMath::vsma(), VectorMath::vsmul(), VectorMath::vadd(), VectorMath::vmul() and VectorMath::vmaxmgv() with Intel Integrated Performance Primitives(IPP).
(6.39 KB, patch)
2012-02-23 21:49 PST
,
Gao Chun
no flags
Details
Formatted Diff
Diff
Patch
(8.74 KB, patch)
2012-03-06 01:54 PST
,
Gao Chun
no flags
Details
Formatted Diff
Diff
Patch
(7.25 KB, patch)
2012-03-07 06:44 PST
,
Gao Chun
no flags
Details
Formatted Diff
Diff
Patch
(8.40 KB, patch)
2012-03-12 05:51 PDT
,
Gao Chun
no flags
Details
Formatted Diff
Diff
Patch
(7.67 KB, patch)
2012-03-12 19:29 PDT
,
Gao Chun
bfulgham
: review+
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Gao Chun
Comment 1
2012-02-23 21:49:32 PST
Created
attachment 128648
[details]
Implement VectorMath::vsma(), VectorMath::vsmul(), VectorMath::vadd(), VectorMath::vmul() and VectorMath::vmaxmgv() with Intel Integrated Performance Primitives(IPP).
Raymond Toy
Comment 2
2012-02-24 10:15:58 PST
(In reply to
comment #1
)
> Created an attachment (id=128648) [details] > Implement VectorMath::vsma(), VectorMath::vsmul(), VectorMath::vadd(), VectorMath::vmul() and VectorMath::vmaxmgv() with Intel Integrated Performance Primitives(IPP).
I have very briefly looked at the changes, which seem ok. I will give a closer look soon. However, there needs to be a change log, and I'd like to see some numbers on how much faster IPP makes these routines compared to either the SSE2 versions or the default versions. Also, it might be better to review this after
bug 77950
(sse2 for vsvesq and vmaxmgv) has been committed.
Alexey Proskuryakov
Comment 3
2012-02-24 14:52:14 PST
USE(WEBAUDIO_IPP) looks like dead code, which we generally don't allow in WebKit. Platform.h should have code to enable it on some platforms.
Gao Chun
Comment 4
2012-02-25 01:17:54 PST
Thanks for your comment, it seems there are some conflicts between this patch and patches for
bug 77950
(sse2 for vsvesq and vmaxmgv), I will resubmit a new patch with change log and performance test report after
bug 77950
has been committed.
> > Created an attachment (id=128648) [details] [details] > > Implement VectorMath::vsma(), VectorMath::vsmul(), VectorMath::vadd(), VectorMath::vmul() and VectorMath::vmaxmgv() with Intel Integrated Performance Primitives(IPP). > > I have very briefly looked at the changes, which seem ok. I will give a closer look soon. > > However, there needs to be a change log, and I'd like to see some numbers on how much faster IPP makes these routines compared to either the SSE2 versions or the default versions. > > Also, it might be better to review this after
bug 77950
(sse2 for vsvesq and vmaxmgv) has been committed.
Gao Chun
Comment 5
2012-03-06 01:54:37 PST
Created
attachment 130336
[details]
Patch
Raymond Toy
Comment 6
2012-03-06 09:35:18 PST
Comment on
attachment 130336
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130336&action=review
Looks good overall. Just a few comments....
> Source/WebCore/ChangeLog:5 > +
Can you give some information on how much faster these routines are with IPP compared to the SSE2 versions?
> Source/WebCore/ChangeLog:8 > + No new tests. (OOPS!)
Can't commit this with "OOPS!". Do you know if these functions are tested by existing layout tests? If so, you can just say they are covered by existing tests.
> Source/WebCore/platform/audio/VectorMath.cpp:116 > +#if USE(WEBAUDIO_IPP)
Maybe combine line 114 and 116 into #elif USE(WEBAUDIO_IPP) Also, I'm not sure which is better. It's nice to have teh IPP implementations all in one section like the special versions for Darwin, but it might fit better if the bodies of these new routines were added the existing routines so that there would be an SSE2 version, an IPP version, and a default in each function. But that makes each function harder to read, but it also makes it easier to see if one function needs to be updated to update all the different versions accordingly.
> Source/WebCore/platform/audio/VectorMath.cpp:117 > +// Use the highly optimized versions that implemented with IPP.
Typo. "that implemented" -> "that are implemented"
Gao Chun
Comment 7
2012-03-07 06:44:17 PST
Created
attachment 130616
[details]
Patch
Gao Chun
Comment 8
2012-03-07 06:56:37 PST
Comment on
attachment 130336
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130336&action=review
>> Source/WebCore/ChangeLog:8 >> + No new tests. (OOPS!) > > Can't commit this with "OOPS!". Do you know if these functions are tested by existing layout tests? If so, you can just say they are covered by existing tests.
It's already covered by existing layout tests.
>> Source/WebCore/platform/audio/VectorMath.cpp:116 >> +#if USE(WEBAUDIO_IPP) > > Maybe combine line 114 and 116 into #elif USE(WEBAUDIO_IPP) > > Also, I'm not sure which is better. It's nice to have teh IPP implementations all in one section like the special versions for Darwin, but it might fit better if the bodies of these new routines were added the existing routines so that there would be an SSE2 version, an IPP version, and a default in each function. But that makes each function harder to read, but it also makes it easier to see if one function needs to be updated to update all the different versions accordingly.
All new routines' bodies have been added to the existing routines, and it looks better.
Raymond Toy
Comment 9
2012-03-09 13:30:19 PST
Comment on
attachment 130616
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130616&action=review
> Source/WebCore/ChangeLog:14 > +
Thanks for adding the numbers. Very nice improvement!
> Source/WebCore/platform/audio/VectorMath.cpp:125 > if ((sourceStride == 1) && (destStride == 1)) {
Since both IPP and SSE2 have a restriction on the strides, would it make sense to move the IPP code inside the if so that it is common to both? Something like #if defined(__SSE2__) || USE(WEBAUDIO_IPP) if ((sourceStride == 1) && (destStride == 1)) { #if USE(WEBAUDIO_IPP) ippsAddProduceC_32f(...) #else /* SSE2 */ /* original sse2 code */ #endif } #endif Same comment applies to the rest of the IPP code.
Gao Chun
Comment 10
2012-03-12 05:51:33 PDT
Created
attachment 131318
[details]
Patch
Gao Chun
Comment 11
2012-03-12 05:57:35 PDT
Comment on
attachment 130616
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130616&action=review
>> Source/WebCore/platform/audio/VectorMath.cpp:125 >> if ((sourceStride == 1) && (destStride == 1)) { > > Since both IPP and SSE2 have a restriction on the strides, would it make sense to move the IPP code inside the if so that it is common to both? Something like > > #if defined(__SSE2__) || USE(WEBAUDIO_IPP) > if ((sourceStride == 1) && (destStride == 1)) { > #if USE(WEBAUDIO_IPP) > ippsAddProduceC_32f(...) > #else /* SSE2 */ > /* original sse2 code */ > #endif > } > #endif > > Same comment applies to the rest of the IPP code.
Improved, please review again.
Raymond Toy
Comment 12
2012-03-12 09:34:29 PDT
Comment on
attachment 131318
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=131318&action=review
> Source/WebCore/platform/audio/VectorMath.cpp:170 > +#endif
In the body for the IPP case, could we set n = 0 so the following while loop is never executed? This would, I think, get rid of the #if/#endif here and also at line 177. I think this simplifies the code.
> Source/WebCore/platform/audio/VectorMath.cpp:407 > +#endif
Same comment here as the comment for vsma, line 170.
> Source/WebCore/platform/audio/VectorMath.cpp:558 > +#endif
Same comment here as for vsma, line 170.
Gao Chun
Comment 13
2012-03-12 19:29:30 PDT
Created
attachment 131495
[details]
Patch
Gao Chun
Comment 14
2012-03-12 19:38:47 PDT
Comment on
attachment 131318
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=131318&action=review
>> Source/WebCore/platform/audio/VectorMath.cpp:170 >> +#endif > > In the body for the IPP case, could we set n = 0 so the following while loop is never executed? This would, I think, get rid of the #if/#endif here and also at line 177. I think this simplifies the code.
It's a good suggestion, I have also replaced "n = 0" with "return" to get rid all of #if/#endif in each function. Pls review again.
Raymond Toy
Comment 15
2012-03-13 09:46:06 PDT
Comment on
attachment 131495
[details]
Patch I had not considered using return's. This makes the patch simpler with fewer #if/#endif's. Looks good. Thanks for the patch.
Gao Chun
Comment 16
2012-03-21 02:19:26 PDT
Whether the patch is OK to commit or need more review?
Eric Seidel (no email)
Comment 17
2012-04-19 16:43:36 PDT
Chris?
Brent Fulgham
Comment 18
2012-11-19 22:47:04 PST
Comment on
attachment 131495
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=131495&action=review
Seems like all requested changes have been made, and look reasonable. I found a tiny typo, but that can be fixed when this is landed.
> Source/WebCore/platform/audio/VectorMath.cpp:248 > + if ((sourceStride1 ==1) && (sourceStride2 == 1) && (destStride == 1)) {
Nit: We need a space between the equals and the 1 here. ("==1" should be "== 1").
Ahmad Saleem
Comment 19
2022-10-10 14:03:10 PDT
I checked with BugID and it seems this didn't landed. Do we need this now? Thanks!
Kenneth Russell
Comment 20
2022-10-10 16:22:21 PDT
WebAudio's IPP implementation in WebKit was removed some time ago, so this patch is obsolete.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug