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

Hamlin Li mli at openjdk.org
Wed Jul 24 11:07:47 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 incrementally with one additional commit since the last revision:

  enable when vlenb >= 32

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17745/files
  - new: https://git.openjdk.org/jdk/pull/17745/files/a9faee89..ffed86b1

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

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