RFR: 8365206: RISC-V: compiler/c2/irTests/TestFloat16ScalarOperations.java is failing on riscv64 [v4]
Dingli Zhang
dzhang at openjdk.org
Thu Aug 21 07:27:53 UTC 2025
On Wed, 20 Aug 2025 12:35:47 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> Hi,
>> Can you help to review this patch?
>>
>> Currently implementation of conversion from float to float16 only preserve some significant bits of a NaN, which is not right in some cases.
>> As this (NaN conversion from float to float16) is already in the slow path, so I'll just fix it by preserving all significant bits in the same way as j.l.Float.floatToFloat16.
>> As current tests does not catch the issue, except of TestFloat16ScalarOperations.java, so add another test.
>>
>> There is also the similar issue in vector version of conversion from float to float16, I'll address it in another pr [JDK-8365772](https://bugs.openjdk.org/browse/JDK-8365772)
>>
>> Thanks!
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>
> comments
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 5972:
> 5970: // Check j.l.Float.floatToFloat16 for more information.
> 5971: // 10 bits
> 5972: slli(tmp1, dst, 9+32);
Suggestion for adding some whitespace:
Suggestion:
slli(tmp1, dst, 9 + 32);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26838#discussion_r2290133418
More information about the hotspot-dev
mailing list