On Wed, 25 Sep 2024 20:10:41 GMT, Hamlin Li <m...@openjdk.org> wrote:

>> Good question!
>> Let me do some further investigation and get back later.
>
> I see sleef code only set frm to RNE, but I'm not quite sure.
> Even if we can make sure current sleef only set frm to RNE, seems to me we 
> can not depends on current implement, it could change. Although good news is 
> we don't update sleef regularly.
> Maybe we should take similar action as call-to-java and return-from-jni?

Just a bit worried about the fact that manipunating CSR could be very costly on 
RISC-V. Another choice would be adding an assertion about FP rounding mode 
expecting RNE when returning back from the SLEEF routine. I also checked 
floating-point intrinsics with `_rm` suffix in the function name in SLEEF src 
code and only witnessed use of `__RISCV_FRM_RNE`. I didn't see uses of other 
rounding modes as specified by the rvv-intrinsic-spec [1].

[1] 
https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/main/doc/rvv-intrinsic-spec.adoc

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21083#discussion_r1776213231

Reply via email to