RFR: 8282764: AArch64: compiler/vectorapi/reshape/TestVectorCastNeon.java failed with incorrect result [v2]

Nick Gasson ngasson at openjdk.java.net
Wed Mar 30 07:58:38 UTC 2022


On Tue, 29 Mar 2022 07:43:08 GMT, Ningsheng Jian <njian at openjdk.org> wrote:

>> Vector API long to float conversion operation on NEON converts vector of 2 longs to 2 floats. In current implementation, we convert 2 longs to 2 doubles first and then converts 2 doubles to 2 floats. However, this two-steps conversion may have two roundings, while the expected behavior, conversion from long to float directly, has only one rounding. This will result in inconsistent result. E.g. for the failure test case:
>> 
>> 
>> jshell> long l = 0x561a524000000001L;
>> l ==> 6204361871487664129
>> 
>> jshell> float l2f = (float)l;
>> l2f ==> 6.2043621E18
>> 
>> jshell> float l2d2f = (float)((double)l);
>> l2d2f ==> 6.2043616E18
>> 
>> 
>> Since we don't have NEON instruction to support vector long to float conversion, we fix the codegen by doing it in scalar operation one element by one element.
>> 
>> TEST: vector api jtreg tests passed.
>
> Ningsheng Jian has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add comment for special value usage.

cpu/aarch64 changes look OK to me and the Windows x64 failure is some unrelated environment setup problem.

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

Marked as reviewed by ngasson (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7850


More information about the hotspot-compiler-dev mailing list