From a0d763d871d82a7a5df7ed749dc43a4dca94899b Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 20 Nov 2009 15:17:35 -0700 Subject: [PATCH] use cmpxchgq for 64-bit operands in atomicCompareAndSwap --- src/x86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x86.h b/src/x86.h index b195ed7725..f9f3c038a1 100644 --- a/src/x86.h +++ b/src/x86.h @@ -212,7 +212,7 @@ atomicCompareAndSwap(uintptr_t* p, uintptr_t old, uintptr_t new_) #elif defined ARCH_x86_64 uint8_t result; - __asm__ __volatile__("lock; cmpxchg1 %2, %0; setz %1" + __asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1" : "=m"(*p), "=q"(result) : "r"(new_), "a"(old), "m"(*p) : "memory");