Closed Bug 1994190 Opened 10 months ago Closed 10 months ago

Simplify rounding instructions for riscv64

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

And also perform the same changes for mips64 and loong64 for consistency.

"top word" was probably copied from ARM32, but doesn't reflect the ARM64 code.

Drive-by change:

  • Remove unused variables.

This matches the approach used in ARM64 and requires less instructions, because
we no longer have to read from the fcsr register.

RISCV rounding instructions return INT64_{MIN,MAX} [1] for invalid inputs,
including NaN, so we can easily determine the error case by sign-extending
from 32-bit to 64-bit and then comparing against the conversion result.

[1] https://riscv.github.io/riscv-isa-manual/snapshot/unprivileged/#int_conv

Perform the same changes for loong64.

This also ensures we don't bail for code like Math.floor(0x7fff_ffff) or
Math.floor(-0x8000_0000). (Similar for other rounding instructions.)

Severity: -- → N/A
Priority: -- → P5
Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/4425f310c013 https://hg.mozilla.org/integration/autoland/rev/641baf8ffa54 Part 1: Fix some comments in ARM64 MacroAssembler. r=spidermonkey-reviewers,iain https://github.com/mozilla-firefox/firefox/commit/ea235975dec5 https://hg.mozilla.org/integration/autoland/rev/0e10cacc0b66 Part 2: Simplify rounding instructions for riscv64. r=spidermonkey-reviewers,iain https://github.com/mozilla-firefox/firefox/commit/dae7db185717 https://hg.mozilla.org/integration/autoland/rev/2964fd4af686 Part 3: Simplify rounding instructions for loong64. r=spidermonkey-reviewers,iain https://github.com/mozilla-firefox/firefox/commit/5dbd7fb9849c https://hg.mozilla.org/integration/autoland/rev/1b69a94373c3 Part 4: Simplify rounding instructions for mips64. r=spidermonkey-reviewers,iain
QA Whiteboard: [qa-triage-done-c147/b146]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: