RFR: 8282414: x86: Enhance the assembler to generate more compact instructions [v2]

Quan Anh Mai duke at openjdk.java.net
Sat Feb 26 06:49:35 UTC 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.

Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:

 - punctuation
 - remove wrong instruction

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7628/files
  - new: https://git.openjdk.java.net/jdk/pull/7628/files/05a0e707..2c6dc08e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7628&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7628&range=00-01

  Stats: 20 lines in 2 files changed: 0 ins; 9 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7628.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7628/head:pull/7628

PR: https://git.openjdk.java.net/jdk/pull/7628


More information about the hotspot-compiler-dev mailing list