[cfe-dev] MSVC compiler intrinsics, need for direction.

Howard Hinnant hhinnant at apple.com
Thu Oct 7 07:29:40 PDT 2010


On Oct 7, 2010, at 5:42 AM, Bo Persson wrote:

>>> This effort also obviously duplicates some of the work done by
>>> Howard
>>> Hinnant to define a compiler API for C++0x <atomic>. Do we want
>>> several intrinsic functions doing the same thing?
>> 
>> There is no duplication, Howard's work is related to C++0X library.
>> My
>> work is related to using clang in a MSVC context without libc++
> 
> I was thinking about the _Interlocked intrinsics of MSVC, which could very well be used to implement a large part of <atomic>. Do we need the compiler to provide both an _InterlockedAdd8 and an __atomic_fetch_add_seq_cst? Or could one be implemented as an inline function calling the other?
> 
> Just asking.

The MSVC intrinsics appear to me to be a very small subset of what is needed for both C++0X and C1X.  Some of them (like _InterlockedCompareExchange) have subtly different semantics compared to the similarly named C++0X/C1X function.

-Howard





More information about the cfe-dev mailing list