RFR: 8355667: RISC-V: Add backend implementation for unsigned vector Min / Max operations [v2]

Fei Yang fyang at openjdk.org
Mon Apr 28 09:38:16 UTC 2025


> Hi, please review this change.
> https://bugs.openjdk.org/browse/JDK-8338021 proposed new vector operators including Unsigned Vector Min / Max.
> This intrinsify Unsigned Vector Min / Max operations with RVV extension for RISC-V backend to improve performance.
> This also enables some extra IR tests in file `test/hotspot/jtreg/compiler/vectorapi/VectorCommutativeOperSharingTest.java`.
> 
> Testing:
> - [x] make test TEST="jdk_vector" (QEMU / fastdebug)
> 
> JMH tested on BPI-F3 (256 bit VLEN) SBC for reference:
> Before:
> 
> ByteMaxVector.UMAX          1024  thrpt    5  58.657 ± 17.216  ops/ms
> ByteMaxVector.UMAXMasked    1024  thrpt    5  45.581 ± 18.164  ops/ms
> ByteMaxVector.UMIN          1024  thrpt    5  55.275 ± 15.863  ops/ms
> ByteMaxVector.UMINMasked    1024  thrpt    5  44.651 ± 29.209  ops/ms
> ShortMaxVector.UMAX          1024  thrpt    5  24.146 ± 7.570  ops/ms
> ShortMaxVector.UMAXMasked    1024  thrpt    5  21.506 ± 0.430  ops/ms
> ShortMaxVector.UMIN          1024  thrpt    5  24.261 ± 6.993  ops/ms
> ShortMaxVector.UMINMasked    1024  thrpt    5  20.980 ± 1.622  ops/ms
> IntMaxVector.UMAX          1024  thrpt    5  10.780 ± 0.812  ops/ms
> IntMaxVector.UMAXMasked    1024  thrpt    5  10.609 ± 0.851  ops/ms
> IntMaxVector.UMIN          1024  thrpt    5  10.845 ± 0.578  ops/ms
> IntMaxVector.UMINMasked    1024  thrpt    5  10.705 ± 0.562  ops/ms
> LongMaxVector.UMAX          1024  thrpt    5  5.445 ± 0.439  ops/ms
> LongMaxVector.UMAXMasked    1024  thrpt    5  5.387 ± 0.285  ops/ms
> LongMaxVector.UMIN          1024  thrpt    5  5.379 ± 0.407  ops/ms
> LongMaxVector.UMINMasked    1024  thrpt    5  5.373 ± 0.236  ops/ms
> 
> 
> After:
> 
> ByteMaxVector.UMAX          1024  thrpt    5  2552.161 ±  121.213  ops/ms
> ByteMaxVector.UMAXMasked    1024  thrpt    5  2444.001 ±  105.139  ops/ms
> ByteMaxVector.UMIN          1024  thrpt    5  2616.963 ±    3.065  ops/ms
> ByteMaxVector.UMINMasked    1024  thrpt    5  2367.968 ± 1057.028  ops/ms
> ShortMaxVector.UMAX          1024  thrpt    5  1363.676 ±   9.294  ops/ms
> ShortMaxVector.UMAXMasked    1024  thrpt    5  1321.759 ± 121.471  ops/ms
> ShortMaxVector.UMIN          1024  thrpt    5  1368.598 ±   5.251  ops/ms
> ShortMaxVector.UMINMasked    1024  thrpt    5  1337.044 ±   1.434  ops/ms
> IntMaxVector.UMAX          1024  thrpt    5  566.509 ±  0.658  ops/ms
> IntMaxVector.UMAXMasked    1024  thrpt    5  559.456 ±  0.491  ops/ms
> IntMaxVector.UMIN          1024  thrpt    5  569.238 ±  1.309  ops/ms
> IntMaxVector.UMINMasked    1024  thrpt    5  535.359 ± 15.765  ops/ms
> Long...

Fei Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into JDK-8355667
 - 8355667: RISC-V: Add backend implementation for unsigned vector Min / Max operations

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24909/files
  - new: https://git.openjdk.org/jdk/pull/24909/files/59379015..b4d876f2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24909&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24909&range=00-01

  Stats: 2025 lines in 165 files changed: 473 ins; 323 del; 1229 mod
  Patch: https://git.openjdk.org/jdk/pull/24909.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24909/head:pull/24909

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


More information about the hotspot-compiler-dev mailing list