SIMD optimization x64/x86: Use PBLENDVB for bitselect when the control vector is mask-like
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: lth, Assigned: yury)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
See https://github.com/WebAssembly/simd/issues/192#issuecomment-586397568. If we know the control vector is a mask with all 0 or all 1 per lane (ie it comes from a friendly constant or from an operation we know to generate a mask) we should be able to use PBLENDVB to merge the vectors rather than PAND; PANDN; and POR as now, and we can also avoid a move and a scratch register.
Using PBLENDVB is a little awkward because the control vector must be in xmm0, this isn't much of a hardship for Ion but might be a little messier in baseline. We could make this an ion-only optimization. This makes sense anyway since ion is required to recognize that the input is a mask in the case of a compare source.
The current code is actually pretty good so if we end up with anything more than just the single PBLENDVB it's probably not worth doing this.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Backed out as requested: https://hg.mozilla.org/integration/autoland/rev/6f42701da1519cb089b8d979ba88bb3892ddb17d
Comment 5•4 years ago
|
||
Backed out for causing bustage on Lowering-x86-shared.cpp
backout: https://hg.mozilla.org/integration/autoland/rev/ee2ed3aaf4da0c50bead3cf494a65496da85b1e5
failure log: https://treeherder.mozilla.org/logviewer?job_id=341065657&repo=autoland&lineNumber=19646
[task 2021-05-28T13:43:04.579Z] 13:43:04 INFO - In file included from Unified_cpp_js_src_jit14.cpp:38:
[task 2021-05-28T13:43:04.579Z] 13:43:04 ERROR - /builds/worker/checkouts/gecko/js/src/jit/x86-shared/Lowering-x86-shared.cpp:951:29: error: out-of-line definition of 'specializeConstantMaskAsShuffle' does not match any declaration in 'js::jit::MWasmBitselectSimd128'
[task 2021-05-28T13:43:04.580Z] 13:43:04 INFO - bool MWasmBitselectSimd128::specializeConstantMaskAsShuffle(
[task 2021-05-28T13:43:04.581Z] 13:43:04 INFO - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-28T13:43:04.581Z] 13:43:04 INFO - 1 error generated.
[task 2021-05-28T13:43:04.582Z] 13:43:04 ERROR - make[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:676: Unified_cpp_js_src_jit14.o] Error 1
[task 2021-05-28T13:43:04.583Z] 13:43:04 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/js/src/jit'
[task 2021-05-28T13:43:04.583Z] 13:43:04 INFO - make[4]: *** Waiting for unfinished jobs....
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Bug 1699271 made diff invalid though it applied to MIR.h anyway. Reverted change made by the 1699271.
Lars, can you re-review the patch?
Reporter | ||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
Description
•