RFR: 8321010: RISC-V: C2 RoundVF [v9]

Hamlin Li mli at openjdk.org
Wed Jul 24 11:43:17 UTC 2024


> Hi,
> Can you have a review on this patch to add RoundVF/RoundDF intrinsics?
> 
> Current test shows that, it bring performance gain when vlenb >= 32 (which is on bananapi), but bring regression when vlenb == 16 (which is on k230). So I only enable the intrinsic when vlenb >= 32.
> Thanks!
> 
> ## Tests
> 
> test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java test/hotspot/jtreg/compiler/c2/cr6340864/TestFloatVect.java test/hotspot/jtreg/compiler/c2/cr6340864/TestDoubleVect.java test/hotspot/jtreg/compiler/floatingpoint/TestRound.java
> 
> test/jdk/java/lang/Math/RoundTests.java
> 
> ## Performance
> 
> ### on bananapi
> vlenb == 32
> <google-sheets-html-origin style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
> Benchmark - on bananas, vlenb = 32 | (TESTSIZE) | Mode | Cnt | Score -intrinsic | Error | Units | Score -intrinsic | improvement
> -- | -- | -- | -- | -- | -- | -- | -- | --
> FpRoundingBenchmark.test_round_double | 2048 | avgt | 10 | 23400.475 | 1731.932 | ns/op | 22670.892 | 0.969
> FpRoundingBenchmark.test_round_float | 2048 | avgt | 10 | 11208.486 | 457.032 | ns/op | 21779.74 | 1.943
> 
> </google-sheets-html-origin>
> 
> ### on k230
> vlenb == 16
> <google-sheets-html-origin style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
> Benchmark - on k230, vlenb = 16 | (TESTSIZE) | Mode | Cnt | Score +intrinsic | Error | Units | Score -intrinsic | Improvement
> -- | -- | -- | -- | -- | -- | -- | -- | --
> FpRoundingBenchmark.test_round_double | 2048 | avgt | 10 | 47256.83 | 3067.847 | ns/op | 23515.04 | 0.498
> FpRoundingBenchmark.test_round_float | 2048 | avgt | 10 | 22590.425 | 1555.974 | ns/op | 20236.311 | 0.896
> 
> </google-sheets-html-origin>

Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits:

 - Merge branch 'master' into round-F+D-v
 - enable when vlenb >= 32
 - merge master
 - Merge branch 'master' into round-F+D-v
 - Merge branch 'master' into round-F+D-v
 - restore round mode back to rne
 - Merge branch 'master' into round-F+D-v
 - fix minors
 - merge master
 - fix space
 - ... and 7 more: https://git.openjdk.org/jdk/compare/ced99066...708fa0d9

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

Changes: https://git.openjdk.org/jdk/pull/17745/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17745&range=08
  Stats: 244 lines in 7 files changed: 240 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/17745.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17745/head:pull/17745

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


More information about the hotspot-compiler-dev mailing list