RFR: 8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2

Srinivas Vamsi Parasa sparasa at openjdk.org
Thu Aug 28 21:50:28 UTC 2025


This change extends Extended EVEX (EEVEX) to REX2/REX demotion for Intel APX NDD instructions to handle commutative operations when the destination register and the second source register (src2) are the same.

Currently, EEVEX to REX2/REX demotion is only enabled when the first source (src1) and the destination are the same. This enhancement allows additional cases of valid demotion for commutative instructions (add, imul, and, or, xor).

For example:
`eaddl r18, r25, r18` can be encoded as `addl r18, r25` using APX REX2 encoding
`eaddl r2, r7, r2` can be encoded as `addl r2, r7` using non-APX legacy encoding

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

Commit messages:
 - remove trailing whitespaces
 - remove unused instructions
 - 8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2

Changes: https://git.openjdk.org/jdk/pull/26997/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26997&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354348
  Stats: 3194 lines in 5 files changed: 630 ins; 159 del; 2405 mod
  Patch: https://git.openjdk.org/jdk/pull/26997.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26997/head:pull/26997

PR: https://git.openjdk.org/jdk/pull/26997


More information about the hotspot-compiler-dev mailing list