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

8284813: x86 Code cleanup related to move instructions. #8230

Closed
wants to merge 3 commits into from

Conversation

jatin-bhateja
Copy link
Member

@jatin-bhateja jatin-bhateja commented Apr 13, 2022

Summary of changes:

  • Correct feature checks in some assembler move instruction.
  • Explicitly pass opmask register in routines accepting merge argument.
  • Code re-organization related to move instruction, pull out the merge argument up to instruction pattern or top level caller.
  • Add missing encoding based move elision checks in some macro assembly routines.

Kindly review and share your feedback.

Regards,
Jatin


Progress

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

Issue

  • JDK-8284813: x86 Code cleanup related to move instructions.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8230/head:pull/8230
$ git checkout pull/8230

Update a local copy of the PR:
$ git checkout pull/8230
$ git pull https://git.openjdk.java.net/jdk pull/8230/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8230

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8230.diff

@jatin-bhateja
Copy link
Member Author

/label add hotspot-compiler-dev

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 13, 2022

👋 Welcome back jbhateja! 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 rfr Pull request is ready for review hotspot-compiler hotspot-compiler-dev@openjdk.org labels Apr 13, 2022
@openjdk
Copy link

openjdk bot commented Apr 13, 2022

@jatin-bhateja
The hotspot-compiler label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Apr 13, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good. Let me test it.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

I found that Tobias already ran tier1-4 testing and it passed.
I am running tier1 with latest JDK.

You need second review. Could be from Intel.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

My tests passed.

@openjdk
Copy link

openjdk bot commented May 3, 2022

@jatin-bhateja 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:

8284813: x86 Code cleanup related to move instructions.

Reviewed-by: kvn, sviswanathan

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

  • 00e6c63: 8277090: jsr166 refresh for jdk19
  • c5a0687: 8285976: compiler/exceptions/OptimizeImplicitExceptions.java can't pass with -XX:+DeoptimizeALot
  • df8c2be: 8279598: Provide adapter from RandomGenerator to Random
  • 497a94f: 8286138: ProblemList javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java on macosx-aarch64
  • 7b7207a: 8280003: C1: Reconsider uses of logical_and immediates in LIRGenerator::do_getObjectSize
  • 17cc713: 8274112: (fc) Tune FileChannel.transferTo()
  • 7424f47: 8286114: [test] show real exception in bomb call in sun/rmi/runtime/Log/checkLogging/CheckLogging.java
  • 29c2e54: 8286092: Remove dead windows stack code
  • 4e1e76a: 8278757: [s390] Implement AES Counter Mode Intrinsic
  • 4b2c822: 8282477: [x86, aarch64] vmassert(_last_Java_pc == NULL, "already walkable"); fails with async profiler
  • ... and 56 more: https://git.openjdk.java.net/jdk/compare/99388eff8da2cb3dc0bb34f05e8784795edb790e...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 3, 2022
@@ -214,8 +214,8 @@ void MacroAssembler::copy32_masked_avx(Register dst, Register src, XMMRegister x
mov64(temp, -1L);
bzhiq(temp, temp, length);
kmovql(mask, temp);
evmovdqu(type[shift], mask, xmm, Address(src, index, scale, offset), Assembler::AVX_256bit);
evmovdqu(type[shift], mask, Address(dst, index, scale, offset), xmm, Assembler::AVX_256bit);
evmovdqu(type[shift], mask, xmm, Address(src, index, scale, offset), true, Assembler::AVX_256bit);
Copy link

Choose a reason for hiding this comment

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

Should the merge parameter be set to false for load here?

Copy link
Member Author

Choose a reason for hiding this comment

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

DONE.

@@ -199,8 +199,8 @@ void MacroAssembler::copy64_masked_avx(Register dst, Register src, XMMRegister x
mov64(temp, -1L);
bzhiq(temp, temp, length);
kmovql(mask, temp);
evmovdqu(type[shift], mask, xmm, Address(src, index, scale, offset), Assembler::AVX_512bit);
evmovdqu(type[shift], mask, Address(dst, index, scale, offset), xmm, Assembler::AVX_512bit);
evmovdqu(type[shift], mask, xmm, Address(src, index, scale, offset), true, Assembler::AVX_512bit);
Copy link

Choose a reason for hiding this comment

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

Should the merge parameter be set to false for load here?

attributes.set_is_evex_instruction();
if (merge) {
attributes.reset_is_clear_context();
}
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3;
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes);
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes);
Copy link

Choose a reason for hiding this comment

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

The existing version (with no mask) was using VEX_SIMD_F2 or VEX_SIMD_F3 based on avx512bw supported or not. With this change now the calling place need to be fixed. One place I see this being used is loadIotaIndices(). Please fix loadIotaIndices to use appropriate instruction for the platform. Is there any other place in array copy/clear?

Copy link
Member Author

Choose a reason for hiding this comment

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

vector load operations in load_iota_indices are sensitive to vector length, a 64 byte iota values are loaded only for ByteVector.SPECIES_512 which necessitates existence of AVX512BW feature, I re-checked that copy/fill kernels use appropriate instructions.

Copy link

Choose a reason for hiding this comment

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

Thanks for checking.

@jatin-bhateja
Copy link
Member Author

Hi @sviswa7 , your comments have been addressed.

@jatin-bhateja
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented May 5, 2022

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 5, 2022

@jatin-bhateja Pushed as commit 3092b56.

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

@jatin-bhateja jatin-bhateja deleted the JDK-8284813 branch January 20, 2023 21:26
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
3 participants