RFR: 8349582: APX NDD code generation for OpenJDK [v2]

Srinivas Vamsi Parasa sparasa at openjdk.org
Wed Mar 12 17:58:03 UTC 2025


On Tue, 4 Mar 2025 19:11:36 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   revert to nf version for {pop/tz/lz}cnt count instructions
>
> src/hotspot/cpu/x86/x86_64.ad line 4398:
> 
>> 4396:   %}
>> 4397:   ins_encode %{
>> 4398:     __ eshrl($dst$$Register, $mem$$Address, markWord::klass_shift_at_offset, false);
> 
> This change could be done as part of loadNKlassCompactHeaders instruct itself as there is no additional register needed.
> Something like below:
> if (UseAPX_ {
>   __ eshrl($dst$$Register, $mem$$Address, markWord::klass_shift_at_offset, false);
> } else {
>   __ movl($dst$$Register, $mem$$Address);
>   __ shrl($dst$$Register, markWord::klass_shift_at_offset);
> }

Please see this suggestion incorporated in the updated code.

> src/hotspot/cpu/x86/x86_64.ad line 5587:
> 
>> 5585: 
>> 5586: instruct countLeadingZerosI_mem_nf(rRegI dst, memory src) %{
>> 5587:   predicate(UseAPX && UseCountLeadingZerosInstruction);
> 
> This instruct could be removed as this is already an unary operation with separate destination,

Please see this suggestion incorporated in the updated code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23501#discussion_r1992011506
PR Review Comment: https://git.openjdk.org/jdk/pull/23501#discussion_r1992012405


More information about the hotspot-compiler-dev mailing list