8391545: RISC-V: Implement Zibi extension (branch with immediate) - #32624
8391545: RISC-V: Implement Zibi extension (branch with immediate)#32624zangcq wants to merge 1 commit into
Conversation
* RISC-V: Harden Zibi tests against unsupported hardware * RISC-V: Verify Zibi branch codegen in TestZibiBranch * RISC-V: Implement Zibi extension (branch with immediate) Co-authored-by: Pengcheng Wang <wangpengcheng.pp@bytedance.com>
|
👋 Welcome back zangcq! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
/contributor add Pengcheng Wang wangpengcheng.pp@bytedance.com |
|
@zangcq |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
/issue JDK-8391545 |
|
@zangcq The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated. |
|
But |
|
Yes, Zibi is still unratified — currently at v0.7 (experimental). The ISA Manual integration PR (riscv/riscv-isa-manual#3343) was opened on 2026-08-24 and has not yet been merged. Thanks for your suggestion. |
Add JVM/HotSpot support for the RISC-V Zibi extension (v0.7), which
defines two B-type conditional branches that compare an integer register
against a small immediate constant:
Both reuse the BRANCH major opcode and the standard B-type immediate
layout; the 5-bit field that would hold rs2 carries cimm instead. The
comparison constant decodes as cimm=0 -> -1 and cimm=1..31 -> 1..31
(comparison with zero keeps using beq/bne with x0).
Spec: https://github.com/riscv/zibi/blob/main/src/unpriv/zibi.adoc
Changes:
is left unwired because there is no hwprobe/HWCAP bit yet; enable
with -XX:+UseZibi.
helpers in the assembler.
far form realized by negating the condition (beqi <-> bnei) over the
same constant.
loop instructs, all gated on UseZibi so codegen falls back to
materialize-plus-reg-branch when the extension is off.
The existing conditional-branch bind/patch machinery works unchanged
because beqi/bnei share the BRANCH opcode and B-immediate layout.
Progress
Issue
Contributors
<wangpengcheng.pp@bytedance.com>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32624/head:pull/32624$ git checkout pull/32624Update a local copy of the PR:
$ git checkout pull/32624$ git pull https://git.openjdk.org/jdk.git pull/32624/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32624View PR using the GUI difftool:
$ git pr show -t 32624Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32624.diff
Using Webrev
Link to Webrev Comment