<div dir="ltr">I've tested them under a variety cases.  Are you concerned about the (- _Value) clause?<div><br></div><div>-Warren</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 3:58 AM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2013/9/28 Warren Hunt <<a href="mailto:whunt@google.com">whunt@google.com</a>>:<br>
<div class="im">> +static __inline__<br>
>  long __cdecl _InterlockedExchangeAdd(long volatile *_Addend, long _Value);<br>
</div>> ...<br>
<div class="im">> +static __inline__ short __attribute__((__always_inline__, __nodebug__))<br>
> +_InterlockedExchangeAdd16(short volatile *_Addend, short _Value) {<br>
> +  return __atomic_add_fetch(_Addend, _Value, 0) - _Value;<br>
> +}<br>
> +static __inline__ long __attribute__((__always_inline__, __nodebug__))<br>
> +_InterlockedExchangeAdd(long volatile *_Addend, long _Value) {<br>
> +  return __atomic_add_fetch(_Addend, _Value, 0) - _Value;<br>
> +}<br>
<br>
</div>Are you sure this is a correct/complete implementation?<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=13283#c5" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=13283#c5</a><br>
</blockquote></div><br></div>