Closed Bug 1987693 Opened 1 year ago Closed 1 year ago

riscv64: Unify 32b-to-64b int sign extension to using SignExtendWord

Categories

(Core :: JavaScript Engine: JIT, task, P5)

task

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: csmantle, Assigned: csmantle)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Currently many equivalent instructions are used in riscv64 backend for 32b-to-64b sign extension, like slliw rx, ry, 0. However, the ISA spec recommends the usage of addiw rx, ry, 0 as a sign extension instruction, and even defines a pseudoinstruction sext.w for it:

Note, ADDIW rd, rs1, 0 writes the sign extension of the lower 32 bits of register rs1 into register rd (assembler pseudoinstruction SEXT.W).

-- https://riscv.github.io/riscv-isa-manual/snapshot/unprivileged/#norm:inst:addiw:operation

And we already have a MacroAssemblerRiscv64Compat::SignExtendWord defined for it. Using this to perform sign extension would make this operation look uniform in disassembly.

Assignee: nobody → webmaster
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Blocks: sm-riscv64
Severity: -- → N/A
Priority: -- → P5
Pushed by jdemooij@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f38a74b508e2 https://hg.mozilla.org/integration/autoland/rev/44ad01563397 [riscv64] Use MacroAssemblerRiscv64Compat::SignExtendWord for 32b-to-64b sign extension. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: