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

Billy O'Neal (VC LIBS) via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 28 14:28:20 PDT 2019


>Are you sure we shouldn't be marking these as atomic instead of volatile? Volatile is usually not suitable for anything except

I am implementing <atomic> 🙂

Billy3

________________________________
From: Reid Kleckner <rnk at google.com>
Sent: Thursday, March 28, 2019 02:27 PM
To: Billy O'Neal (VC LIBS)
Cc: JF Bastien; cfe-dev
Subject: Re: [cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon

On Thu, Mar 28, 2019 at 2:20 PM Billy O'Neal (VC LIBS) <bion at microsoft.com<mailto:bion at microsoft.com>> wrote:
> all they do is emit a volatile load

If I understand correctly the point of these is to make an ordinary volatile load/store happen on ARM under /volatile:ms<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcpp%2Fbuild%2Freference%2Fvolatile-volatile-keyword-interpretation%3Fview%3Dvs-2017&data=02%7C01%7Cbion%40microsoft.com%7C2c2e5799b30c43c1581408d6b3c42699%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636894052372924502&sdata=%2BN7Js4HfLK8XWiBdtQO5pOxI8FC2EduXL2Icg%2FApzMo%3D&reserved=0>. We asked for the intrinsic to also be provided on Intel because it reduces the amount of macro-tastic-ness we need in <atomic>.

That makes sense, but I'm left wondering in what context a plain volatile load is useful for implementing <atomic>. I went in assuming that, to implement atomic, you need to use intrinsics to emit atomic memory operations.

Are you sure we shouldn't be marking these as atomic instead of volatile? Volatile is usually not suitable for anything except
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190328/df2a7971/attachment.html>


More information about the cfe-dev mailing list