-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8264973: AArch64: Optimize vector max/min/add reduction of two integers with NEON pairwise instructions #3683
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
…rs with NEON pairwise instructions
👋 Welcome back dongbo! A progress list of the required criteria for merging this PR into |
/label add hotspot |
@dgbo |
@dgbo The |
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.
Yes, this looks good to me. Thanks!
INSN(smaxp, 0, 0b101001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S | ||
INSN(sminp, 0, 0b101011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S |
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.
Just one nit: do we need an assembler test case for them?
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.
Sure, added in the updated commit. Thanks.
Hi, @theRealAph. Could you please take a look at this PR? Thanks. |
PING? Any comments/suggestions are appreciated. |
Looking now. I can't quite understand how to run tests from panama-vector on JDK head. If the JMH test is relevant to JDK, not just panama-vector, why not add it to JDK? |
@theRealAph we are still working out how best to bring the vector performance tests over to the |
Hi, @theRealAph @PaulSandoz. Thanks for the comments. Because [1] has not been merged into mainline, we cannot build the tests directly with mainline JDK:
When I tested this, the incompatible
|
Mailing list message from Andrew Haley on hotspot-compiler-dev: On 5/10/21 6:55 AM, Dong Bo wrote:
I'm testing this now. |
PING? Any suggestions? Thanks. |
I'm back on this, and I can't see how to run the tests. Paul Sandoz says the perf tests in the You say "When I tested this, the incompatible DecodeBench.java was deleted first since it is all about ShortVector and ByteVector rather than Int64Vector." but I don't know what that means. Please provide step-by-step instructions that allow anyone to reproduce your results. |
Hi, here are the instructions I used to run the benchmarks:
|
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. Changes look good.
I managed to reproduce your results.
Benchmark (size) Mode Cnt Score Error Units
Int64Vector.ADDLanes 1024 thrpt 3 4958.747 ± 54.225 ops/ms
Int64Vector.ADDMaskedLanes 1024 thrpt 3 4769.759 ± 12.736 ops/ms
Int64Vector.MAXLanes 1024 thrpt 3 2957.985 ± 88.671 ops/ms
Int64Vector.MAXMaskedLanes 1024 thrpt 3 2921.381 ± 45.408 ops/ms
Int64Vector.MINLanes 1024 thrpt 3 2965.392 ± 25.236 ops/ms
Int64Vector.MINMaskedLanes 1024 thrpt 3 2923.870 ± 53.270 ops/ms
Benchmark (size) Mode Cnt Score Error Units
Int64Vector.ADDLanes 1024 thrpt 3 3560.100 ± 79.753 ops/ms
Int64Vector.ADDMaskedLanes 1024 thrpt 3 3585.672 ± 57.203 ops/ms
Int64Vector.MAXLanes 1024 thrpt 3 2951.659 ± 9.577 ops/ms
Int64Vector.MAXMaskedLanes 1024 thrpt 3 2876.957 ± 37.005 ops/ms
Int64Vector.MINLanes 1024 thrpt 3 2953.476 ± 3.446 ops/ms
Int64Vector.MINMaskedLanes 1024 thrpt 3 2878.942 ± 50.281 ops/ms
@dgbo 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 558 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@nsjian, @theRealAph) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
@RealFYang @dgbo Since your change was applied there have been 558 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 123cdd1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
On aarch64, current implementations of vector reduce_add2I, reduce_max2I, reduce_min2I can be optimized with NEON pairwise instructions:
I don't expect this to change anything of SuperWord, vectorizing reductions of two integers is disabled by [1].
This is useful for VectorAPI, tested benchmarks in [2], performance can improve ~51% and ~8% for
Int64Vector.ADD
andInt64Vector.MAX
respectively.Verified correctness with tests
test/jdk/jdk/incubator/vector/
. Also tested linux-aarch64-server-fastdebug tier1-3.[1]
jdk/src/hotspot/share/opto/superword.cpp
Line 2004 in 3bf4c90
[2] https://github.com/openjdk/panama-vector/blob/vectorIntrinsics/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int64Vector.java
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3683/head:pull/3683
$ git checkout pull/3683
Update a local copy of the PR:
$ git checkout pull/3683
$ git pull https://git.openjdk.java.net/jdk pull/3683/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3683
View PR using the GUI difftool:
$ git pr show -t 3683
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3683.diff