jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8293488: Add EOR3 backend rule for aarch64 SHA3 extension

Open Bhavana-Kilambi opened this issue 2 years ago • 6 comments

Arm ISA v8.2A and v9.0A include SHA3 feature extensions and one of those SHA3 instructions - "eor3" performs an exclusive OR of three vectors. This is helpful in applications that have multiple, consecutive "eor" operations which can be reduced by clubbing them into fewer operations using the "eor3" instruction. For example -

eor a, a, b
eor a, a, c

can be optimized to single instruction - eor3 a, b, c

This patch adds backend rules for Neon and SVE2 "eor3" instructions and a micro benchmark to assess the performance gains with this patch. Following are the results of the included micro benchmark on a 128-bit aarch64 machine that supports Neon, SVE2 and SHA3 features -

Benchmark               gain
TestEor3.test1Int       10.87%
TestEor3.test1Long      8.84%
TestEor3.test2Int       21.68%
TestEor3.test2Long      21.04%

The numbers shown are performance gains with using Neon eor3 instruction over the master branch that uses multiple "eor" instructions instead. Similar gains can be observed with the SVE2 "eor3" version as well since the "eor3" instruction is unpredicated and the machine under test uses a maximum vector width of 128 bits which makes the SVE2 code generation very similar to the one with Neon.


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8293488: Add EOR3 backend rule for aarch64 SHA3 extension

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10407/head:pull/10407
$ git checkout pull/10407

Update a local copy of the PR:
$ git checkout pull/10407
$ git pull https://git.openjdk.org/jdk pull/10407/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10407

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10407.diff

Bhavana-Kilambi avatar Sep 23 '22 11:09 Bhavana-Kilambi

:wave: Welcome back bkilambi! 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.

bridgekeeper[bot] avatar Sep 23 '22 11:09 bridgekeeper[bot]

@Bhavana-Kilambi The following label will be automatically applied to this pull request:

  • hotspot

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[bot] avatar Sep 23 '22 11:09 openjdk[bot]

Could anyone please take a look at this PR and give their feedback ? Thank you ..

Bhavana-Kilambi avatar Sep 28 '22 11:09 Bhavana-Kilambi

/label add hotspot-compiler

Bhavana-Kilambi avatar Oct 05 '22 10:10 Bhavana-Kilambi

@Bhavana-Kilambi The hotspot-compiler label was successfully added.

openjdk[bot] avatar Oct 05 '22 10:10 openjdk[bot]

The new patch removes the svesha3 feature check for eor3 instruction. Eor3 instruction is part of the SHA3 feature but it is present by default in SVE2 and is not part of the SVESHA3 feature. Please review. Thank you ..

Bhavana-Kilambi avatar Nov 14 '22 09:11 Bhavana-Kilambi

@turbanoff Hello, I have made the changes you've suggested plus some more changes regarding the feature detection for svesha3 in the latest patch. Could you please take a look? Thank you in advance ..

Bhavana-Kilambi avatar Nov 18 '22 10:11 Bhavana-Kilambi

Hello, I have resolved merge conflicts and have uploaded the latest patch here. Please review. I messed up with the re-request review option but I now understand how it works (I thought I could re-request from everyone but realized that the previous selection is removed if i select another reviewer). Apologies if any inconvenience caused.

Bhavana-Kilambi avatar Nov 25 '22 10:11 Bhavana-Kilambi

@Bhavana-Kilambi 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:

8293488: Add EOR3 backend rule for aarch64 SHA3 extension

Reviewed-by: haosun, njian, eliu, aturbanov, ngasson

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

  • 69ede5baeda6645aa3e961a02cbd40db965fc6a1: 8293177: Verify version numbers in legal files
  • cd6bebbf34215723fad1d6bfe070a409351920c1: 8247645: ChaCha20 intrinsics
  • 33587ffd35c568c1ef034f064e6f3f06fe9943c3: 8292625: jshell crash on "var a = a"
  • 2deb318c9f047ec5a4b160d66a4b52f93688ec42: 8297065: DerOutputStream operations should not throw IOExceptions
  • d83a07b72cfd4dc42c5d4815262fcba05c653bd5: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive
  • 5d2772a43ef6409bf556cefb4eb4242594451674: 8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
  • 361b50e724f8c1177f89eaa93e38b69d244dadee: 8292594: Use CSS custom properties for all fonts and colors
  • 42b60ed22c02663eb1377d1ce78a559fdbb4348d: 8297030: Reduce Default Keep-Alive Timeout Value for httpclient
  • 1301fb0b5f998c9cf8bcd8a53e6a90d6ab5a7da9: 8296470: Refactor VMError::report STEP macro to improve readability
  • 48017b1d9c3a7867984f54d61f17c7f034d213f5: 8296804: Document HttpClient configuration properties in java.net.http module-info
  • ... and 45 more: https://git.openjdk.org/jdk/compare/3c4d5204ff96280b123f42a8cfbaef308e470b69...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, @theRealELiu, @turbanoff, @nick-arm) 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[bot] avatar Nov 29 '22 14:11 openjdk[bot]

Thank you for all the reviews. /integrate

Bhavana-Kilambi avatar Nov 29 '22 17:11 Bhavana-Kilambi

@Bhavana-Kilambi Your change (at version 6265863a9352de7c70d4d759d2ad46a7755d6d27) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Nov 29 '22 17:11 openjdk[bot]

/sponsor

nick-arm avatar Nov 29 '22 17:11 nick-arm

Going to push as commit 54e6d6aaeb5dec2dc1b9fb3ac9b34c8621df506d. Since your change was applied there have been 55 commits pushed to the master branch:

  • 69ede5baeda6645aa3e961a02cbd40db965fc6a1: 8293177: Verify version numbers in legal files
  • cd6bebbf34215723fad1d6bfe070a409351920c1: 8247645: ChaCha20 intrinsics
  • 33587ffd35c568c1ef034f064e6f3f06fe9943c3: 8292625: jshell crash on "var a = a"
  • 2deb318c9f047ec5a4b160d66a4b52f93688ec42: 8297065: DerOutputStream operations should not throw IOExceptions
  • d83a07b72cfd4dc42c5d4815262fcba05c653bd5: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive
  • 5d2772a43ef6409bf556cefb4eb4242594451674: 8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
  • 361b50e724f8c1177f89eaa93e38b69d244dadee: 8292594: Use CSS custom properties for all fonts and colors
  • 42b60ed22c02663eb1377d1ce78a559fdbb4348d: 8297030: Reduce Default Keep-Alive Timeout Value for httpclient
  • 1301fb0b5f998c9cf8bcd8a53e6a90d6ab5a7da9: 8296470: Refactor VMError::report STEP macro to improve readability
  • 48017b1d9c3a7867984f54d61f17c7f034d213f5: 8296804: Document HttpClient configuration properties in java.net.http module-info
  • ... and 45 more: https://git.openjdk.org/jdk/compare/3c4d5204ff96280b123f42a8cfbaef308e470b69...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Nov 29 '22 17:11 openjdk[bot]

@nick-arm @Bhavana-Kilambi Pushed as commit 54e6d6aaeb5dec2dc1b9fb3ac9b34c8621df506d.

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

openjdk[bot] avatar Nov 29 '22 17:11 openjdk[bot]