libatomic: Enable lock-free 128-bit atomics on AArch64
commit3fa689f6ed8387d315e58169bb9bace3bd508c0a
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 1 Dec 2023 17:28:57 +0000 (1 17:28 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 15 Dec 2023 13:19:41 +0000 (15 13:19 +0000)
tree592ec491c3b28de47ae9bf3dcd1641fd30476242
parentbbdb72ba29ead4931a6cfff023c0485fa25e648b
libatomic: Enable lock-free 128-bit atomics on AArch64

Enable lock-free 128-bit atomics on AArch64.  This is backwards compatible with
existing binaries (as for these GCC always calls into libatomic, so all 128-bit
atomic uses in a process are switched), gives better performance than locking
atomics and is what most users expect.

128-bit atomic loads use a load/store exclusive loop if LSE2 is not supported.
This results in an implicit store which is invisible to software as long as the
given address is writeable (which will be true when using atomics in real code).

This doesn't yet change __atomic_is_lock_free eventhough all atomics are finally
lock-free on AArch64.

libatomic:
* config/linux/aarch64/atomic_16.S: Implement lock-free ARMv8.0 atomics.
(libat_exchange_16): Merge RELEASE and ACQ_REL/SEQ_CST cases.
* config/linux/aarch64/host-config.h: Use atomic_16.S for baseline v8.0.
libatomic/config/linux/aarch64/atomic_16.S
libatomic/config/linux/aarch64/host-config.h