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

Dingli Zhang dzhang at openjdk.org
Thu Mar 23 16:45:23 UTC 2023


Please review this backport to riscv-port-jdk17u.
Backport of [JDK-8297715](https://bugs.openjdk.org/browse/JDK-8297715).
The original patch cannot be directly applied because of the line number, but there are no other additional changes.

The effect is that we could then optimize C2 JIT code for methods like (print with case `xml.validation` in SPECjvm2008):
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

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


Testing:
- Tier1 passed without new failure on unmacthed (release).

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

Commit messages:
 - 8297715: RISC-V: C2: Use single-bit instructions from the Zbs extension

Changes: https://git.openjdk.org/riscv-port-jdk17u/pull/26/files
 Webrev: https://webrevs.openjdk.org/?repo=riscv-port-jdk17u&pr=26&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297715
  Stats: 25 lines in 4 files changed: 24 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/riscv-port-jdk17u/pull/26.diff
  Fetch: git fetch https://git.openjdk.org/riscv-port-jdk17u.git pull/26/head:pull/26

PR: https://git.openjdk.org/riscv-port-jdk17u/pull/26


More information about the riscv-port-dev mailing list