Please see the comment at http://llvm.org/bugs/show_bug.cgi?id=13283#c5 for the details.
For some reason, the value of *_Addend at the end of the function is wrong if we include <intrin.h>; also, it fails to compile if we declare the function without including the header. 2013/10/1 Warren Hunt <[email protected]>: > I've tested them under a variety cases. Are you concerned about the (- > _Value) clause? > > -Warren > > > On Mon, Sep 30, 2013 at 3:58 AM, Timur Iskhodzhanov <[email protected]> > wrote: >> >> 2013/9/28 Warren Hunt <[email protected]>: >> > +static __inline__ >> > long __cdecl _InterlockedExchangeAdd(long volatile *_Addend, long >> > _Value); >> > ... >> > +static __inline__ short __attribute__((__always_inline__, __nodebug__)) >> > +_InterlockedExchangeAdd16(short volatile *_Addend, short _Value) { >> > + return __atomic_add_fetch(_Addend, _Value, 0) - _Value; >> > +} >> > +static __inline__ long __attribute__((__always_inline__, __nodebug__)) >> > +_InterlockedExchangeAdd(long volatile *_Addend, long _Value) { >> > + return __atomic_add_fetch(_Addend, _Value, 0) - _Value; >> > +} >> >> Are you sure this is a correct/complete implementation? >> http://llvm.org/bugs/show_bug.cgi?id=13283#c5 > > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
