[cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 30 16:54:02 PDT 2019


On Tue, Jul 30, 2019 at 4:15 PM Billy O'Neal (VC LIBS) <bion at microsoft.com>
wrote:

> > we can worry about optimization, perhaps using _Atomic, later
>
>
>
> We can’t use _Atomic because it would not be ABI compatible with our
> std::atomic; in particular, because we put the spinlock for non-lock-free
> atomics inside the atomic, for instance. And because that isn’t a thing for
> some of our supported frontends.
>
>
>
> It is possible that there are different intrinsics we could call for Clang
> that would make you folks happier, but we don’t know what those are or even
> if they exist at present.
>

I was thinking that perhaps the _Atomic_address_as template would do the
necessary casts to use it when necessary without changing the storage type
inside the std::atomic object.


> > I think the only downside to using _ReadWriteBarrier, which compiles to
> an LLVM IR fence, and volatile memory operations
>
>
>
> Also be aware that on Windows there is a lot of code from before the C++
> memory model existed, that treats volatile loads as having acquire
> semantics, hence our `/volatile:ms` switch, which is the default on the
> platforms that do this for `free` (x86 and amd64).
>

Right.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190730/3092fcc5/attachment.html>


More information about the cfe-dev mailing list