diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-26 23:30:20 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-26 23:30:20 +0100 |
commit | 7f26ba38df551b757e8ff5adbd2ea4ff406cb870 (patch) | |
tree | 547ee93dc89b455e1bd189003697e4181aa3be8c /cas.h | |
parent | 06ff03a17dc2f4ec2be0d1af21174f15bbb8bdea (diff) | |
download | lock_free-7f26ba38df551b757e8ff5adbd2ea4ff406cb870.zip lock_free-7f26ba38df551b757e8ff5adbd2ea4ff406cb870.tar.gz |
cas.h code cleanup
Diffstat (limited to 'cas.h')
-rw-r--r-- | cas.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |