[cfe-dev] [libcxx] atomic header and low-level intrinsics

David Chisnall csdavec at swan.ac.uk
Mon Mar 26 05:48:41 PDT 2012


On 26 Mar 2012, at 12:44, Al Grant wrote:

>> Clang already implements the intrinsics.
> 
> Does it implement the GCC intrinsics?  I can't see __atomic_load_n.  And only
> two-argument __atomic_load is tested, not GCC's three-argument version.

Sorry, I meant to say, clang implements the intrinsics that libc++ uses.  

> The two intrinsics sets are not the same, though they are very similar.
> So libcxx <atomic> only works with clang and not with GCC.  If libcxx and clang
> changed to use and implement the GCC intrinsics, then libcxx would work with GCC.

And if GCC implemented the clang intrinsics, then the same is true.

The clang intrinsics are a 1:1 mapping to the C11 spec, while the GCC intrinsics are a mess, so I'm not sure that the world would be better served by adopting them.  

David





More information about the cfe-dev mailing list