RFR: 8339983: [s390x] secondary_super_cache does not scale well: C1 and interpreter [v2]

Amit Kumar amitkumar at openjdk.org
Tue Nov 26 14:00:41 UTC 2024


On Tue, 26 Nov 2024 12:02:27 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3495:
>> 
>>> 3493:   z_lngr(slot, slot); // slot = -slot
>>> 3494:   z_aghi(slot, 64); // slot = slot + 64
>>> 3495: 
>> 
>> So, I'm trying to make sense of this.
>> 
>> First, you do
>> 
>> 
>>    slot = 63 - slot
>>    slot = 64 - slot
>> 
>> 
>> Why not instead reduce
>> `   slot = 64 - (63 - slot)`
>> which is
>> `   slot = slot - 63 + 64`
>> which is
>> `   slot = slot + 1`
>> 
>> 
>> jshell> void p() {
>>    ...>     for (int s = 0; s < 64; s++) {
>>    ...>         int n1 = s;
>>    ...>         n1 = 63 - n1;
>>    ...>         n1 = 64 - n1;
>>    ...>         int n2 = s + 1;
>>    ...>         if (n1 != n2) {
>>    ...>             throw new RuntimeException();
>>    ...>         }
>>    ...>     }
>>    ...> }
>> |  created method p()
>> 
>> jshell> p()
>
> I am assuming that on s390 rotate right by 64 is equivalent to rotate right by 0, but I didn't check that.

I must say, that was a great suggestion. Thanks for pointing it out. I have pushed the change, please look at the new code :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22341#discussion_r1858592132


More information about the hotspot-dev mailing list