RFR: 8334396: RISC-V: verify perf of ReverseBytesI/L

Hamlin Li mli at openjdk.org
Mon Jun 17 14:42:19 UTC 2024


Hi,
Can you help to review the patch?

The test data below shows that, if zbb is not supported on current hardware, then intrinsic brings perf regression rather than benefit.
So, ReverseBytesI/L should only be enabled when zbb is supported.

## Test data
existing benchmark:
test/micro/org/openjdk/bench/java/lang/Longs.java, reverseBytes()
test/micro/org/openjdk/bench/java/lang/Integers.java, reverseBytes()

all tests running below with rvv disabled.
tested on K230-CanMV

1. -XX:-UseZbb, intrinsic enabled by default
o.o.b.j.lang.Integers.reverseBytes N/A 500 avgt 6128.125 ns/op
o.o.b.j.lang.Longs.reverseBytes N/A 500 avgt 10807.930 ns/op

2. -XX:+UseZbb, intrinsic enabled by default
o.o.b.j.lang.Integers.reverseBytes N/A 500 avgt 1788.990 ns/op
o.o.b.j.lang.Longs.reverseBytes N/A 500 avgt 1113.734 ns/op

3. -XX:-UseZbb, and disable ReverseBytesI/L instrinsic
o.o.b.j.lang.Integers.reverseBytes N/A 500 avgt 3552.902 ns/op
o.o.b.j.lang.Longs.reverseBytes N/A 500 avgt 4586.980 ns/op

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

Commit messages:
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/19750/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19750&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8334396
  Stats: 35 lines in 2 files changed: 5 ins; 30 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/19750.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19750/head:pull/19750

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


More information about the hotspot-compiler-dev mailing list