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

Bo Persson bop at gmb.dk
Thu Oct 7 02:42:57 PDT 2010




On 7 okt 2010 07:15 "Francois Pichet" <pichet2000 at gmail.com> wrote:
> On Wed, Oct 6, 2010 at 1:05 PM, Bo Persson <bop at gmb.dk> wrote:
> > Francois Pichet wrote:
> >
> >> On Wed, Oct 6, 2010 at 10:59 AM, Douglas Gregor
> >> <dgregor at apple.com>
> >> wrote:
> >>>
> >>> On Oct 6, 2010, at 7:58 AM, Francois Pichet wrote:
> >>>
> >>>> I did some research and it will be easier than I thought.
> >>>> With the exception of __noop and __assume (possibly more), MSVC
> >>>> intrinsics require a prototype.
> >>>> So they will be handled like normal functions by clang.
> >>>
> >>> Where does this prototype come from?
> >>
> >> #include <intrin.h>
> >
> > Just a helpful(?) comment about intrin.h being larger for MSVC10
> > than
> > for MSVC8 or 9, and that not all of the functions are documented by
> > MSDN (or the Visual Studio help files).
> >
> > 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.


Bo Persson




More information about the cfe-dev mailing list