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
8259948: Aarch64: Add cast nodes for Aarch64 Neon backend #4839
Conversation
👋 Welcome back whuang! A progress list of the required criteria for merging this PR into |
/contributor add Wang Huang whuang@openjdk.org |
@Wanghuang-Huawei |
@Wanghuang-Huawei |
@Wanghuang-Huawei |
@Wanghuang-Huawei The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Thanks for the work! Some general comments:
I would suggest not to have a partial fix of JDK-8269866. I think you can still keep 8259948 as duplicate while targeting this to JDK-8269866 and have a fully proper fix. @theRealELiu may have some thoughts on how to have a clean fix: e.g. there may be some dependency on mid-end part, like JDK-8265244? @theRealELiu has marked those missing rules opcode (with specific types/sizes) as unsupported in JDK-8268966, but I don't see you have unmarked them in your patch. So your newly added rules are not able to be tested. And there are some test cases included in JDK-8268966, could you please merge your test case into existing tests, if existing tests cannot cover some cases. P.S. could you please fix the jcheck error? |
Thank you for your suggestion. We fix these errors and upload new patch. |
Webrevs
|
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.
The big question for all of this is: what is the test coverage?
We tested the following two test cases: |
Thank you, but that doesn't really answer my question. Does your testing cover all that is added in this patch? If so, how did you ascertain it? |
ins_encode %{ | ||
// If registers are the same, no register move is required - the | ||
// upper bits of "src" are expected to have been initialized | ||
// to zero. |
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.
I have a little concern about this assumption. How to ensure the upper bits are zero? Since the ReinterpretNode
could be used separately and not always with CastNode
together. E.g
https://github.com/openjdk/jdk/blob/jdk-18%2B9/src/hotspot/share/opto/vectorIntrinsics.cpp#L844
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.
There are several places in the AArch64 back end where we expect the upper bits of a register to be zero, but we've never depended on it. This is not a good time to start, so let's clear the bits in order to be certain.
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.
This is the same as reinterpretD2X. The upper 96 bits of "src" are zero, I guess it is because when the 128-bit register is initialized, the upper 96 bits will be zeroed, and only its lower 32-bit data will be manipulated later.
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.
I think it's better to clear the higher bits for such cases.
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.
OK, I'll clear the higher bits in the next commit.
Yes, These two test cases have covered the code in the patch. First, I unmark the unsupported opcodes in JDK-8268966. Then I test the cases in both of the above test files one by one, implementing the rules once the testcase failed until all the testcases pass. |
@@ -712,6 +712,7 @@ | |||
__ stxp(r4, zr, zr, r5); // stxp w4, xzr, xzr, [x5] | |||
__ stxpw(r6, zr, zr, sp); // stxp w6, wzr, wzr, [sp] | |||
__ dup(v0, __ T16B, zr); // dup v0.16b, wzr | |||
__ dups(v0, __ T2S, v1); // mov s0, v1.s[0] |
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.
Please use the DUP
AArch64 instruction here, rather than MOV
.
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.
OK.
OK. |
ins_encode %{ | ||
// If registers are the same, no register move is required - the | ||
// upper bits of "src" are expected to have been initialized | ||
// to zero. |
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.
I think it's better to clear the higher bits for such cases.
I triggered the test, hotspot_all(no vmTestBase stress), langtools:tier1, jdk:tier1, tier2, tier3 are passed on aarch64. |
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.
Looks good to me. Just some style nits.
ins_pipe(pipe_slow); | ||
%} | ||
instruct vcvt4Fto4B(vecD dst, vecX src) | ||
%{ |
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.
And here
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.
LGTM
Thanks @nsjian @theRealELiu for reviewing this. |
Hi, @theRealAph do I need another reviewer to review this? |
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 everyone, for all your hard work.
/integrate |
@Wanghuang-Huawei |
/sponsor |
Going to push as commit 9f75d5c.
Your commit was automatically rebased without conflicts. |
@nsjian @Wanghuang-Huawei Pushed as commit 9f75d5c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Progress
Issue
Reviewers
Contributors
<whuang@openjdk.org>
<wuyan@openjdk.org>
<mouzhuojun@huawei.com>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4839/head:pull/4839
$ git checkout pull/4839
Update a local copy of the PR:
$ git checkout pull/4839
$ git pull https://git.openjdk.java.net/jdk pull/4839/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4839
View PR using the GUI difftool:
$ git pr show -t 4839
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4839.diff