Atomic floats on x86_64

Jonathan Wakely
Mon Nov 10 17:49:00 GMT 2014

On 10 November 2014 16:46, Andrew Haley wrote:
> What do you believe a __builtin does but a standard atomic does not do?

Both C11 and C++11 only support atomic operations on their "atomic
types" and there's no atomic float type (although I'm not sure the
builtins should really support floating point types either).

The atomic types are also incompatible between C11, as in C they use
the _Atomic qualifier and in C++ they are struct types. So although
you can write this in both languages, it doesn't have the same

atomic_int i;
atomic_store(&i, 1);

(Because WG14 made a last-minute change to the design that very
deliberately allowed compatibility between the languages.)

More information about the Gcc-help mailing list