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

Hamlin Li mli at openjdk.org
Wed Jul 24 13:41:08 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.
> 
> For double, even vlenb == 32, there is still some regression, so in this pr I only enable it when vlenb >= 64. Although there is no hardware to verify it, I think from the trend of performance data on bananapi and k230, it's promising to bring better performance rather than regression for double when vlenb == 64+. Please compare the data of `Benchmark   on bananapi, +UseSuperWord` and `Benchmark   on k230, +UseSuperWord, enable RoundVF/D when vlenb == 16`.
> 
> 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
> Benchmark   on bananapi, +UseSuperWord
> <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 bananapi, +UseSuperWord | (TESTSIZE) | Mode | Cnt | Score +intrinsic | Score -intrinsic | Error | Units | Improvement
> -- | -- | -- | -- | -- | -- | -- | -- | --
> FpRoundingBenchmark.test_round_double | 2048 | avgt | 10 | 23794.153 | 20557.467 | 2899.266 | ns/op | 0.864
> FpRoundingBenchmark.test_round_float | 2048 | avgt | 10 | 11531.853 | 16562.431 | 865.779 | ns/op | 1.436
> 
> </google-sheets-html-origin>
> 
> Benchmark   on bananapi, -UseSuperWord
> <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 bananapi, -UseSuperWord | (TESTSIZE) | Mode | Cnt | Score +intrinsic | Score -intrinsic | Error | Units | Improvement
> -- | -- | -- | -- | -- | -- | -- | -- | --
> FpRoundingBenchmark.test_round_double | ...

Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:

  enable roundVD when MaxVectorSize >= 64

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17745/files
  - new: https://git.openjdk.org/jdk/pull/17745/files/42f582e2..8f3af2f7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17745&range=10
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17745&range=09-10

  Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 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