RFR: 8316961: Fallback implementations for 64-bit Atomic::{add,xchg} on 32-bit platforms [v3]

Aleksey Shipilev shade at openjdk.org
Mon Oct 23 09:13:40 UTC 2023


On Fri, 20 Oct 2023 12:03:55 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> See the bug for rationale. Looks like there is enough infrastructure to achieve what we want without significant fan-out. I checked all `atomic_*.hpp` headers for unimplemented `PlatformAdd<8>` and `PlatformXchg<8>`, and only these seem to be affected.
>> 
>> Unfortunately, we cannot test these apart from the existing gtest.
>> 
>> Additional testing:
>>  - [x] linux-x86-server-fastdebug, atomic tests pass
>>  - [x] linux-arm-server-fastdebug, atomic tests pass (with #16269 applied)
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Protect 64-bit tests with supports_cx8()

Yes, it is confusing. `Atomic` docs still mention `supports_cx8` as the pre-check for using 64-bit atomics, which gets extra confusing if it was only intended to serve as availability check for Java accesses:
https://github.com/openjdk/jdk/blob/729f4c5d141cdc272249c4c69efd05f96a654137/src/hotspot/share/runtime/atomic.hpp#L58-L62

So I would like to go forward with this PR. The only question that remains for me is whether to protect the gtest cases with `supports_cx8` (satisfying the `Atomic` contract), or drop the checks there, thus giving the early warning for platform maintainers that they are actually expected to implement 64-bit atomics regardless.

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

PR Comment: https://git.openjdk.org/jdk/pull/16252#issuecomment-1774754901


More information about the hotspot-dev mailing list