From 7f26ba38df551b757e8ff5adbd2ea4ff406cb870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 26 Jan 2013 23:30:20 +0100 Subject: cas.h code cleanup --- cas.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cas.h b/cas.h index 32ee586..b2e6328 100644 --- a/cas.h +++ b/cas.h @@ -72,8 +72,8 @@ inline int cas(volatile cas_pointer_t* mem, cas_pointer_t old_val, cas_pointer_t #if defined(__i386__) && defined(__GNUC__) - asm volatile("lock; cmpxchg8b (%6);" - "setz %7; " + asm volatile("lock cmpxchg8b (%6);" + "setz %7;" : "=a" ( old_val.lo ), "=d" ( old_val.hi ) : "0" ( old_val.lo ), @@ -88,15 +88,15 @@ inline int cas(volatile cas_pointer_t* mem, cas_pointer_t old_val, cas_pointer_t #elif defined(__x86_64__) && defined(__GNUC__) asm volatile ( - "lock cmpxchg16b %1\n\t" - "setz %0" + "lock cmpxchg16b %1;" + "setz %0;" : "=q" ( success ) , "+m" ( *mem ) , "+d" ( old_val.hi ) , "+a" ( old_val.lo ) : "c" ( new_val.hi ) , "b" ( new_val.lo ) - : "cc" + : "cc", "memory" ); #endif -- cgit v1.1-2-g2b99