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

8292587: AArch64: Support SVE fabd instruction #10011

Closed
wants to merge 2 commits into from

Conversation

shqking
Copy link
Contributor

@shqking shqking commented Aug 25, 2022

Scalar and NEON fabd instructions were initially supported in
JDK-8256318. In this patch, we support SVE fabd instruction [1] and add
one Jtreg test case as well.

With this patch, two instructions fsub + fabs would be combined into
one single fabd instruction.

  fsub    z16.s, z16.s, z17.s
  fabs    z16.s, p7/m, z16.s

  -->

  fabd    z16.s, p7/m, z16.s, z17.s

In the initial evaluation of JMH case, i.e.
FloatingScalarVectorAbsDiff.java, we found the performance uplift done
by this optimization was easily hidden by the heavy memory load/store
instructions. To avoid that, we updated the JMH case a bit, adding one
more group of subtraction and Math.abs operations in the loop body.

Here shows the data with the new JMH case on one 256-bit SVE machine. We
can observe about 39% and 35% improvements for the two functions
respectively.

Benchmark                                             Before    After  Units
FloatingScalarVectorAbsDiff.testVectorAbsDiffDouble  260.468  160.965  ns/op
FloatingScalarVectorAbsDiff.testVectorAbsDiffFloat   133.963   87.292  ns/op

Jtreg testing: tier1~3 passed on one NEON-only machine and one 256-bit SVE machine.

[1] https://developer.arm.com/documentation/ddi0596/2021-12/SVE-Instructions/FABD--Floating-point-absolute-difference--predicated--


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10011

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

Using diff file

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

Scalar and NEON fabd instructions were initially supported in
JDK-8256318. In this patch, we support SVE fabd instruction [1] and add
one Jtreg test case as well.

With this patch, two instructions `fsub + fabs` would be combined into
one single `fabd` instruction.

```
  fsub    z16.s, z16.s, z17.s
  fabs    z16.s, p7/m, z16.s

  -->

  fabd    z16.s, p7/m, z16.s, z17.s
```

In the initial evaluation of JMH case, i.e.
FloatingScalarVectorAbsDiff.java, we found the performance uplift done
by this optimization was easily hidden by the heavy memory load/store
instructions. To avoid that, we updated the JMH case a bit, adding one
more group of subtraction and Math.abs operations in the loop body.

Here shows the data with the new JMH case on one 256-bit SVE machine. We
can observe about 39% and 35% improvements for the two functions
respectively.

```
Benchmark                                             Before    After  Units
FloatingScalarVectorAbsDiff.testVectorAbsDiffDouble  260.468  160.965  ns/op
FloatingScalarVectorAbsDiff.testVectorAbsDiffFloat   133.963   87.292  ns/op
```

[1] https://developer.arm.com/documentation/ddi0596/2021-12/SVE-Instructions/FABD--Floating-point-absolute-difference--predicated--
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 25, 2022

👋 Welcome back haosun! 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 Pull request is ready for review label Aug 25, 2022
@openjdk
Copy link

openjdk bot commented Aug 25, 2022

@shqking 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 hotspot-compiler-dev@openjdk.org label Aug 25, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 25, 2022

Webrevs

@shqking
Copy link
Contributor Author

shqking commented Sep 5, 2022

Ping? Can anyone help to review this patch? Thanks.

Copy link

@nsjian nsjian left a comment

Choose a reason for hiding this comment

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

Looks good.

@shqking
Copy link
Contributor Author

shqking commented Sep 6, 2022

Hi @nick-arm, could you help to review this patch when you have spare time? Thanks in advance.

As pointed out by Faye Gao, the test results are not fully verified due
to incorrect loop limits.

Updated it.

Reran the test and no regression.
@TobiHartmann
Copy link
Member

I tested this in our CI. All tests passed.

@openjdk
Copy link

openjdk bot commented Sep 9, 2022

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

8292587: AArch64: Support SVE fabd instruction

Reviewed-by: njian, fgao, 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 210 new commits pushed to the master branch:

  • 526eb54: 8293669: SA: Remove unnecssary "InstanceStackChunkKlass: InstanceStackChunkKlass" output when scanning heap
  • 41ce658: 8292225: Rename ArchiveBuilder APIs related to source and buffered addresses
  • 155b10a: 8293329: x86: Improve handling of constants in AES/GHASH stubs
  • d3f7e3b: 8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted
  • 524af94: 8283627: Outdated comment in MachineDescriptionTwosComplement.isLP64
  • cea409c: 8292738: JInternalFrame backgroundShadowBorder & foregroundShadowBorder line is longer in Mac Look and Feel
  • 9ef6c09: 8287908: Use non-cloning reflection methods where acceptable
  • 0c61bf1: 8293282: LoadLibraryUnloadTest.java fails with "Too few cleared WeakReferences"
  • 91c9091: 8293343: sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.java failed with "Agent communication error: java.io.EOFException"
  • 4c77bd3: 6529151: NullPointerException in swing.plaf.synth.SynthLookAndFeel$Handler
  • ... and 200 more: https://git.openjdk.org/jdk/compare/76ee5495cd00f5546a5748051cc36965a8e936db...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, @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 openjdk bot added the ready Pull request is ready to be integrated label Sep 9, 2022
@shqking
Copy link
Contributor Author

shqking commented Sep 13, 2022

Thanks for your code reviews, @nick-arm @nsjian and @fg1417 .
Thanks for your testing, @TobiHartmann !

I don't think the GHA test failure is related to this patch.
Hence, I suppose we can integrate this PR now.

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 13, 2022
@openjdk
Copy link

openjdk bot commented Sep 13, 2022

@shqking
Your change (at version 3850119) is now ready to be sponsored by a Committer.

@nsjian
Copy link

nsjian commented Sep 13, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 13, 2022

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

  • 68645eb: 8293566: RISC-V: Clean up push and pop registers
  • 526eb54: 8293669: SA: Remove unnecssary "InstanceStackChunkKlass: InstanceStackChunkKlass" output when scanning heap
  • 41ce658: 8292225: Rename ArchiveBuilder APIs related to source and buffered addresses
  • 155b10a: 8293329: x86: Improve handling of constants in AES/GHASH stubs
  • d3f7e3b: 8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted
  • 524af94: 8283627: Outdated comment in MachineDescriptionTwosComplement.isLP64
  • cea409c: 8292738: JInternalFrame backgroundShadowBorder & foregroundShadowBorder line is longer in Mac Look and Feel
  • 9ef6c09: 8287908: Use non-cloning reflection methods where acceptable
  • 0c61bf1: 8293282: LoadLibraryUnloadTest.java fails with "Too few cleared WeakReferences"
  • 91c9091: 8293343: sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.java failed with "Agent communication error: java.io.EOFException"
  • ... and 201 more: https://git.openjdk.org/jdk/compare/76ee5495cd00f5546a5748051cc36965a8e936db...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 13, 2022
@openjdk openjdk bot closed this Sep 13, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Sep 13, 2022
@openjdk
Copy link

openjdk bot commented Sep 13, 2022

@nsjian @shqking Pushed as commit cbee0bc.

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

@shqking shqking deleted the 8292587-fabd branch September 13, 2022 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants