[riscv-port-jdk11u:riscv-port] RFR: 8297715: RISC-V: C2: Use single-bit instructions from the Zbs extension

Ludovic Henry luhenry at openjdk.org
Thu Apr 11 08:12:03 UTC 2024


On Wed, 10 Apr 2024 08:00:34 GMT, Gui Cao <gcao at openjdk.org> wrote:

> Hi,
> Please help review this backport to riscv-port-jdk11u.
> Backport of [JDK-8297715](https://bugs.openjdk.org/browse/JDK-8297715).
> The original patch cannot be directly applied because of  we use `experimental(bool, UseZbs, false, "Use Zbs instructions")` in riscv-port-jdk11u instead of OpenJDK higher version`product(bool, UseZbs, false, EXPERIMENTAL, "Use Zbs instructions")`
> 
> The effect is that we could then optimize C2 JIT code for methods like (print with case xml.validation in SPECjvm2008) on qemu system with `-XX:+UnlockExperimentalVMOptions -XX:+UseZbs`:
> Before:
> 
> 03c   	lhu  R28, [R11, #12]	# short, #@loadUS ! Field: com/sun/org/apache/xerces/internal/dom/NodeImpl.flags
> 040 + 	andi  R7, R28, #2	#@andI_reg_imm
> 044 + 	snez  R10, R7	#@convI2Bool
> 048   	# pop frame 32
> 
> 
> After:
> 
> 03c   	lhu  R28, [R11, #12]	# short, #@loadUS ! Field: com/sun/org/apache/xerces/internal/dom/NodeImpl.flags
> 040 + 	bexti  R10, R28, #2	#@convI2Bool_andI_reg_immIpowerOf2
> 044   	# pop frame 32
> 
> 
> ### Testing
> - [x] Run tier1 tests on SOPHON SG2042 (release)

Marked as reviewed by luhenry (no project role).

-------------

PR Review: https://git.openjdk.org/riscv-port-jdk11u/pull/21#pullrequestreview-1993551432


More information about the riscv-port-dev mailing list