[loong64] Implement constant RHS specialization for WASM SIMD comparisons
Categories
(Core :: JavaScript Engine: JIT, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: csmantle, Assigned: csmantle)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Loong64 LSX has immediate comparison instructions, for example VSEQI.[BHDW]. These instruction splats the sign- or zero-extended immediate to all lanes as RHS, then perform the comparison. These can elide one vector value materialization when applicable.
| Assignee | ||
Comment 1•2 days ago
|
||
| Assignee | ||
Comment 2•2 days ago
|
||
This includes the following instructions:
- VSEQI.[BHWD]
- VS{LE,LT}I.[BHWD]{,U}
| Assignee | ||
Comment 3•2 days ago
|
||
These masm methods emits VS{EQ,LE,LT}I.* when possible, otherwise fall
back to the loadConstantSimd128() and reg-reg compare methods.
| Assignee | ||
Comment 4•2 days ago
|
||
| Assignee | ||
Comment 5•2 days ago
|
||
The effect of this stack is as follows. This WAT module:
(module
(memory 1)
(func (export "f")
(v128.store (i32.const 32)
(i32x4.lt_s (v128.load (i32.const 0)) (v128.const i32x4 5 5 5 5)))))
... compiles to the following native code before this stack:
[...]
vld $vr0, $s7, 0
vldi $vr1, 0x805
vslt.w $vr0, $vr0, $vr1
vst $vr0, $s7, 32
[...]
... while it compiles to this after the stack:
[...]
vld $vr0, $s7, 0
vslti.w $vr0, $vr0, 5
vst $vr0, $s7, 32
[...]
Backed out for causing linting failures @IonTypes.h.
| Assignee | ||
Comment 8•18 hours ago
|
||
This looks trivial to fix. The problem is that when I switched from std::optional to mozilla::Maybe, I didn't remove the header inclusion.
Comment 10•11 hours ago
|
||
Comment 11•2 minutes ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/82d7a581de8f
https://hg.mozilla.org/mozilla-central/rev/4c50de45ab36
https://hg.mozilla.org/mozilla-central/rev/4011fb8ab706
https://hg.mozilla.org/mozilla-central/rev/14723ea5c6f2
Description
•