RFR: 8320500: [vectorapi] RISC-V: Optimize vector math operations with SLEEF [v6]

Hamlin Li mli at openjdk.org
Thu Sep 26 07:57:37 UTC 2024


On Thu, 26 Sep 2024 02:15:34 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> 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

Sounds like a reasonable solution!
Anyone has other thoughts please kindly let me know.

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

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


More information about the build-dev mailing list