include: Use __atomic_exchange_n() for InterlockedExchange*() if possible.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dc02bbee54
commit
aabdaed102
|
@ -7015,7 +7015,9 @@ static FORCEINLINE unsigned char InterlockedCompareExchange128( volatile __int64
|
|||
static FORCEINLINE LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
|
||||
{
|
||||
LONG ret;
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
|
||||
ret = __atomic_exchange_n( dest, val, __ATOMIC_SEQ_CST );
|
||||
#elif defined(__i386__) || defined(__x86_64__)
|
||||
__asm__ __volatile__( "lock; xchgl %0,(%1)"
|
||||
: "=r" (ret) :"r" (dest), "0" (val) : "memory" );
|
||||
#else
|
||||
|
@ -7042,7 +7044,9 @@ static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest )
|
|||
static FORCEINLINE void * WINAPI InterlockedExchangePointer( void *volatile *dest, void *val )
|
||||
{
|
||||
void *ret;
|
||||
#ifdef __x86_64__
|
||||
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
|
||||
ret = __atomic_exchange_n( dest, val, __ATOMIC_SEQ_CST );
|
||||
#elif defined(__x86_64__)
|
||||
__asm__ __volatile__( "lock; xchgq %0,(%1)" : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
|
||||
#elif defined(__i386__)
|
||||
__asm__ __volatile__( "lock; xchgl %0,(%1)" : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
|
||||
|
|
Loading…
Reference in New Issue