summaryrefslogtreecommitdiffstats
path: root/cas.h
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-26 23:30:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-26 23:30:20 +0100
commit7f26ba38df551b757e8ff5adbd2ea4ff406cb870 (patch)
tree547ee93dc89b455e1bd189003697e4181aa3be8c /cas.h
parent06ff03a17dc2f4ec2be0d1af21174f15bbb8bdea (diff)
downloadlock_free-7f26ba38df551b757e8ff5adbd2ea4ff406cb870.zip
lock_free-7f26ba38df551b757e8ff5adbd2ea4ff406cb870.tar.gz
cas.h code cleanup
Diffstat (limited to 'cas.h')
-rw-r--r--cas.h10
1 files 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