Skip to content
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

8276985: AArch64: [vectorapi] Backend support of VectorMaskToLongNode #6585

Closed
wants to merge 3 commits into from

Conversation

theRealELiu
Copy link
Contributor

@theRealELiu theRealELiu commented Nov 29, 2021

The lack of codegen for VectorMaskToLong results in a regression on
AArch64 for VectorMask.laneIsSet, which relies on the intrinsification
of VectorMask.toLong after JDK-8273949.

This patch implements bitmask extraction on AArch64 for NEON and SVE by
using scalar instructions, which is equivalent to the PMOVMSK
instructions on X86. The performance of VectorMask.laneIsSet improves
about 10x for NEON and 2x~4x for SVE on my test machines.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8276985: AArch64: [vectorapi] Backend support of VectorMaskToLongNode

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6585/head:pull/6585
$ git checkout pull/6585

Update a local copy of the PR:
$ git checkout pull/6585
$ git pull https://git.openjdk.java.net/jdk pull/6585/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6585

View PR using the GUI difftool:
$ git pr show -t 6585

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6585.diff

The lack of codegen for VectorMaskToLong results in a regression on
AArch64 for VectorMask.laneIsSet, which relies on the intrinsification
of VectorMask.toLong after JDK-8273949.

This patch implements bitmask extraction on AArch64 for NEON and SVE by
using scalar instructions, which is equivalent to the PMOVMSK
instructions on X86. The performance of VectorMask.laneIsSet improves
about 10x for NEON and 2x~4x for SVE on my test machines.

Change-Id: I1be2e107c19344a095afcb9e807f468b47ae2dfe
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 29, 2021

👋 Welcome back eliu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Nov 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

@theRealELiu The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk openjdk bot added the hotspot-compiler label Nov 29, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 29, 2021

Webrevs

@theRealELiu
Copy link
Contributor Author

@theRealELiu theRealELiu commented Dec 7, 2021

Could anyone help to review this patch?

ins_pipe(pipe_slow);
%}

instruct vmask_tolong16B(iRegLNoSp dst, vecX src, iRegL tmp) %{
Copy link

@nsjian nsjian Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"iRegL tmp" should be "iRegLNoSp tmp" or use rscratch directly?

Copy link
Contributor

@theRealAph theRealAph Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. This kind of bug is horrible to detect.

Copy link
Contributor Author

@theRealELiu theRealELiu Dec 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It's fixed now.

@@ -3174,4 +3174,21 @@ instruct vmask_lasttrue_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr
__ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg));
%}
ins_pipe(pipe_slow);
%}

instruct vmask_tolong(iRegLNoSp dst, pReg src, vReg vtmp1, vReg vtmp2, pRegGov pgtmp, iRegL tmp, rFlagsReg cr) %{
Copy link

@nsjian nsjian Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this iRegL

Change-Id: I305cdea672a39dd222e8c97fc46ae691b563e5ec
@openjdk
Copy link

@openjdk openjdk bot commented Dec 8, 2021

@theRealELiu this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout tolong
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict label Dec 8, 2021
Change-Id: Ib55f564ad3fe363c7c52fdd9f12d58b58b3f8f11
nsjian
nsjian approved these changes Dec 8, 2021
@openjdk openjdk bot removed the merge-conflict label Dec 8, 2021
@theRealELiu
Copy link
Contributor Author

@theRealELiu theRealELiu commented Dec 9, 2021

@theRealAph May I ask if this patch could catch up the RDP1?

@openjdk
Copy link

@openjdk openjdk bot commented Dec 9, 2021

@theRealELiu 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:

8276985: AArch64: [vectorapi] Backend support of VectorMaskToLongNode

Reviewed-by: njian, aph

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 34 new commits pushed to the master branch:

  • 965ea8d: 8274298: JFR Thread Sampler thread must not acquire malloc lock after suspending a thread because of possible deadlock
  • 84baea7: 8278433: Use snippets in jdk.incubator.foreign documentation
  • 1ea766d: 8278419: JFR jcmd option contract "This value cannot be changed once JFR has been initialized" is not enforced
  • 62a7f5d: 8254318: Remove .hgtags
  • d170682: 8278466: "spurious markup" warnings in snippets when building docs-reference
  • 8ef1a23: 8278311: Debian packaging doesn't work
  • 3524355: 8277882: New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"
  • 83e6a4c: 8255409: Support the new C_GetInterfaceList, C_GetInterface, and C_SessionCancel APIs in PKCS#11 v3.0
  • 3cec700: 8278463: [test] Serialization WritePrimitive test revised for readFully test fails
  • 03bf55f: 8277980: ObjectMethods::bootstrap throws NPE when lookup is null
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/5dcdee4bcd337591c79aad8620a7f38345e6e3d9...master

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 in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Dec 9, 2021
@theRealELiu
Copy link
Contributor Author

@theRealELiu theRealELiu commented Dec 9, 2021

/integrate

@openjdk openjdk bot added the sponsor label Dec 9, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 9, 2021

@theRealELiu
Your change (at version 81f6fd4) is now ready to be sponsored by a Committer.

@nsjian
Copy link

@nsjian nsjian commented Dec 9, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Dec 9, 2021

Going to push as commit 6dae52f.
Since your change was applied there have been 35 commits pushed to the master branch:

  • 08aad85: 8211230: JFR: internal events
  • 965ea8d: 8274298: JFR Thread Sampler thread must not acquire malloc lock after suspending a thread because of possible deadlock
  • 84baea7: 8278433: Use snippets in jdk.incubator.foreign documentation
  • 1ea766d: 8278419: JFR jcmd option contract "This value cannot be changed once JFR has been initialized" is not enforced
  • 62a7f5d: 8254318: Remove .hgtags
  • d170682: 8278466: "spurious markup" warnings in snippets when building docs-reference
  • 8ef1a23: 8278311: Debian packaging doesn't work
  • 3524355: 8277882: New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"
  • 83e6a4c: 8255409: Support the new C_GetInterfaceList, C_GetInterface, and C_SessionCancel APIs in PKCS#11 v3.0
  • 3cec700: 8278463: [test] Serialization WritePrimitive test revised for readFully test fails
  • ... and 25 more: https://git.openjdk.java.net/jdk/compare/5dcdee4bcd337591c79aad8620a7f38345e6e3d9...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 9, 2021
@openjdk openjdk bot added integrated and removed ready rfr sponsor labels Dec 9, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 9, 2021

@nsjian @theRealELiu Pushed as commit 6dae52f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@theRealELiu
Copy link
Contributor Author

@theRealELiu theRealELiu commented Dec 9, 2021

Thanks for your review. @theRealAph @nsjian

@theRealELiu theRealELiu deleted the tolong branch Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler integrated
3 participants