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

Hamlin Li mli at openjdk.org
Wed Apr 17 07:14:10 UTC 2024


On Wed, 17 Apr 2024 07:10:47 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> I don't have a strong opinion on this. This code will only be enabled by the user on command line in case we are calling some buggy external libraries which may corrupt the FP control register. It won't make a difference for the most normal cases. My local tests show that `frrm` is 3x faster than `fsrmi` on sifive/u74. So it does make sense to have the branch check on platforms like this. It should not be a big issue to other more advanced platforms with a good BranchPredictor.
>> 
>> Suggesion: `beqz(tmp, skip_fsrmi);        // Only reset FRM if it's wrong`
>
>> Suggesion: beqz(tmp, skip_fsrmi);        // Only reset FRM if it's wrong
> 
> fixed, thanks!

Thanks everyone for testing and discussion!

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

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


More information about the hotspot-dev mailing list