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

Hamlin Li mli at openjdk.org
Tue Apr 16 07:17:01 UTC 2024


On Mon, 15 Apr 2024 20:33:32 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   refine code
>
> 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

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

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


More information about the hotspot-dev mailing list