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

Andrew Haley aph at openjdk.org
Tue Nov 26 11:59:40 UTC 2024


On Mon, 25 Nov 2024 12:59:10 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> s390x Port for : [JDK-8331341](https://bugs.openjdk.org/browse/JDK-8331341)
>> 
>> Tier1 test: 
>> 1. `-XX:+UseSecondarySupersTable  -XX:+VerifySecondarySupers -XX:+VerifySecondarySupers -XX:-UseSecondarySupersCache`
>> 2.  No flag turn on. i.e. used `UseSecondarySupersCache` by default. 
>> 3. `-XX:+UseSecondarySupersTable  -XX:+VerifySecondarySupers -XX:+VerifySecondarySupers -XX:-UseSecondarySupersCache` with C1 compiler
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   suggestion from Andrew

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()

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

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


More information about the hotspot-dev mailing list