RFR: 8307495: Specialize atomic bitset functions for aix-ppc

Martin Doerr mdoerr at openjdk.org
Wed Oct 8 10:38:20 UTC 2025


On Mon, 6 Oct 2025 15:16:26 GMT, David Briemann <dbriemann at openjdk.org> wrote:

> Also refactor so that linux and aix use the same code for ppc.

Very nice! I really like this change!

Thanks for refactoring and using single inline assembler code for all PPC64 platforms!
That should also help the BSD port.

The merged atomicAccess_ppc looks good. You have removed Power7 code from AIX which was forgotten.
You have also added back the missing "simple guard" in `PlatformCmpxchg<1>` which got lost on linux. That may be helpful to avoid some performance issues.
I guess we should consider a backport, later.

src/hotspot/cpu/ppc/atomicAccess_ppc.hpp line 250:

> 248: 
> 249:   // Using 32 bit internally.
> 250:   unsigned int old_value, loaded_value;

`loaded_value` seems to be unused.

src/hotspot/cpu/ppc/atomicAccess_ppc.hpp line 414:

> 412:       "   and     %[result], %[old_value], %[bits]    \n"
> 413:       "   stwcx.  %[result], 0, %[dest]    \n"
> 414:       "   bne-    1b            \n"

Maybe use uniform indentation for the "\n" as for other atomics? (optional)

src/hotspot/os_cpu/aix_ppc/atomicAccess_aix_ppc.hpp line 27:

> 25: 
> 26: #ifndef OS_CPU_AIX_PPC_ATOMICACCESS_AIX_PPC_HPP
> 27: #define OS_CPU_AIX_PPC_ATOMICACCESS_AIX_PPC_HPP

Maybe remove these guards? The ones in the new file should be sufficient. (The same for the other files.)

src/hotspot/os_cpu/aix_ppc/atomicAccess_aix_ppc.hpp line 30:

> 28: 
> 29: // Included in atomicAccess.hpp header file.
> 30: 

Maybe add comment like "We use inline assembler which is shared for several PPC64 platforms."

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

PR Review: https://git.openjdk.org/jdk/pull/27650#pullrequestreview-3314146500
PR Review Comment: https://git.openjdk.org/jdk/pull/27650#discussion_r2413378586
PR Review Comment: https://git.openjdk.org/jdk/pull/27650#discussion_r2413384929
PR Review Comment: https://git.openjdk.org/jdk/pull/27650#discussion_r2413392885
PR Review Comment: https://git.openjdk.org/jdk/pull/27650#discussion_r2413396328


More information about the hotspot-dev mailing list