RFR: 8372528: Unify atomic exchange and compare exchange [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Nov 26 10:06:53 UTC 2025


On Wed, 26 Nov 2025 09:58:27 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> 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.

I have followup specialisations for multiple os-cpu combinations. Will create RFEs for them soon. But my aim is to have those go into JDK 27.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28498#discussion_r2564351594


More information about the hotspot-dev mailing list