RFR: 8330266: RISC-V: Restore frm to RoundingMode::rne after JNI [v2]

Vladimir Kempik vkempik at openjdk.org
Tue Apr 16 07:23:00 UTC 2024


On Tue, 16 Apr 2024 07:14:17 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1177:
>> 
>>> 1175:     // don't want non-IEEE rounding modes.
>>> 1176:     guarantee(RoundingMode::rne == 0, "must be");
>>> 1177:     beq(tmp, zr, skip_fsrmi);        // Only reset FRM if it's wrong
>> 
>> is it really better (performance wise) than doing it always, unconditionaly (so minus frrm, minus beq) ?
>
> It's done by following reasons:
> 1. by the optimization guide, https://riscv-optimization-guide.riseproject.dev/#_controlling_rounding_behavior_scalar.
> 2. aarch64 apply the similar optimization.
> 
> Please also check discussion at: https://github.com/openjdk/jdk/pull/18758

Thanks for the links, however there are no performance claims in that discussion, only few "maybes" for "some hardware", can we check on existing h/w ( c910, u74) ? with jmh test doing dummy jni calls ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18785#discussion_r1566844775


More information about the hotspot-dev mailing list