Skip to content

Conversation

@Hamlin-Li
Copy link

@Hamlin-Li Hamlin-Li commented Nov 13, 2025

Hi,

This pr add CMoveF/D on riscv, which enable vectorization of statement like: op_1 bop op_2 ? res_f_d_1 : res_f_d_2 in a loop.

This pr is also a preparation for further vectorization in #28231.

Previously it's #25341, but at that time, C2 SLP has some issue with unsigned comparison, which is now fixed, so it's good to continue the work.

Test

Jtreg

in progress...

Performance

Column names meanings:

  • p: with patch
  • p+v: with patch, -XX:+UseVectorCmov -XX:+UseCMoveUnconditionally turned on
  • m: without patch
  • m+v: without patch, -XX:+UseVectorCmov -XX:+UseCMoveUnconditionally turned on

Average improvement

NOTE: With only this PR, it brings performance benefit in case of CMoveF+CmpF, CMoveD+ComD, CMoveF+CmpI, CMoveD+CmpL. The data below is based on fullly implmenting the vectorization of CMoveI/L/F/D+CmpI/L/F/D, which will be achieved by #28231.

For details, check the performance data in #25341 on riscv.

Opt (m/p) Opt (m+v/p+v) Opt (p/p+v) Opt (m/p+v)
1.022782609 2.198717391 2.162673913 2.199

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

  • JDK-8357551: RISC-V: support CMoveF/D vectorization (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28309

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 13, 2025

👋 Welcome back mli! 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
Copy link

openjdk bot commented Nov 13, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Nov 13, 2025

⚠️ @Hamlin-Li This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Nov 13, 2025
@openjdk
Copy link

openjdk bot commented Nov 13, 2025

@Hamlin-Li The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 13, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 13, 2025

Webrevs

@eme64
Copy link
Contributor

eme64 commented Nov 14, 2025

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Nov 14, 2025
@openjdk
Copy link

openjdk bot commented Nov 14, 2025

@eme64
The hotspot-compiler label was successfully added.

Copy link
Contributor

@eme64 eme64 left a comment

Choose a reason for hiding this comment

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

I won't be able to review the RISCV part, so you'll have to find someone else there. I just dropped 2 drive-by comments about the tests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants