RFR: 8330094: RISC-V: Save and restore FCSR in the call stub [v2]

Ludovic Henry luhenry at openjdk.org
Mon Apr 15 16:13:44 UTC 2024


On Mon, 15 Apr 2024 13:23:10 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/17745#discussion_r1558783467, we should do the similar thing as [JDK-8319973](https://bugs.openjdk.org/browse/JDK-8319973) on aarch64.
>> Thanks!
>> 
>> Tests running ...
>
> Hamlin Li has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - update comment accordingly
>  - skip setting frm when not needed

Changes requested by luhenry (Committer).

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 308:

> 306:     Label skip_fsrmi;
> 307:     __ mv(t1, __ RoundingMode::rne);
> 308:     __ beq(t0, t1, skip_fsrmi);

You can take advantage of `RoundingMode::rne == 0` by doing `__ beq(t0, zr, skip_fsrmi)` and remove the above `__ mv(t1, __ RoundingMode::rne);`. Please add a `guarantee(__ RoundingMode::rne == 0)` as well, just to self-document.

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

PR Review: https://git.openjdk.org/jdk/pull/18758#pullrequestreview-2001522371
PR Review Comment: https://git.openjdk.org/jdk/pull/18758#discussion_r1566037120


More information about the hotspot-dev mailing list