[riscv64] 16-bit atomic operations give wrong results on CPUs without Zbb
Categories
(Core :: JavaScript Engine: JIT, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr153 | --- | unaffected |
| firefox160 | --- | wontfix |
| firefox161 | --- | wontfix |
| firefox162 | --- | fixed |
People
(Reporter: andrew, Assigned: andrew)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
On riscv64 without the Zbb extension, 16-bit atomic read-modify-write and compare-exchange operations give wrong results. This affects wasm i32.atomic.rmw16.* and i64.atomic.rmw16.*, and JS Atomics on Int16Array and Uint16Array once Ion compiles them.
On a SpacemiT K3 with RISCV_EXT=rv64g_zba_zbs_zfhmin_zfa_zicond, these tests fail: wasm/atomic.js, wasm/large-memory-atomics-index-zero-extended.js, wasm/spec/threads/atomic.wast.js and atomics/bug1983499.js. wasm/atomicity.js times out.
Without Zbb, AtomicShiftToOffset in MacroAssembler-riscv64.cpp shifts the destination temp, which has not been written yet, instead of the operand. The fallback was added in bug 2056833. The simulator enables every RVA23 extension by default, so jit-tests never run this path.
| Assignee | ||
Comment 1•8 days ago
|
||
Without Zbb, AtomicShiftToOffset shifted the uninitialized destination register
instead of the operand, so halfword read-modify-write and compare-exchange
operations used garbage. The simulator enables Zbb by default, so no test ran
this path. Accept --riscv-ext on every platform, as --arm-hwcap is, so that
jit-tests can add a variant that only runs on riscv64.
Updated•8 days ago
|
Comment 2•8 days ago
|
||
Set release status flags based on info from the regressing bug 2056833
Updated•8 days ago
|
Comment 4•6 days ago
|
||
| bugherder | ||
Description
•