On Tue, 11 Aug 2026 10:20:46 GMT, Harshit Dhiman <[email protected]> wrote:

>> Port the Z garbage collector to s390.
>> 
>> The tier1 test case are passing using `-XX:+UseZGC` flag
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Harshit Dhiman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   don;t set cc

src/hotspot/cpu/s390/gc/z/z_s390.ad line 54:

> 52:   __ z_lgr(Z_R0_scratch, ref);
> 53:   __ relocate(barrier_Relocation::spec(), 
> ZBarrierRelocationFormatMarkBadBeforeTest);
> 54:   __ z_nill(Z_R0_scratch, barrier_Relocation::unpatched);

can't you use `z_tmll` here and get rid of Z_R0 altogether ?

src/hotspot/cpu/s390/gc/z/z_s390.ad line 83:

> 81:   __ z_lgr(Z_R0_scratch, ref);
> 82:   __ relocate(barrier_Relocation::spec(), 
> ZBarrierRelocationFormatLoadBadBeforeTest);
> 83:   __ z_nill(Z_R0_scratch, barrier_Relocation::unpatched);

Same as above.

src/hotspot/cpu/s390/gc/z/z_s390.ad line 186:

> 184: 
> 185:     __ z_csg($oldval_temp$$Register, $newval_temp$$Register, mem_addr);
> 186:     if (VM_Version::has_LoadStoreConditional()) {

there is `z_locghi` instruction support on z13+ hardware, you can add something 
like this: 


    if (VM_Version::has_LoadStoreConditional2()) {
      __ z_lghi($res$$Register, 1L);                                         // 
true  (succeed)
      __ z_locghi($res$$Register, 0L, Assembler::bcondNotEqual);             // 
false (failed)
    }

src/hotspot/cpu/s390/gc/z/z_s390.ad line 218:

> 216:     __ branch_optimized(Assembler::bcondNotEqual, retry);
> 217:     __ z_lgr($newval$$Register, $temp2$$Register);
> 218:     z_uncolor(masm, this, $newval$$Register);

can't you just reduce it to 

__ z_srlg($newval$$Register, $temp2$$Register, ZPointerLoadShift);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31984#discussion_r3841701433
PR Review Comment: https://git.openjdk.org/jdk/pull/31984#discussion_r3841705696
PR Review Comment: https://git.openjdk.org/jdk/pull/31984#discussion_r3841722600
PR Review Comment: https://git.openjdk.org/jdk/pull/31984#discussion_r3841741425

Reply via email to