<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal"><img width="1139" height="289" style="width:11.8645in;height:3.0104in" id="Picture_x0020_4" src="cid:image001.png@01D54798.5211D880"></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> jfbastien@apple.com <jfbastien@apple.com> on behalf of JF Bastien <jfbastien@apple.com><br>
<b>Sent:</b> Tuesday, July 30, 2019 9:00:43 PM<br>
<b>To:</b> Billy O'Neal (VC LIBS) <bion@microsoft.com><br>
<b>Cc:</b> Eli Friedman <efriedma@quicinc.com>; rnk@google.com <rnk@google.com>; cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon</font>
<div> </div>
</div>
<div><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 30, 2019, at 8:59 PM, Billy O'Neal (VC LIBS) <<a href="mailto:bion@microsoft.com" class="">bion@microsoft.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
These are the builtins I have, not necessarily the builtins I desire.</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Definitely the builtins you deserve š¦¹āāļø</div>
<div><span style="font-size: 11pt; font-family: Calibri, sans-serif; caret-color: rgb(0, 0, 0);" class=""><br class="">
</span></div>
<div><span style="font-size: 11pt; font-family: Calibri, sans-serif; caret-color: rgb(0, 0, 0);" class=""> </span></div>
<blockquote type="cite" class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Billy3</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 838.875px;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span>
<div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a> <<a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a>>
on behalf of JF Bastien <<a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Tuesday, July 30, 2019 8:58:14 PM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>Billy O'Neal (VC LIBS) <<a href="mailto:bion@microsoft.com" class="">bion@microsoft.com</a>><br class="">
<b class="">Cc:</b><span class="Apple-converted-space"> </span>Eli Friedman <<a href="mailto:efriedma@quicinc.com" class="">efriedma@quicinc.com</a>>;
<a href="mailto:rnk@google.com" class="">rnk@google.com</a> <<a href="mailto:rnk@google.com" class="">rnk@google.com</a>>; cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon</font>
<div class=""> </div>
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
Eh, those arenāt the builtins Iād choose, but you do youā¦ Reidās implementation seems to match the quirks chosen, so Iām not sure thereās anything else to do here.
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Jul 30, 2019, at 8:54 PM, Billy O'Neal (VC LIBS) <<a href="mailto:bion@microsoft.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">bion@microsoft.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
> TL;DR: what are these _iso_ things?</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
They are volatile ops that are guaranteed to use 1 instruction to do that load. So for x86 that means using x87, or MMX, or SSE to do the load. They also suppress the āvolatile is affected by the /volatile:ms vs. /volatile:iso settingā warnings. <atomic> uses
these in conjunction with barrier instrinsics.</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#if defined(_M_ARM) || defined(_M_ARM64)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _Memory_barrier() __dmb(0xB) // inner shared data memory barrier</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _Compiler_or_memory_barrier() _Memory_barrier()</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE8(_Storage, _Value) __iso_volatile_store8(_Atomic_address_as<char>(_Storage), _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE16(_Storage, _Value) __iso_volatile_store16(_Atomic_address_as<short>(_Storage), _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE32(_Storage, _Value) __iso_volatile_store32(_Atomic_address_as<int>(_Storage), _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE64(_Storage, _Value) __iso_volatile_store64(_Atomic_address_as<long long>(_Storage), _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_LOAD8(_Storage) __iso_volatile_load8(_Atomic_address_as<const char>(_Storage))</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_LOAD16(_Storage) __iso_volatile_load16(_Atomic_address_as<const short>(_Storage))</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#elif defined(_M_IX86) || defined(_M_X64)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
// x86/x64 hardware only emits memory barriers inside _Interlocked intrinsics</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _Compiler_or_memory_barrier() _Compiler_barrier()</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE8(_Storage, _Value) (*_Atomic_address_as<char>(_Storage) = _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE16(_Storage, _Value) (*_Atomic_address_as<short>(_Storage) = _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE32(_Storage, _Value) (*_Atomic_address_as<long>(_Storage) = _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_STORE64(_Storage, _Value) (*_Atomic_address_as<long long>(_Storage) = _Value)</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_LOAD8(_Storage) (*_Atomic_address_as<const char>(_Storage))</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#define _ISO_VOLATILE_LOAD16(_Storage) (*_Atomic_address_as<const short>(_Storage))</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#else // ^^^ x86/x64 / unsupported hardware vvv</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#error Unsupported hardware</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
#endif // hardware</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
ā¦. Laterā¦</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
// in _<i class="">Atomic</i>_storage<1></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
_NODISCARD _Ty load() const noexcept { // load with sequential consistency</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
char _As_bytes = _ISO_VOLATILE_LOAD8(_Storage);</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
_Compiler_or_memory_barrier();</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
return reinterpret_cast<_Ty&>(_As_bytes);</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
}</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
_NODISCARD _Ty load(const memory_order _Order) const noexcept { // load with given memory order</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
char _As_bytes = _ISO_VOLATILE_LOAD8(_Storage);</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
_Load_barrier(_Order);</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
return reinterpret_cast<_Ty&>(_As_bytes);</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
}</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Billy3</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; border: none; padding: 0in;">
<b class="">From:<span class="Apple-converted-space"> </span></b><a href="mailto:jfbastien@apple.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">JF Bastien</a><br class="">
<b class="">Sent:<span class="Apple-converted-space"> </span></b>Tuesday, July 30, 2019 8:43 PM<br class="">
<b class="">To:<span class="Apple-converted-space"> </span></b><a href="mailto:efriedma@quicinc.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">Eli Friedman</a><br class="">
<b class="">Cc:<span class="Apple-converted-space"> </span></b><a href="mailto:rnk@google.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">rnk@google.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:bion@microsoft.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">Billy
O'Neal (VC LIBS)</a>;<span class="Apple-converted-space"> </span><a href="mailto:cfe-dev@lists.llvm.org" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">cfe-dev</a><br class="">
<b class="">Subject:<span class="Apple-converted-space"> </span></b>Re: [cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon</div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<br class="">
<br class="">
<o:p class=""></o:p></div>
<blockquote class="" style="margin-top: 5pt; margin-bottom: 5pt;">
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
On Jul 30, 2019, at 5:21 PM, Eli Friedman via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="" style="color: rgb(149, 79, 114); text-decoration: underline;">cfe-dev@lists.llvm.org</a>> wrote:<o:p class=""></o:p></div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
<div class="">
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<b class="">From:</b><span class="apple-converted-space"> </span>cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="color: purple;">cfe-dev-bounces@lists.llvm.org</span></a>><span class="apple-converted-space"> </span><b class="">On
Behalf Of<span class="apple-converted-space"> </span></b>Reid Kleckner via cfe-dev<br class="">
<b class="">Sent:</b><span class="apple-converted-space"> </span>Tuesday, July 30, 2019 4:54 PM<br class="">
<b class="">To:</b><span class="apple-converted-space"> </span>Billy O'Neal (VC LIBS) <<a href="mailto:bion@microsoft.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="color: purple;">bion@microsoft.com</span></a>><br class="">
<b class="">Cc:</b><span class="apple-converted-space"> </span>cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="color: purple;">cfe-dev@lists.llvm.org</span></a>><br class="">
<b class="">Subject:</b><span class="apple-converted-space"> </span>[EXT] Re: [cfe-dev] FYI, Intel folks might be looking to add the __iso_volatile_Xxx family for MSVC STL <atomic> soon<o:p class=""></o:p></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
<div class="">
<div class="">
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
On Tue, Jul 30, 2019 at 4:15 PM Billy O'Neal (VC LIBS) <<a href="mailto:bion@microsoft.com" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="color: purple;">bion@microsoft.com</span></a>> wrote:<o:p class=""></o:p></div>
</div>
</div>
<div class="">
<blockquote class="" style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin: 5pt 0in 5pt 4.8pt;">
<div class="">
<div class="">
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
> we can worry about optimization, perhaps using _Atomic, later<o:p class=""></o:p></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
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.<o:p class=""></o:p></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
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.<o:p class=""></o:p></div>
</div>
</div>
</div>
</blockquote>
<div class="">
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
</div>
<div class="">
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
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.<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
There are actually multiple APIs to access C++11 atomics in clang, since we invented APIs in parallel with gcc. The __atomic_* builtins (<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc%2F_005f_005fatomic-Builtins.html&data=02%7C01%7Cbion%40microsoft.com%7Ce5cdfd7a59ef4bc401c808d7156bc3cf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637001424903353452&sdata=0HD%2Fnjljz37kArc%2BBOnIBT7ZLlt%2F3zKYeGmpOMHFlew%3D&reserved=0" originalsrc="https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html" shash="LypCpOkzu/OeTO7hbDp9ISyxGhv7nlvPiUtZ0oT/Lx9ExXEiDjwUs1ZXtRx42jIxlA3XatayOyiEr4Qq0npdbHhn31tEEZt2K7Lenzl3BLWIwrDDj5N6nNSFMTQbp0SM6+kyfu+bEHsyGXUPMC1MqiswC2pr6fnTO8xe7HHDcFI=" originalsrc="https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html" shash="q6mUkvRxFjibT3FtvDIO4xJq2aav9fd4wj2N+P2Zsf513ts+V7tKwSwYYE59uWJQ+a/ifGI/SbdbQK0FFA0as2Mkwmse8AJNHfynOMA/3L2m3YaDnkZg0BSI9U5xeB0kvr+DNl69aFQslGT5h8Sd7uwoTZP/3erm0yoBDEZdwsc=" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="color: purple;">https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html</span></a>)
donāt require the use of _Atomic types.<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Using volatile loads and stores with barriers probably prevents the compiler from performing any breaking optimizations, assuming the RMW atomics are protected appropriately, and the user doesnāt call any of the clang atomic builtins directly. But itās not
a good idea; it wonāt optimize well. For example, on AArch64, it will prevent the compiler from using the dedicated load-acquire and store-release instructions.<o:p class=""></o:p></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
TL;DR: what are these _iso_ things? I read the bug report, I donāt see the details Iād expect.<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
I think the __atomic_* builtins should work as Eli suggests.<o:p class=""></o:p></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<br class="">
<br class="">
<o:p class=""></o:p></div>
<blockquote class="" style="margin-top: 5pt; margin-bottom: 5pt;">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
-Eli<o:p class=""></o:p></div>
</div>
</div>
</div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span class="" style="font-size: 9pt; font-family: Helvetica, sans-serif;">_______________________________________________<br class="">
cfe-dev mailing list<br class="">
</span><a href="mailto:cfe-dev@lists.llvm.org" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="font-size: 9pt; font-family: Helvetica, sans-serif; color: purple;">cfe-dev@lists.llvm.org</span></a><span class="" style="font-size: 9pt; font-family: Helvetica, sans-serif;"><br class="">
</span><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fcfe-dev&data=02%7C01%7Cbion%40microsoft.com%7Ce5cdfd7a59ef4bc401c808d7156bc3cf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637001424903353452&sdata=YPtBoQ%2FYgbB9oVZCAVv0yq0Myjsj5k6aNreh1qO41N8%3D&reserved=0" originalsrc="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" shash="HDErdvJgRHnwNwSijqH+KKjUtk0KW03rng1V2SVja0k2VJ1woqZT9+scP9WxJr4EPN7FWRwNAhc6dW+GjV+u1r7fb/kN6JlTDRdqNH0XZ9aZAUMD/nIh6Ejpvj2uheGz+QfX7iNG6X200FOxHbMdcoHosH7Sm6ZN1oGLc/+j/jI=" originalsrc="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" shash="QXJFz4qVwDbpGK8kk3QPtxaCzghIRV8rM1X8sRwztjDQEu/gkUEuAF145iOYNvdyRVC1FLm96EEi69GIRy2jHtaJ8Br/CmKD4Y4ImcyIlX6ad6br0jmULjyauD0JcrcYSrErRC8pY8Pv4MmyL42ucgHSG0n1RN7Kn41cEOH+lmU=" class="" style="color: rgb(149, 79, 114); text-decoration: underline;"><span class="" style="font-size: 9pt; font-family: Helvetica, sans-serif; color: purple;">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a></div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>