Add support for zbs, zfa, zfhmin, and zicond extensions
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(9 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 |
Add support for zbs, zfa, zfhmin, and zicond extensions, which are mandatory extensions in RVA22U64 resp. RVA23U64, so are likely supported by most systems.
| Assignee | ||
Comment 1•4 months ago
|
||
Also add #define USE_HWPROBE to avoid repeating the condition when hardware
probes can be used.
| Assignee | ||
Comment 2•4 months ago
|
||
The new --riscv-ext shell option is similar to the --arm-hwcap option for
ARM32 and allows specifying the RISCV ISA or profile. The option is a simplified
implementation of the -march option used by GCC/Clang [1].
Also removes support for the RISCV_EXT_ZBA and RISCV_EXT_ZBB environment
variables. Instead the RISCV_EXT environment variable can now be used.
| Assignee | ||
Comment 3•4 months ago
|
||
This allows to optimise some bit-clear/set/invert patterns to use fewer instructions.
| Assignee | ||
Comment 4•4 months ago
|
||
The source files were copied from V8.
| Assignee | ||
Comment 5•4 months ago
|
||
The code was also copied from V8.
| Assignee | ||
Comment 6•4 months ago
|
||
The code was also copied from V8, but needed additional changes to work with
our float16 defined in "vm/Float16.h". (That way we don't need to copy the
Float16 implementation from V8.)
fcvt.s.h is incorrectly implemented in V8, so I had to double-check other
zfh/zfhmin instructions are correctly implemented. This also led to slightly
different code when compared to V8.
Also fixes some bugs which were found when comparing against the latest V8 code.
| Assignee | ||
Comment 7•4 months ago
|
||
Also moves the scratch register for RoundHelper, so we don't unnecessarily
reserve it.
| Assignee | ||
Comment 8•4 months ago
|
||
Adds computeAddress to avoid duplicating more code to compute addresses.
| Assignee | ||
Comment 9•4 months ago
|
||
Moves the implementation for cmp32Move32 into the cpp-file to avoid generating
too large inline methods.
Zicond actually allows even more concise instructions sequences for some code
patterns. For example the C++ code x ? x : y can be implemented as just:
czero.nez a2, a1, a0
add a0, a0, a2
I haven't implemented this, because we should first check which code patterns
can actually be generated by the JIT compiler.
Comment 10•4 months ago
•
|
||
It seems that I'm having some trouble locally applying some of the patches:
$ moz-phab patch D304798
Nothing changed.ment.. |
Patching revisions: D304789 D304790 D304791 D304792 D304793 D304794 D304795 D304796 D304798
Unknown revision: 0636c092d583
Cinnabar extension not enabled.
Use --apply-to to set the base commit.
$ moz-phab patch --apply-to here D304798
Nothing changed.ment.. |
Patching revisions: D304789 D304790 D304791 D304792 D304793 D304794 D304795 D304796 D304798
Warning: Target revision is empty.
Created bookmark phab-D304798
D304789 applied
D304790 applied
D304791 applied
D304792 applied
D304793 applied
D304794 applied
D304795 applied
D304796 applied
error: patch failed: js/src/jit/riscv64/MacroAssembler-riscv64.h:739
error: js/src/jit/riscv64/MacroAssembler-riscv64.h: patch does not apply
My HEAD is at cf8510b7c3bb11cf4abc2f8aa431eebdcb38b41b:
Commit ID: cf8510b7c3bb11cf4abc2f8aa431eebdcb38b41b
Change ID: mrxmynmwomssrnxuuykvwmuxkwrrmmnw
Bookmarks: main@origin
Author : Mark Kennedy <mkennedy@mozilla.com> (2026-06-05 07:24:55)
Committer: mkennedy@mozilla.com <mkennedy@mozilla.com> (2026-06-05 07:27:09)
Bug 2040444 - Fix back button trapping subcategory navigation on about:preferences r=tgiles
Seems to be conflicting with https://phabricator.services.mozilla.com/D304002:
$ git apply --reject ./D304798.1780731164.diff
Checking patch js/src/jit/riscv64/MacroAssembler-riscv64-inl.h...
Hunk #1 succeeded at 1411 (offset -36 lines).
Hunk #2 succeeded at 1430 (offset -36 lines).
Checking patch js/src/jit/riscv64/MacroAssembler-riscv64.h...
Hunk #1 succeeded at 334 (offset 10 lines).
error: while searching for:
void splitTagForTest(const ValueOperand& value, ScratchTagScope& tag) {
splitTag(value, tag);
}
void moveIfZero(Register dst, Register src, Register cond) {
Label done;
ma_b(cond, cond, &done, NonZero, ShortJump);
mv(dst, src);
bind(&done);
}
void moveIfNotZero(Register dst, Register src, Register cond) {
Label done;
ma_b(cond, cond, &done, Zero, ShortJump);
mv(dst, src);
bind(&done);
}
error: patch failed: js/src/jit/riscv64/MacroAssembler-riscv64.h:739
Checking patch js/src/jit/riscv64/MacroAssembler-riscv64.cpp...
Hunk #1 succeeded at 368 (offset 8 lines).
Hunk #2 succeeded at 654 (offset 8 lines).
Hunk #3 succeeded at 727 (offset 8 lines).
Applied patch js/src/jit/riscv64/MacroAssembler-riscv64-inl.h cleanly.
Applying patch js/src/jit/riscv64/MacroAssembler-riscv64.h with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Applied patch js/src/jit/riscv64/MacroAssembler-riscv64.cpp cleanly.
| Assignee | ||
Comment 11•4 months ago
|
||
I've rebased the patches, it should work now. Thanks for the heads-up!
Updated•4 months ago
|
Updated•4 months ago
|
Comment 12•4 months ago
|
||
Comment 13•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/0b9c9b3e669c
https://hg.mozilla.org/mozilla-central/rev/aaf8014ed329
https://hg.mozilla.org/mozilla-central/rev/89d049ee0a7b
https://hg.mozilla.org/mozilla-central/rev/10ba15e10994
https://hg.mozilla.org/mozilla-central/rev/356343929431
https://hg.mozilla.org/mozilla-central/rev/ea56bb6d2ea6
https://hg.mozilla.org/mozilla-central/rev/dd4152e5d10e
https://hg.mozilla.org/mozilla-central/rev/d1a02b3bdd8a
https://hg.mozilla.org/mozilla-central/rev/3e1f20b3f830
Updated•4 months ago
|
Description
•