Closed
Bug 996076
Opened 10 years ago
Closed 10 years ago
SIMD: Implement more int32x4 and float32x4 functions present in the polyfill
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: bbouvier, Assigned: bbouvier)
Details
Attachments
(4 files)
20.26 KB,
patch
|
nmatsakis
:
review+
|
Details | Diff | Splinter Review |
4.92 KB,
patch
|
nmatsakis
:
review+
|
Details | Diff | Splinter Review |
12.00 KB,
patch
|
nmatsakis
:
review+
|
Details | Diff | Splinter Review |
7.38 KB,
patch
|
nmatsakis
:
review+
|
Details | Diff | Splinter Review |
(In reply to Soeren.Balko from bug 992267 comment #1) > Great to see progress on that end! The current SIMD implementation in > Nightly is IMHO fairly restrictive in its int32x4 implementation. > Specifically, int32x4 does neither provide for a min, lessThan, or abs > function. lessThan, greaterThan, etc. are present in the polyfill > (https://github.com/johnmccutchan/ecmascript_simd), but are missing from the > Firefox implementation. Any chance to have it added? > > Without these functions, comparing two int32x4 vectors becomes unnecessary > difficult and comes down to subtracting them, reading out the signMask from > the result vector, and bit-shifting that signMask to get the comparisons for > the individual lanes. The latter operation is obviously sequential, > negatively affecting performance. Thanks for reporting that! Indeed these functions seem to be missing when comparing to the polyfill [1] which stands as a reference. Note that int32x4.min and int32x4.abs you're mentioning aren't present in the polyfill either, although float32x4.min and float32x4.abs are there. There is a SSE instruction (PMIN{U,S}{B,D,W} -- some variants are available after SSE4.1) for int32x4.min so it would be reasonable to add it too, if the equivalent ARM instruction exists or can be easily emulated. Same holds for int32x4.max, greaterThan (can't see an instruction for lessThan, so we'd have to emulate it with greaterThan and another operation), equality, absolute value (SSE3). I'll add them unless somebody beats me to it. [1] https://github.com/johnmccutchan/ecmascript_simd/blob/master/src/ecmascript_simd.js
Assignee | ||
Comment 1•10 years ago
|
||
This preparatory patch does the following things: - a few style cleanups for some if and for loops - s/uint32_t/unsigned for loop iterators - hoist error handling code, so as to remove parenthesis
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8415683 -
Flags: review?(nmatsakis)
Assignee | ||
Comment 3•10 years ago
|
||
Float32x4 bitwise operators need to interpret the float32 datum as int32, so we need to convert them. Everything is the same as in Func otherwise, so let's just generalize Func a little bit.
Attachment #8415686 -
Flags: review?(nmatsakis)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8415688 -
Flags: review?(nmatsakis)
Assignee | ||
Comment 5•10 years ago
|
||
With these patches, we are now at the same level as the polyfill implementation. Niko, should we plan on adding also min, max, abs and maybe some other functions for int32x4?
Summary: SIMD: Implement more int32x4 functions → SIMD: Implement more int32x4 and float32x4 functions present in the polyfill
Updated•10 years ago
|
Attachment #8415682 -
Flags: review?(nmatsakis) → review+
Updated•10 years ago
|
Attachment #8415683 -
Flags: review?(nmatsakis) → review+
Updated•10 years ago
|
Attachment #8415686 -
Flags: review?(nmatsakis) → review+
Updated•10 years ago
|
Attachment #8415688 -
Flags: review?(nmatsakis) → review+
Assignee | ||
Comment 6•10 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/125d4d1381f5 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/e522c302dd96 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/ab9a69f74b98 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/8eddc5ea91ba Thanks for the quick review!
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/125d4d1381f5 https://hg.mozilla.org/mozilla-central/rev/e522c302dd96 https://hg.mozilla.org/mozilla-central/rev/ab9a69f74b98 https://hg.mozilla.org/mozilla-central/rev/8eddc5ea91ba
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•