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

Fei Yang fyang at openjdk.org
Mon Apr 15 11:56:41 UTC 2024


On Mon, 15 Apr 2024 10:49:14 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> Interesting. So is it safe to claim that `csrr` is faster than `csrw`? I didn't measure the difference.
>
> It's fair to claim that `csrw` has side effects which may be more detrimental to performance, side effects that `csrr` that doesn't have (and can't as it's only reading).
> 
>> I didn't measure the difference.
> 
> I don't know how that affects current hardware, but remember that current hardware are in-order CPUs which may not be impacted by many of these performance problems.

Another thing that is worth considering is that the `fflags` (exception flags) contained in `fcsr` is very likely to change after the Java call which does floating point calculations.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18758#discussion_r1565655591


More information about the hotspot-dev mailing list