GCC interpretation of C11 atomics (DR 459)

Florian Weimer fweimer@redhat.com
Mon Feb 26 18:16:00 GMT 2018


On 02/26/2018 05:00 AM, Ruslan Nikolaev via gcc wrote:
> If I understand correctly, the redirection to libatomic was made for 2 reasons:
> 1. cmpxchg16b is not available on early amd64 processors. (However, mcx16 flag already specifies that you use CPUs that have this instruction, so it should not be a concern when the flag is specified.)
> 2. atomic_load on read-only memory.

I think x86-64 should be able to do atomic load and store via SSE2 
registers, but perhaps if the memory is suitably aligned (which is the 
other problem—the libatomic code will work irrespective of alignment, as 
far as I understand it).

Thanks,
Florian



More information about the Gcc mailing list