RFR: 8312569: RISC-V: Missing intrinsics for Math.ceil, floor, rint [v2]
Vladimir Kempik
vkempik at openjdk.org
Mon Aug 28 09:18:15 UTC 2023
On Thu, 17 Aug 2023 07:07:17 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Ilya Gavrilin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Change fsgnj_d(dst, src, src) to fmv_d(dst, src)
>
> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 4258:
>
>> 4256:
>> 4257: // setting roundig mode to double->long (rm_direct) and long->double (rm_back) conversions
>> 4258: RoundingMode rm_direct, rm_back;
>
> Can we use the same rounding mode for conversions in both direction? Say `rup` for `ceil`, and `rdn` for `floor`.
> I see this policy is used for both glibc [1] and V8.
>
> [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/rv64/rvd/s_ceil.c;h=6c355cd72691c45c97201fe8947683287982ade9;hb=41d8c3bc33bcae1ebb8077b0442caef4917f763a
basically for this case the backward rounding mode doesn't matter at all. it would only matter if intermediate integer contained something not representable in double.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14991#discussion_r1307167492
More information about the hotspot-dev
mailing list