-
Enhancement
-
Resolution: Fixed
-
P4
-
21
-
b25
-
riscv
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8311767 | 17.0.9 | Fei Yang | P4 | Resolved | Fixed | b01 |
RISC-V branch and jump instructions use 64-bit registers instead of 32-bit
versions in RV64I. We use test_bit to test if bit 31 is zero to determine if a
32-bit register is less than zero currently.
However, there will be two instructions when we use test_bit to test bit
31/63 without Zbs extension[1], we can just use sign_extend instead, which
only use one instruction.
At the same time, we also change some 32-bit symbolic extension operations to
sign_extend for better readability.
[1] https://github.com/openjdk/jdk/blob/e21f865d84c7c861843ff568019e1ad11d280a50/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L4596-L4603
versions in RV64I. We use test_bit to test if bit 31 is zero to determine if a
32-bit register is less than zero currently.
However, there will be two instructions when we use test_bit to test bit
31/63 without Zbs extension[1], we can just use sign_extend instead, which
only use one instruction.
At the same time, we also change some 32-bit symbolic extension operations to
sign_extend for better readability.
[1] https://github.com/openjdk/jdk/blob/e21f865d84c7c861843ff568019e1ad11d280a50/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L4596-L4603
- backported by
-
JDK-8311767 RISC-V: Sign extend when comparing 32-bit value with zero instead of testing the sign bit
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/966fc82d
-
Commit openjdk/jdk/119994f3
-
Commit openjdk/riscv-port-jdk17u/0c31ef4f
-
Review openjdk/jdk17u-dev/1427
-
Review openjdk/jdk/14197
-
Review openjdk/riscv-port-jdk17u/67
(2 links to)