Integrated: 8282764: AArch64: compiler/vectorapi/reshape/TestVectorCastNeon.java failed with incorrect result

Ningsheng Jian njian at openjdk.java.net
Wed Mar 30 09:50:47 UTC 2022


On Thu, 17 Mar 2022 04:33:59 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.

This pull request has now been integrated.

Changeset: 51c05e82
Author:    Ningsheng Jian <njian at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/51c05e8219db5f47d7f56eeb9cdaaee0785b5e7e
Stats:     51 lines in 12 files changed: 26 ins; 0 del; 25 mod

8282764: AArch64: compiler/vectorapi/reshape/TestVectorCastNeon.java failed with incorrect result

Reviewed-by: psandoz, ngasson, eliu

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

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


More information about the hotspot-compiler-dev mailing list