RFR: 8354815: RISC-V: Change type of bitwise rotation shift to iRegIorL2I

Anjian-Wen duke at openjdk.org
Wed Apr 16 14:08:21 UTC 2025


There is no need to do a type conversion when the shift amount of bitwise rotation is an integer converted from long (ConvL2I).
There reason is that these instruction performs a rotate right/left of source by the amount in the least-significant 5/6 bits
of the shift amount depending on the width of the operation (32-bit/64-bit). For 32-bit operations, the resulting 32-bit
value is sign-extended by copying bit 31 to all of the more-significant bits. This means that we could use iRegIorL2I type for
source for these 32-bit operations as well.

Jtreg Testing in progress

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

Commit messages:
 - RISC-V: Optimize zbb rol/ror iRegI to iRegIorL2I

Changes: https://git.openjdk.org/jdk/pull/24618/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24618&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354815
  Stats: 27 lines in 3 files changed: 14 ins; 2 del; 11 mod
  Patch: https://git.openjdk.org/jdk/pull/24618.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24618/head:pull/24618

PR: https://git.openjdk.org/jdk/pull/24618


More information about the hotspot-compiler-dev mailing list