[cfe-dev] Atomic operations/builtins and Windows

Ruben Van Boxem vanboxem.ruben at gmail.com
Sun Sep 25 12:51:35 PDT 2011


2011/9/25 Eli Friedman <eli.friedman at gmail.com>

> On Sun, Sep 25, 2011 at 12:04 PM, Ruben Van Boxem
> <vanboxem.ruben at gmail.com> wrote:
> > Hi,
> >
> > What is the status/usability of Clang's builtin atomic functions,
> especially
> > on Windows? Are the builtins related to the availability of pthreads or
> not?
> >
> > It seems libc++ uses these builtins, but for *-*-mingw*, they're
> undeclared
> > :(
> >
> > Can Clang "tap into" the GCC implementations?
>
> Please clarify what exactly you are talking about... which builtins,
> exactly?
>

Things documented/proposed? here:
http://libcxx.llvm.org/atomic_design_a.html
or http://libcxx.llvm.org/atomic_design_b.html
or http://libcxx.llvm.org/atomic_design_c.html
GCC has __sync_* documented here:
http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html

I don't know if libc++ <atomic> is meant to be usable yet (I would think it
is), but the __has_feature(cxx_atomic) is false for my Clang build. I do
know someone did some work in this regard for Clang. The only discussion on
this topic I can find right now is dated almost a year ago:
http://clang-developers.42468.n3.nabble.com/atomic-intrinsics-td1618127i20.html

Ruben

PS: if <atomic> is not meant to be used right now, I'll ignore it
completely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110925/1548b11d/attachment.html>


More information about the cfe-dev mailing list