Simplify rounding instructions for riscv64
Categories
(Core :: JavaScript Engine: JIT, enhancement, P5)
Tracking
()
| 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.
| Assignee | ||
Comment 1•10 months ago
|
||
"top word" was probably copied from ARM32, but doesn't reflect the ARM64 code.
Drive-by change:
- Remove unused variables.
| Assignee | ||
Comment 2•10 months ago
|
||
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
| Assignee | ||
Comment 3•10 months ago
|
||
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.)
| Assignee | ||
Comment 4•10 months ago
|
||
Updated•10 months ago
|
https://hg.mozilla.org/mozilla-central/rev/641baf8ffa54
https://hg.mozilla.org/mozilla-central/rev/0e10cacc0b66
https://hg.mozilla.org/mozilla-central/rev/2964fd4af686
https://hg.mozilla.org/mozilla-central/rev/1b69a94373c3
Updated•9 months ago
|
Description
•