RFR: 8318158: RISC-V: implement roundD/roundF intrinsics [v2]
Olga Mikhaltsova
omikhaltcova at openjdk.org
Wed Nov 8 16:46:15 UTC 2023
> Please, review this Implementation of the roundD/roundF intrinsics for RISC-V platform.
> As shown below the output for RISC-V instructions and Java methods differs only for NaN argument.
>
> RISC-V Java
> (FCVT.W.S) (FCVT.L.D) (long round(double a)) (int round(float a))
> Minimum valid input (after rounding) −2^31 −2^63 Long.MIN_VALUE Integer.MIN_VALUE
> Maximum valid input (after rounding) 2^31 − 1 2^63 − 1 Long.MAX_VALUE Integer.MAX_VALUE
> Output for out-of-range negative input −2^31 −2^63 Long.MIN_VALUE Integer.MIN_VALUE
> Output for −∞ −2^31 −2^63 Long.MIN_VALUE Integer.MIN_VALUE
> Output for out-of-range positive input 2^31 − 1 2^63 - 1 Long.MAX_VALUE Integer.MAX_VALUE
> Output for +∞ 2^31 − 1 2^63 - 1 Long.MAX_VALUE Integer.MAX_VALUE
> Output for NaN 2^31 − 1 2^63 - 1 0 0
>
> The benchmark shows the following performance improvement:
>
> **Before**
>
> Benchmark (TESTSIZE) Mode Cnt Score Error Units
> FpRoundingBenchmark.test_round_double 2048 thrpt 15 4.675 ± 0.259 ops/ms
> FpRoundingBenchmark.test_round_float 2048 thrpt 15 4.549 ± 0.210 ops/ms
>
>
> **After**
>
> Benchmark (TESTSIZE) Mode Cnt Score Error Units
> FpRoundingBenchmark.test_round_double 2048 thrpt 15 10.483 ± 0.681 ops/ms
> FpRoundingBenchmark.test_round_float 2048 thrpt 15 10.475 ± 0.480 ops/ms
>
>
> Testing: tier1 tests successfully passed on a RISC-V HiFive board with Linux.
Olga Mikhaltsova has updated the pull request incrementally with one additional commit since the last revision:
Fixed intrinsics implementation. Reverted changes of FCVT_SAFE.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16382/files
- new: https://git.openjdk.org/jdk/pull/16382/files/d8524ff9..13a65e48
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16382&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16382&range=00-01
Stats: 66 lines in 3 files changed: 53 ins; 1 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/16382.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16382/head:pull/16382
PR: https://git.openjdk.org/jdk/pull/16382
More information about the hotspot-dev
mailing list