RFR: 8372528: Unify atomic exchange and compare exchange [v2]
Kim Barrett
kbarrett at openjdk.org
Wed Nov 26 10:00:49 UTC 2025
On Wed, 26 Nov 2025 09:38:55 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update test/hotspot/gtest/runtime/test_atomic.cpp
>>
>> Co-authored-by: Stefan Karlsson <stefan.karlsson at oracle.com>
>
> src/hotspot/cpu/ppc/atomicAccess_ppc.hpp line 162:
>
>> 160: template<>
>> 161: struct AtomicAccess::PlatformXchg<1> : AtomicAccess::XchgUsingCmpxchg<1> {};
>> 162:
>
> What platforms are we not adding this snippet to? In other words; Can we move this to the generic code instead?
Today, none. Tomorrow, x86, and perhaps some others. (I think not arm/aarch64,
I don't remember if ppc has byte atomics but I think not, and I have no idea
about riscv or s390.)
But there is a trick that I used for PlatformBitops that might be applied here
too. See the dummy bool template parameter.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28498#discussion_r2564330309
More information about the hotspot-dev
mailing list