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

8308277: RISC-V: Improve vectorization of Match.sqrt() on floats #58

Closed

Conversation

feilongjiang
Copy link
Member

@feilongjiang feilongjiang commented May 22, 2023

Hi,
Please review this clean backport of JDK-8308277.

For jdk17u, Math.sqrt(float) will not get vectorized even when UseRVV is true without the SqrtF node.

Here is the OptoAssembly of Sqrt.java from JDK-8190800:

before:

120     B14: #  out( B14 B15 ) <- in( B13 B14 ) Loop( B14-B14 inner main of N91 strip mined) Freq: 1.86254e+07
120 +   addw  R28, R12, zr  #@convI2L_reg_reg
124 +   slli  R28, R28, (#2 & 0x3f) #@lShiftL_reg_imm
128 +   add R28, R18, R28   # ptr, #@addP_reg_reg
12c +   flw  F0, [R28, #16] # float, #@loadF
130 +   fsqrt.s  F1, F0 #@sqrtF_reg
134 +   fsw  F1, [R28, #16] # float, #@storeF

after:

140     B14: #  out( B14 B15 ) <- in( B13 B14 ) Loop( B14-B14 inner main of N93 strip mined) Freq: 1.60517e+07
140     addw  R10, R31, zr  #@convI2L_reg_reg
144     slli  R10, R10, (#2 & 0x3f) #@lShiftL_reg_imm
148     add R11, R9, R10    # ptr, #@addP_reg_reg
14c     addi  R10, R11, #16 # ptr, #@addP_reg_imm
150     vle V1, [R10]   #@loadV
158     vfsqrt.v V1, V1 #@vsqrtF
160     addi  R10, R11, #16 # ptr, #@addP_reg_imm
164     vse V1, [R10]   #@storeV

Progress

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

Issue

  • JDK-8308277: RISC-V: Improve vectorization of Match.sqrt() on floats

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/riscv-port-jdk17u.git pull/58/head:pull/58
$ git checkout pull/58

Update a local copy of the PR:
$ git checkout pull/58
$ git pull https://git.openjdk.org/riscv-port-jdk17u.git pull/58/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 58

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/riscv-port-jdk17u/pull/58.diff

Webrev

Link to Webrev Comment

Sorry, something went wrong.

@feilongjiang feilongjiang marked this pull request as draft May 22, 2023 10:40
@bridgekeeper
Copy link

bridgekeeper bot commented May 22, 2023

👋 Welcome back fjiang! A progress list of the required criteria for merging this PR into riscv-port 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 changed the title Backport e520cdc882a778260181a2162a01ceff7cc41ca0 8308277: RISC-V: Improve vectorization of Match.sqrt() on floats May 22, 2023
@openjdk
Copy link

openjdk bot commented May 22, 2023

This backport pull request has now been updated with issue from the original commit.

@feilongjiang feilongjiang marked this pull request as ready for review May 22, 2023 11:19
@openjdk
Copy link

openjdk bot commented May 22, 2023

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

8308277: RISC-V: Improve vectorization of Match.sqrt() on floats

Reviewed-by: fyang

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 35 new commits pushed to the riscv-port branch:

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 (@RealFYang) 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 ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 22, 2023
@mlbridge
Copy link

mlbridge bot commented May 22, 2023

Webrevs

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

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

I think it's OK to backport this so that we are on-par with other CPUs like aarch64.

@feilongjiang
Copy link
Member Author

tier1 looks good.
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 25, 2023
@openjdk
Copy link

openjdk bot commented May 25, 2023

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented May 25, 2023

Going to push as commit 42f752d.
Since your change was applied there have been 35 commits pushed to the riscv-port branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 25, 2023
@openjdk openjdk bot closed this May 25, 2023
@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 May 25, 2023
@openjdk
Copy link

openjdk bot commented May 25, 2023

@RealFYang @feilongjiang Pushed as commit 42f752d.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport clean integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

2 participants