__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined on aarch64

Alexander Monakov amonakov@ispras.ru
Tue Jun 27 22:53:00 GMT 2017


On Tue, 27 Jun 2017, Richard Earnshaw wrote:
> Only *seems* to work.  The ldxp operation is *NOT* atomic and atomicity
> is only guaranteed if a store back of the original read value completes.
> 
> In general this makes ldxp not useful for atomic operations since we
> cannot guarantee that the location is writable.

But the original question was not about atomic reads, it was about atomic CAS,
so obviously the location is going to written.

It seems in armv8.1a there's also a separate doubleword cas instruction, CASP?
It appears to be implemented in Binutils: https://sourceware.org/ml/binutils/2014-09/msg00021.html
but not in GCC.

Alexander



More information about the Gcc-help mailing list