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

Sandhya Viswanathan sviswanathan at openjdk.org
Mon May 5 22:02:48 UTC 2025


On Mon, 5 May 2025 15:44:05 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.
>
> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove unused functions: orw and evex_prefix_int8_operand_ndd

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

> 12974:     if (pre == VEX_SIMD_66) {
> 12975:       emit_int8(0x66);
> 12976:     }

We could do this based on size instead: if (size == EVEX_16bit).

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

> 12991:     if (pre == VEX_SIMD_66) {
> 12992:       emit_int8(0x66);
> 12993:     }

We could do this based on size instead: if (size == EVEX_16bit).

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

> 13007:     if (pre == VEX_SIMD_66) {
> 13008:       emit_int8(0x66);
> 13009:     }

This is not used and could be removed.

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

> 13042:   bool demote = is_demotable(no_flags, dst_enc, nds_enc);
> 13043:   if (demote) {
> 13044:     (size == EVEX_64bit) ? prefixq_and_encode(dst_enc) : prefix_and_encode(dst_enc);

This could be:
(size == EVEX_64bit) ? prefixq(dst_enc) : prefix(dst_enc);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24431#discussion_r2073975889
PR Review Comment: https://git.openjdk.org/jdk/pull/24431#discussion_r2073976654
PR Review Comment: https://git.openjdk.org/jdk/pull/24431#discussion_r2073972698
PR Review Comment: https://git.openjdk.org/jdk/pull/24431#discussion_r2074129665


More information about the hotspot-compiler-dev mailing list