Skip to content

Conversation

missa-prime
Copy link
Contributor

@missa-prime missa-prime commented Sep 17, 2025

The upcoming ECore platforms will benefit from using vblendvps and vblendvpd instructions when the destination register is the same as the source register. This change takes that situation into account.

The JTREG test shown below was used to verify correctness against the OpenJDK v26-b15 baseline build. This test frequently calls vblendvps() and vblendvpd() in the macro assembler. On Darkmont and non-Darkmont cores, the right code paths are followed when checking with asserts.

  1. jtreg:test/hotspot/jtreg/compiler/intrinsics/math/TestSignumIntrinsic.java

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-8367611: Enable vblendvp[sd] on Future ECore (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27354

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 17, 2025

👋 Welcome back missa! 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 Sep 17, 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 Sep 17, 2025

@missa-prime 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.

@missa-prime missa-prime marked this pull request as ready for review September 18, 2025 20:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 18, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 18, 2025

Webrevs

Copy link
Contributor

@mhaessig mhaessig left a comment

Choose a reason for hiding this comment

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

Thank you for this improvement, @missa-prime! The change looks good to me, but I have a question.

The JTREG test shown below was used to verify correctness against the OpenJDK v26-b15 baseline build.

  • jtreg:test/hotspot/jtreg/compiler/intrinsics/math/TestSignumIntrinsic.java

Can you elaborate, what this verification entails? Why this test?

@missa-prime
Copy link
Contributor Author

Thank you for this improvement, @missa-prime! The change looks good to me, but I have a question.

The JTREG test shown below was used to verify correctness against the OpenJDK v26-b15 baseline build.

  • jtreg:test/hotspot/jtreg/compiler/intrinsics/math/TestSignumIntrinsic.java

Can you elaborate, what this verification entails? Why this test?

@mhaessig I used this test because it frequently calls vblendvps() and vblendvpd() in the macro assembler. On Darkmont and non-Darkmont cores, I checked the right code paths were followed with asserts. Also, I wrote some sample code and checked the instructions generated at runtime.

@@ -2897,7 +2897,8 @@ void MacroAssembler::vbroadcastss(XMMRegister dst, AddressLiteral src, int vecto
// vblendvps(XMMRegister dst, XMMRegister nds, XMMRegister src, XMMRegister mask, int vector_len, bool compute_mask = true, XMMRegister scratch = xnoreg)
void MacroAssembler::vblendvps(XMMRegister dst, XMMRegister src1, XMMRegister src2, XMMRegister mask, int vector_len, bool compute_mask, XMMRegister scratch) {
// WARN: Allow dst == (src1|src2), mask == scratch
bool blend_emulation = EnableX86ECoreOpts && UseAVX > 1;
bool use_blend_instr = VM_Version::is_intel_darkmont() && (dst == src1);
Copy link
Contributor

Choose a reason for hiding this comment

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

My only real comment is a nit-pick about the variable name.. use_blend_instr implies a range of darkmont and above and 'EnableX86CoreOpts' and 'below'.. which is not the value of this variable (i.e. just darkmont and above). Perhaps blend_fixed? blend_partly_fixed? Or 'just' add it to the blend_emulation...

bool blend_emulation = EnableX86ECoreOpts && UseAVX > 1 
                    && VM_Version::is_intel_darkmont() && (dst == src1); // partly fixed on Darkmont

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it to blend_emulation as that seems to make the most sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants