Closed Bug 2091045 Opened 8 days ago Closed 6 days ago

[riscv64] 16-bit atomic operations give wrong results on CPUs without Zbb

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

defect

Tracking

()

RESOLVED FIXED
162 Branch
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.

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.

Assignee: nobody → andrew
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 2056833

Severity: -- → S3
Priority: -- → P2
Pushed by webmaster@csmantle.top: https://github.com/mozilla-firefox/firefox/commit/a56eb0b68359 https://hg.mozilla.org/integration/autoland/rev/2fe14902ef7a [riscv64] Shift the operand of halfword atomics when Zbb is unavailable. r=csmantle
Status: ASSIGNED → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: