RFR: 8330266: RISC-V: Restore frm to RoundingMode::rne after JNI
Ludovic Henry
luhenry at openjdk.org
Mon Apr 15 16:15:43 UTC 2024
On Mon, 15 Apr 2024 15:37:06 GMT, Hamlin Li <mli at openjdk.org> wrote:
> Hi,
> Can you help to review this patch?
> As discussed at: https://github.com/openjdk/jdk/pull/18758#pullrequestreview-1999982333, we'd better to do it.
> Similar thing is done on aarch64, https://bugs.openjdk.org/browse/JDK-8320892
>
> Thanks
Changes requested by luhenry (Committer).
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1177:
> 1175: // Set FRM to the state we need. We do want Round to Nearest. We
> 1176: // don't want non-IEEE rounding modes.
> 1177: beq(tmp1, tmp2, skip_fsrmi); // Only reset FRM if it's wrong
Same as https://github.com/openjdk/jdk/pull/18758#discussion_r1566037120, you can take advantage of `RoundingMode::rne == 0` by doing `beq(tmp1, zr, skip_fsrmi);` and adding a `guarantee(RoundingMode::rne == 0);` right above for self-documentation.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18785#pullrequestreview-2001532917
PR Review Comment: https://git.openjdk.org/jdk/pull/18785#discussion_r1566044382
More information about the hotspot-dev
mailing list