RFR: 8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2 [v2]
Srinivas Vamsi Parasa
sparasa at openjdk.org
Thu Sep 4 20:15:52 UTC 2025
On Thu, 4 Sep 2025 20:11:28 GMT, Srinivas Vamsi Parasa <sparasa at openjdk.org> wrote:
>> 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
>
> Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - nomenclature change
> - Merge branch 'master' of https://git.openjdk.java.net/jdk into cdemotion
> - remove trailing whitespaces
> - remove unused instructions
> - 8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2
> Hi @vamsi-parasa , thanks for working on this, I am process of validating #26283 and find that additional RA biasing will enable demotion for more cases, with a minimal test case I see following results
>
Hi Jatin (@jatin-bhateja), thank you for sharing the information about the register allocation biasing PR you're working on that will improve demotion.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26997#issuecomment-3255441849
More information about the hotspot-compiler-dev
mailing list