-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8291118: [vectorapi] Optimize the implementation of lanewise FIRST_NONZERO #9683
Conversation
👋 Welcome back xgong! A progress list of the required criteria for merging this PR into |
@XiaohongGong To determine the appropriate audience for reviewing this pull request, one or more labels corresponding to different subsystems will normally be applied automatically. However, no automatic labelling rule matches the changes in this pull request. In order to have an "RFR" email sent to the correct mailing list, you will need to add one or more applicable labels manually using the /label pull request command. Applicable Labels
|
/label add core-libs |
@XiaohongGong |
Hi, could anyone please take a look at this change? Thanks a lot! |
Hi @PaulSandoz , could you please take a look at this simple change? Thanks a lot for your time! |
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 for the review @theRealELiu ! |
ping again. Could anyone please take a look at this simple patch? Thanks so much for your time! |
@XiaohongGong looking... (just back from vacation). |
Looks good. Much better to flip the operation and the receiver + first arg to the blend. |
Thanks for looking at this patch @PaulSandoz !
I'm not quite understand what the flip operation here mean. The current code is simple enough to me. Could you please show more details? Thanks a lot! |
I mean to say your approach is much better: changing |
Oh, ok, thanks for the review! |
Hi @PaulSandoz , may I get an approve from your side? Thanks so much! |
@XiaohongGong 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 301 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 |
Thanks for the review Paul! |
/integrate |
Going to push as commit 4da1745.
Your commit was automatically rebased without conflicts. |
@XiaohongGong Pushed as commit 4da1745. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Vector API binary op "
FIRST_NONZERO
" represents the vector operation of "a != 0 ? a : b
", which can be implemented with existing APIs like "compare + blend
". The current implementation is more complex especially for the floating point type vectors. The main idea is:And for the floating point types, it needs the vector reinterpretation between the floating point type and the relative integral type, since the final "
OR
" operation is only valid for bitwise integral types.A simpler implementation is:
This could save the final "
OR
" operation and the related reinterpretation between FP and integral types.Here are the performance data of the "
FIRST_NONZERO
" benchmarks (please see the benchmark details for byte vector from [1]) on ARM NEON system:We can also observe the similar improvement on x86 system.
[1] https://github.com/openjdk/panama-vector/blob/vectorIntrinsics/test/micro/org/openjdk/bench/jdk/incubator/vector/operation/ByteMaxVector.java#L266
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9683/head:pull/9683
$ git checkout pull/9683
Update a local copy of the PR:
$ git checkout pull/9683
$ git pull https://git.openjdk.org/jdk pull/9683/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9683
View PR using the GUI difftool:
$ git pr show -t 9683
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9683.diff