Use bitwiseAndSimd128(SimdConstant, reg) and similar to lower register pressure
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
During lowering on x86 and x64 we frequently load a mask and then bitwise-op a value with the mask, and then throw the mask away. We can operate directly from memory. With the x86 port there's already a bitwiseAndSimd128(SimdConstant, reg) operation; other operations could be added here, and used to improve code generation locally.
A wrinkle is that these operations may not be allowed to use the scratch register, since the higher-level operation wanting to use these operations may already be using that. This requires some thought.
Assignee | ||
Comment 1•5 years ago
|
||
A related, but complementary, matter that could be investigated in the context of this bug is that loaded constants could be lifted out of the lowering context so as to be exposed properly to MIR and subject to commoning, hoisting, and whatnot.
Assignee | ||
Comment 2•5 years ago
|
||
In general, memory constants can be used when they are only used once. In shuffleInt8x16(), we load two constants to use with PSHUFB and these require an extra temp register because the SIMD temp is taken. But PSHUFB can take a mask from memory, so we could use that here.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Instead of loading instruction-internal simd constants separately (on
x86/x64) and thus increasing register pressure by requiring temps,
load them as part of the operation.
This patch adapts the shuffle operation (pshufb). There's a fair
amount of plumbing in the assemblers but the change amounts to
inlining the constant loads into the instruction, getting rid of a
temp, and making sure we bias in favor of lhs == output.
Depends on D94554
Assignee | ||
Comment 4•4 years ago
|
||
Instead of loading instruction-internal simd constants separately (on
x86/x64) and thus potentially increasing register pressure by
requiring temps, load them as part of the operation.
This patch handles a few remaining single-use-of-loaded-const cases,
none of which are probably all that important, this is just hygiene.
In the case where a loaded const is used multiple times, or a single
use can't be gotten rid of without introducing additional moves, we
assume (for now) that it's OK to load the constant separately. The
cases that remain in this class are blends (that will use a mask and
its negation) and a few floating-point slow paths (some with multiple
uses, some with knotty logic).
Depends on D94556
Comment 6•4 years ago
|
||
Backed out 13 changesets (bug 1641595, bug 1671998, bug 1672770, bug 1641641, bug 1672697, bug 1672911, bug 1671996, bug 1671907, bug 1640662) for causing sm failures in splat-x64-ion-codegen.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/c2c595aa8fe1dc18803bf80df3bca7ca07443038
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=319728899&repo=autoland&lineNumber=44748
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/23f94c8ec53b
https://hg.mozilla.org/mozilla-central/rev/83ffcdef5940
Description
•