X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Futil%2Fu_atomic.h;fp=src%2Futil%2Fu_atomic.h;h=a528e01bc9884baa2b980742dcfef820a7572612;hb=d7f2dfb67ee9c50f221d35c840d3427e8f184209;hp=401003638755ffaef05f754631ff74ed83766d44;hpb=a7eec6d620a333b722157cf1a2865b050d210aad;p=mesa.git diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h index 40100363875..a528e01bc98 100644 --- a/src/util/u_atomic.h +++ b/src/util/u_atomic.h @@ -71,8 +71,8 @@ #define PIPE_ATOMIC "MSVC Intrinsics" -/* We use the Windows header's Interlocked* functions instead of the - * _Interlocked* intrinsics wherever we can, as support for the latter varies +/* We use the Windows header's Interlocked*64 functions instead of the + * _Interlocked*64 intrinsics wherever we can, as support for the latter varies * with target CPU, whereas Windows headers take care of all portability * issues: using intrinsics where available, falling back to library * implementations where not. @@ -102,25 +102,25 @@ ((void) p_atomic_inc_return(_v)) #define p_atomic_inc_return(_v) (\ - sizeof *(_v) == sizeof(short) ? InterlockedIncrement16((short *) (_v)) : \ - sizeof *(_v) == sizeof(long) ? InterlockedIncrement ((long *) (_v)) : \ - sizeof *(_v) == sizeof(__int64) ? InterlockedIncrement64((__int64 *)(_v)) : \ + sizeof *(_v) == sizeof(short) ? _InterlockedIncrement16((short *) (_v)) : \ + sizeof *(_v) == sizeof(long) ? _InterlockedIncrement ((long *) (_v)) : \ + sizeof *(_v) == sizeof(__int64) ? InterlockedIncrement64 ((__int64 *)(_v)) : \ (assert(!"should not get here"), 0)) #define p_atomic_dec(_v) \ ((void) p_atomic_dec_return(_v)) #define p_atomic_dec_return(_v) (\ - sizeof *(_v) == sizeof(short) ? InterlockedDecrement16((short *) (_v)) : \ - sizeof *(_v) == sizeof(long) ? InterlockedDecrement ((long *) (_v)) : \ - sizeof *(_v) == sizeof(__int64) ? InterlockedDecrement64((__int64 *)(_v)) : \ + sizeof *(_v) == sizeof(short) ? _InterlockedDecrement16((short *) (_v)) : \ + sizeof *(_v) == sizeof(long) ? _InterlockedDecrement ((long *) (_v)) : \ + sizeof *(_v) == sizeof(__int64) ? InterlockedDecrement64 ((__int64 *)(_v)) : \ (assert(!"should not get here"), 0)) #define p_atomic_cmpxchg(_v, _old, _new) (\ - sizeof *(_v) == sizeof(char) ? _InterlockedCompareExchange8((char *) (_v), (char) (_new), (char) (_old)) : \ - sizeof *(_v) == sizeof(short) ? InterlockedCompareExchange16((short *) (_v), (short) (_new), (short) (_old)) : \ - sizeof *(_v) == sizeof(long) ? InterlockedCompareExchange ((long *) (_v), (long) (_new), (long) (_old)) : \ - sizeof *(_v) == sizeof(__int64) ? InterlockedCompareExchange64((__int64 *)(_v), (__int64)(_new), (__int64)(_old)) : \ + sizeof *(_v) == sizeof(char) ? _InterlockedCompareExchange8 ((char *) (_v), (char) (_new), (char) (_old)) : \ + sizeof *(_v) == sizeof(short) ? _InterlockedCompareExchange16((short *) (_v), (short) (_new), (short) (_old)) : \ + sizeof *(_v) == sizeof(long) ? _InterlockedCompareExchange ((long *) (_v), (long) (_new), (long) (_old)) : \ + sizeof *(_v) == sizeof(__int64) ? InterlockedCompareExchange64 ((__int64 *)(_v), (__int64)(_new), (__int64)(_old)) : \ (assert(!"should not get here"), 0)) #endif