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

Quan Anh Mai duke at openjdk.java.net
Sat Feb 26 05:58:22 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.

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

Commit messages:
 - fix get operand
 - shorter instructions

Changes: https://git.openjdk.java.net/jdk/pull/7628/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7628&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8282414
  Stats: 83 lines in 2 files changed: 69 ins; 2 del; 12 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