-
Sub-task
-
Resolution: Fixed
-
P4
-
24
-
b04
-
riscv
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
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
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
The perf data above shows that, if zbb is not supported on current hardware, then intrinsicv brings perf regression rather than benefit.
So, ReverseBytesI/L should only be enabled when zbb is supported.
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
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
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
The perf data above shows that, if zbb is not supported on current hardware, then intrinsicv brings perf regression rather than benefit.
So, ReverseBytesI/L should only be enabled when zbb is supported.