Correctly implement MacroAssembler::branchTruncateDoubleToInt32 on ARM64
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(19 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1810688 - Part 14: Merge NaN with negative zero check in floor{Float32,Double}ToInt32. r=jandem!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1810688 - Part 15: Merge NaN with negative zero check in trunc{Float32,Double}ToInt32. r=jandem!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Correctly implement MacroAssembler::branchTruncateDoubleToInt32 on ARM64 and some additional (mostly ARM64 specific) clean-ups.
Assignee | ||
Comment 1•2 years ago
|
||
The zero constant 0.0 doesn't need to be loaded in a separate temp register,
but instead can be encoded directly in the Fcmp
instruction.
Assignee | ||
Comment 2•2 years ago
|
||
This makes it a bit easier to read the constants, because missing digits can
be more easy detected.
Depends on D166993
Assignee | ||
Comment 3•2 years ago
|
||
The previous code didn't actually implement truncation, so any double with a
fractional part was triggering the failure path.
Depends on D166994
Assignee | ||
Comment 4•2 years ago
|
||
Fjcvtzs
wasn't actually used for branchTruncateDoubleMaybeModUint32
.
Depends on D166995
Assignee | ||
Comment 5•2 years ago
|
||
The Add
, Cmp
, and B
instruction sequence tests for INT64_MIN
and
INT64_MAX
, but that's not easy to see right away.
Depends on D166996
Assignee | ||
Comment 6•2 years ago
|
||
If overflows aren't possible, we can use Add
instead of Adds
.
Depends on D166997
Assignee | ||
Comment 7•2 years ago
|
||
These methods aren't used anymore.
Depends on D166998
Assignee | ||
Comment 8•2 years ago
|
||
ToPayload
and ToValue
are neither used nor useful when nun-boxing isn't used.
Depends on D166999
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D167000
Assignee | ||
Comment 10•2 years ago
|
||
Inline the methods into their only callers to simplify the code.
Depends on D167001
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D167002
Comment 12•2 years ago
|
||
It looks like Loong64 needs a similar fix to part 3.
Comment 13•2 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #12)
It looks like Loong64 needs a similar fix to part 3.
Thanks for your information, I have submited loong64 fix patch to bug 1810728.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 14•2 years ago
|
||
Depends on D167003
Assignee | ||
Comment 15•2 years ago
|
||
Drive-by fix:
- Remove unnecessary scratch register use in ceilDoubleToInt32.
Depends on D167063
Assignee | ||
Comment 16•2 years ago
|
||
We can combine the NaN with the existing negative zero check, which avoids the
additional Fcmp
instruction.
Depends on D167064
Assignee | ||
Comment 17•2 years ago
|
||
Depends on D167065
Assignee | ||
Comment 18•2 years ago
|
||
Convert the input to a 64-bit instead of 32-bit integer, similar to the floor
and ceil
methods. This ensures we don't repeatedly fail for inputs like
Math.trunc(0x7fff_ffff + 0.5)
.
Depends on D167066
Assignee | ||
Comment 19•2 years ago
|
||
Instead of adding 0.5 for values in [-0.5, -0) and later always taking the
failure branch, because the result is always 0, directly take the failure
path when the input is in [-0.5, -0).
Depends on D167067
Assignee | ||
Comment 20•2 years ago
|
||
Changes similar to part 16 to avoid repeatedly failing for inputs like Math.round(0x7fff_ffff + 0.1)
.
Depends on D167068
Assignee | ||
Comment 21•2 years ago
|
||
Port the changes from part 17 to x86-shared.
Comment 23•2 years ago
|
||
Comment 24•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/92a6cbe11ba1
https://hg.mozilla.org/mozilla-central/rev/5a51bab18af1
https://hg.mozilla.org/mozilla-central/rev/091bc4e096d4
https://hg.mozilla.org/mozilla-central/rev/828041e46623
https://hg.mozilla.org/mozilla-central/rev/c620790821e8
https://hg.mozilla.org/mozilla-central/rev/124475b37249
https://hg.mozilla.org/mozilla-central/rev/61316566a8c2
https://hg.mozilla.org/mozilla-central/rev/e3ecd2e00465
https://hg.mozilla.org/mozilla-central/rev/bf7c143ca420
https://hg.mozilla.org/mozilla-central/rev/e0b1f6b79c01
https://hg.mozilla.org/mozilla-central/rev/8854d2912c9c
https://hg.mozilla.org/mozilla-central/rev/7b75cfc88295
https://hg.mozilla.org/mozilla-central/rev/2cc9d573aa5e
https://hg.mozilla.org/mozilla-central/rev/b1758f40e0b7
https://hg.mozilla.org/mozilla-central/rev/ea06cba70d99
https://hg.mozilla.org/mozilla-central/rev/65989e5b9ae1
https://hg.mozilla.org/mozilla-central/rev/634ea72f2f8f
https://hg.mozilla.org/mozilla-central/rev/2022d4e30361
https://hg.mozilla.org/mozilla-central/rev/0bdaddbae382
Description
•