RFR: 8351994: Enable Extended EVEX to REX2/REX demotion when src and dst are the same

Jatin Bhateja jbhateja at openjdk.org
Fri Apr 4 03:07:52 UTC 2025


On Fri, 4 Apr 2025 01:15:36 GMT, Srinivas Vamsi Parasa <sparasa at openjdk.org> wrote:

> The current scheme for Intel APX NDD code generation favors the emission of NDD instruction on APX-enabled targets, even if destination and source registers are the same. To prevent this, this PR extends the assembler layer to demote EEVEX to REX encoding if dst matches with source operands.

src/hotspot/cpu/x86/assembler_x86.cpp line 13825:

> 13823:   return (!no_flags && dst_enc == nds_enc);
> 13824: }
> 13825: 

@vamsi-parasa , We are missing a case where dst_enc can be equal to src_enc; in that case, we can still demote EVEX to REX/REX2 encoding, along with a change in primary opcode if needed.

This will apply to all the commutative operations (ADD/ AND / OR / XOR)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24431#discussion_r2028015376


More information about the hotspot-compiler-dev mailing list