-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8282764: AArch64: compiler/vectorapi/reshape/TestVectorCastNeon.java failed with incorrect result #7850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…failed with incorrect result 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.
|
👋 Welcome back njian! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
Looks good to me (not a reviewer). |
Thank you @theRealELiu ! |
| 0, | ||
| Long.MAX_VALUE, | ||
| Long.MIN_VALUE, | ||
| 0x561a524000000001L, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment would be useful as to why this constant is important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the copyright year. Java changes look good. Just one comment related to an additional value added for testing.
Thank you for the review @PaulSandoz ! Code comment added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java changes are good.
|
@nsjian This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 168 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpu/aarch64 changes look OK to me and the Windows x64 failure is some unrelated environment setup problem.
|
Thanks for the review! @nick-arm /reviewer credit @theRealELiu |
|
@nsjian |
|
/integrate |
|
Going to push as commit 51c05e8.
Your commit was automatically rebased without conflicts. |
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:
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.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7850/head:pull/7850$ git checkout pull/7850Update a local copy of the PR:
$ git checkout pull/7850$ git pull https://git.openjdk.java.net/jdk pull/7850/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7850View PR using the GUI difftool:
$ git pr show -t 7850Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7850.diff