Skip to content

8282414: x86: Enhance the assembler to generate more compact instructions#7628

Closed
merykitty wants to merge 6 commits intoopenjdk:masterfrom
merykitty:shorterIns
Closed

8282414: x86: Enhance the assembler to generate more compact instructions#7628
merykitty wants to merge 6 commits intoopenjdk:masterfrom
merykitty:shorterIns

Conversation

@merykitty
Copy link
Copy Markdown
Member

@merykitty merykitty commented Feb 26, 2022

Hi, this patch enhances the x86 assembler to emit more compact code for some popular instructions.

For common arithmetic instructions against immediates, if the immediate requires more than 1 byte to encode, we can still shave off 1 byte if the register operand is rax.

For test instruction, since the operation does not write the result, we can downgrade a long to an int and an int to a byte instruction if the immediate is positive and encodable using a smaller amount of bytes.

Thank you very much.


Progress

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

Issue

  • JDK-8282414: x86: Enhance the assembler to generate more compact instructions

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7628

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

Using diff file

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

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Feb 26, 2022

👋 Welcome back merykitty! 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 Feb 26, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 26, 2022

@merykitty 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 Feb 26, 2022
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Feb 26, 2022

Webrevs

Copy link
Copy Markdown
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me and all tests pass. @sviswa7 could you have a look at this as well?

@TobiHartmann
Copy link
Copy Markdown
Member

/reviewers 2

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 14, 2022

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

8282414: x86: Enhance the assembler to generate more compact instructions

Reviewed-by: thartmann, 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 235 new commits pushed to the master branch:

  • 1465ea9: 8282355: compiler/arguments/TestCodeEntryAlignment.java failed "guarantee(sect->end() <= tend) failed: sanity"
  • ac06bdb: 8282507: Add a separate license file for hsdis
  • 32f8437: 8283075: Bad IllegalArgumentException message for out of range rank from ClassDesc.arrayType(int)
  • 12dca36: 8283189: Bad copyright header in UnsafeCopyMemory.java
  • 05a83e0: 8283124: Add constant for tau to Math and StrictMath
  • 671b6ef: 8283143: Use minimal-length literals to initialize PI and E constants
  • f43ffe2: 8282633: jarsigner output does not explain why an EC key is disabled if its curve has been disabled
  • 4de7201: 8283122: [AIX, s390] UnsafeCopyMemory 'Mismatched' Tests Fail on Big Endian Systems
  • 2cddf3f: 8282887: Potential memory leak in sun.util.locale.provider.HostLocaleProviderAdapterImpl.getNumberPattern() on Windows
  • 710653c: 8254786: java/net/httpclient/CancelRequestTest.java failing intermittently
  • ... and 225 more: https://git.openjdk.java.net/jdk/compare/d7f31d0d53bfec627edc83ceb75fc6202891e186...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 (@TobiHartmann, @sviswa7) 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 Mar 14, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 14, 2022

@TobiHartmann
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 14, 2022
Copy link
Copy Markdown

@sviswa7 sviswa7 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 to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 15, 2022
@merykitty
Copy link
Copy Markdown
Member Author

Thank you very much for the testings and reviews.
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 16, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 16, 2022

@merykitty
Your change (at version 1bdc273) is now ready to be sponsored by a Committer.

@sviswa7
Copy link
Copy Markdown

sviswa7 commented Mar 16, 2022

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 16, 2022

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

  • 1465ea9: 8282355: compiler/arguments/TestCodeEntryAlignment.java failed "guarantee(sect->end() <= tend) failed: sanity"
  • ac06bdb: 8282507: Add a separate license file for hsdis
  • 32f8437: 8283075: Bad IllegalArgumentException message for out of range rank from ClassDesc.arrayType(int)
  • 12dca36: 8283189: Bad copyright header in UnsafeCopyMemory.java
  • 05a83e0: 8283124: Add constant for tau to Math and StrictMath
  • 671b6ef: 8283143: Use minimal-length literals to initialize PI and E constants
  • f43ffe2: 8282633: jarsigner output does not explain why an EC key is disabled if its curve has been disabled
  • 4de7201: 8283122: [AIX, s390] UnsafeCopyMemory 'Mismatched' Tests Fail on Big Endian Systems
  • 2cddf3f: 8282887: Potential memory leak in sun.util.locale.provider.HostLocaleProviderAdapterImpl.getNumberPattern() on Windows
  • 710653c: 8254786: java/net/httpclient/CancelRequestTest.java failing intermittently
  • ... and 225 more: https://git.openjdk.java.net/jdk/compare/d7f31d0d53bfec627edc83ceb75fc6202891e186...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 16, 2022
@openjdk openjdk bot closed this Mar 16, 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 Mar 16, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 16, 2022

@sviswa7 @merykitty Pushed as commit bacfaa3.

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

@merykitty merykitty deleted the shorterIns branch March 25, 2022 08:28
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.

3 participants