SIMD code cleanup
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
A number of minor things in the SIMD code could stand to be cleaned up, for general hygiene. I have a separate list, but examples are: using the proper scratch register scopes; removing or commenting out dead code; using idiomatic code where we can (eg some code inspired by the V8 implementation synthesizes constants in a way we don't normally do that).
Assignee | ||
Comment 1•5 years ago
|
||
Always use ScratchSimd128Scope to claim ScratchSimd128Reg.
The only hard part is that the register was claimed deep in the
assembler in what appears to be a late non-AVX bugfix to work around
the fact that compare operations are not three-address on non-AVX.
I fixed this by making compare operations two-address and moving the
code that shuffles registers for this case into the macroassembler,
where the scratch can be claimed correctly.
As a result, we have less support for AVX, but since AVX is not
supported or tested this does not actually matter. A MOZ_CRASH
ensures we'll run into this if testing with AVX.
Another couple of similar cases elsewhere have similar local fixes:
MOZ_CRASH for AVX, two-address code for the normal case.
Assignee | ||
Comment 2•5 years ago
|
||
This is technical debt from the initial SIMD work - it's faster to load a
constant here than to compute it. Benchmark data not forthcoming, but
elsewhere i've found that we break even at two instructions and it's
better to load the value than to compute it in three.
Depends on D87284
Assignee | ||
Comment 3•5 years ago
|
||
I'm open to discussing this one, but I thought it would be good to separate unused SIMD
code (from asm.js) from code that's being actively maintained. Hence the new file, and
a separate section in the header for the declarations.
Depends on D87306
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a475ddc1aeec
https://hg.mozilla.org/mozilla-central/rev/3da7d219a9e4
https://hg.mozilla.org/mozilla-central/rev/da2ca8466508
Description
•