RESOLVED FIXED 75835
Add vsma in VectorMath to handle vector scale multiply and add and use it in AudioBus
https://bugs.webkit.org/show_bug.cgi?id=75835
Summary Add vsma in VectorMath to handle vector scale multiply and add and use it in ...
Wei James (wistoch)
Reported 2012-01-09 01:03:23 PST
Add vsma in VectorMath to handle vector scale multiply and add and use it in AudioBus
Attachments
Patch (5.94 KB, patch)
2012-01-09 01:14 PST, Wei James (wistoch)
no flags
Patch (5.78 KB, patch)
2012-01-12 16:49 PST, Wei James (wistoch)
no flags
Wei James (wistoch)
Comment 1 2012-01-09 01:14:23 PST
Raymond Toy
Comment 2 2012-01-11 09:50:29 PST
Comment on attachment 121630 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121630&action=review > Source/WebCore/platform/audio/VectorMath.cpp:142 > + Are we missing the case where n (framesToProcess) is not a multiple of 4? If framesToProcess is 5, tailFrames = 1 and endP = destP + 4. The while loop will be executed once, processing 4 frames. We're missing the last frame, right?
Wei James (wistoch)
Comment 3 2012-01-11 16:41:34 PST
Comment on attachment 121630 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121630&action=review >> Source/WebCore/platform/audio/VectorMath.cpp:142 >> + > > Are we missing the case where n (framesToProcess) is not a multiple of 4? If framesToProcess is 5, tailFrames = 1 and endP = destP + 4. The while loop will be executed once, processing 4 frames. We're missing the last frame, right? if the n is not a multiple of 4, in the line 148, n will be assigned to tailFrames, and the code after the #endif will be executed to handle the last frame.
Raymond Toy
Comment 4 2012-01-12 09:49:40 PST
Comment on attachment 121630 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121630&action=review >>> Source/WebCore/platform/audio/VectorMath.cpp:142 >>> + >> >> Are we missing the case where n (framesToProcess) is not a multiple of 4? If framesToProcess is 5, tailFrames = 1 and endP = destP + 4. The while loop will be executed once, processing 4 frames. We're missing the last frame, right? > > if the n is not a multiple of 4, in the line 148, n will be assigned to tailFrames, and the code after the #endif will be executed to handle the last frame. Sorry about that. Looks good, then.
Chris Rogers
Comment 5 2012-01-12 14:55:59 PST
Looks good.
Jer Noble
Comment 6 2012-01-12 15:40:45 PST
The patch in bug #74345 also adds vsma support. If both patches are approved, we'll have to make sure not to step on each others' toes.
Chris Rogers
Comment 7 2012-01-12 15:53:23 PST
(In reply to comment #6) > The patch in bug #74345 also adds vsma support. If both patches are approved, we'll have to make sure not to step on each others' toes. Agreed. I think it's easiest if we can land this patch first. And then #74345 can be simplified quite a bit. Does that seem reasonable?
Jer Noble
Comment 8 2012-01-12 16:09:40 PST
(In reply to comment #7) > (In reply to comment #6) > > The patch in bug #74345 also adds vsma support. If both patches are approved, we'll have to make sure not to step on each others' toes. > > Agreed. I think it's easiest if we can land this patch first. And then #74345 can be simplified quite a bit. Does that seem reasonable? Yup!
Chris Rogers
Comment 9 2012-01-12 16:31:52 PST
Comment on attachment 121630 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121630&action=review > Source/WebCore/platform/audio/VectorMath.cpp:95 > +#if defined(__ppc__) || defined(__i386__) Sorry for the last minute change, but Jer Noble just mentioned that some of these vector functions don't have a problem with vec_translate.h. So we should simplify this, by removing #if defined(__ppc__) || defined(__i386__) and always simply and directly call: vDSP_vsma(sourceP, sourceStride, scale, destP, destStride, destP, destStride, framesToProcess);
Wei James (wistoch)
Comment 10 2012-01-12 16:49:12 PST
Wei James (wistoch)
Comment 11 2012-01-12 16:49:39 PST
(In reply to comment #9) > (From update of attachment 121630 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=121630&action=review > > > Source/WebCore/platform/audio/VectorMath.cpp:95 > > +#if defined(__ppc__) || defined(__i386__) > > Sorry for the last minute change, but Jer Noble just mentioned that some of these vector functions don't have a problem with vec_translate.h. > > So we should simplify this, by removing #if defined(__ppc__) || defined(__i386__) and always simply and directly call: > > vDSP_vsma(sourceP, sourceStride, scale, destP, destStride, destP, destStride, framesToProcess); thanks. patch updated.
Chris Rogers
Comment 12 2012-01-12 16:51:24 PST
Thanks James, looks good.
Kenneth Russell
Comment 13 2012-01-12 19:19:30 PST
Comment on attachment 122338 [details] Patch rs=me
WebKit Review Bot
Comment 14 2012-01-12 20:28:08 PST
Comment on attachment 122338 [details] Patch Clearing flags on attachment: 122338 Committed r104893: <http://trac.webkit.org/changeset/104893>
WebKit Review Bot
Comment 15 2012-01-12 20:28:14 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.