RFR: 8307495: Specialize atomic bitset functions for aix-ppc [v5]
Martin Doerr
mdoerr at openjdk.org
Thu Oct 9 14:00:11 UTC 2025
On Thu, 9 Oct 2025 09:36:20 GMT, David Briemann <dbriemann at openjdk.org> wrote:
>> Add atomic bitset functions for PPC64.
>> Refactor so that inline assembler code is shared for all PPC64 platforms.
>> Add back a missing "simple guard" to PlatformCpmxchg<1>. Remove some dead Power7 code.
>
> David Briemann has updated the pull request incrementally with one additional commit since the last revision:
>
> beautify add_then_fetch
src/hotspot/cpu/ppc/atomicAccess_ppc.hpp line 246:
> 244: // the cmpxchg, so it's really a 'fence_cmpxchg_fence' if not
> 245: // specified otherwise (see atomicAccess.hpp).
> 246:
I found one more issue: AIX correctly used `const unsigned int masked_compare_val = ((unsigned int)(unsigned char)compare_value)`. Linux (since [JDK-8331859](https://bugs.openjdk.org/browse/JDK-8331859)) and this new implementation misses the cast to unsigned. So, cmpxchg will always fail when `compare_val` is negative because the load instructions use zero extend.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27650#discussion_r2416880657
More information about the hotspot-dev
mailing list