RFR: 8342884: RISC-V: verify float <--> float16 conversion

Fei Yang fyang at openjdk.org
Thu Oct 24 00:14:04 UTC 2024


On Wed, 23 Oct 2024 13:22:32 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Hi,
> Can you help to review this simple patch? it removes the `Experimental` of the `UseZvfh`.
> Thanks
> 
> Currently, only float <--> float16 conversions use Zvfh extension, I've run the jmh tests on bananapi, the performance result shows it's good.
> <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-XX:+UseZfh -XX:+UnlockExperimentalVMOptions -XX:+/-UseZvfh | (size) | Mode | Cnt | Score -intrinsic | Score +intrinsic | Error | Units | Improvement
> -- | -- | -- | -- | -- | -- | -- | -- | --
> Fp16ConversionBenchmark.float16ToFloat | 2048 | avgt | 10 | 8129.72 | 4729.125 | 71.937 | ns/op | 1.719
> Fp16ConversionBenchmark.float16ToFloatMemory | 2048 | avgt | 10 | 16.9 | 16.894 | 0.002 | ns/op | 1
> Fp16ConversionBenchmark.floatToFloat16 | 2048 | avgt | 10 | 12561.962 | 3767.944 | 12.652 | ns/op | 3.334
> Fp16ConversionBenchmark.floatToFloat16Memory | 2048 | avgt | 10 | 18.146 | 18.147 | 0.003 | ns/op | 1
> 
> </google-sheets-html-origin>

Thanks for carrying the verification.

src/hotspot/cpu/riscv/globals_riscv.hpp line 119:

> 117:           "Use Zihintpause instructions")                                        \
> 118:   product(bool, UseZvbb, false, EXPERIMENTAL, "Use Zvbb instructions")           \
> 119:   product(bool, UseZvfh, false, "Use Zvfh instructions")                         \

Nit: Better to move it out of the `EXPERIMENTAL` group. Maybe immediately after the line for `UseZfh`.

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

Changes requested by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21664#pullrequestreview-2390903644
PR Review Comment: https://git.openjdk.org/jdk/pull/21664#discussion_r1814025526


More information about the hotspot-compiler-dev mailing list