From: Ivan Maidanski Date: Fri, 29 Mar 2013 03:45:03 +0000 (+0400) Subject: Reformat asm instructions of sunc/x86.h X-Git-Tag: libatomic_ops-7_4_0~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d8afff72a4d5f6d27022a2f7529406d61f57970;p=libatomic_ops Reformat asm instructions of sunc/x86.h * src/atomic_ops/sysdeps/sunc/x86.h (AO_fetch_and_add_full, AO_char_fetch_and_add_full, AO_short_fetch_and_add_full, AO_and_full, AO_or_full, AO_xor_full, AO_compare_and_swap_full): Reformat code. --- diff --git a/src/atomic_ops/sysdeps/sunc/x86.h b/src/atomic_ops/sysdeps/sunc/x86.h index 3b8ddf7..a3cb922 100644 --- a/src/atomic_ops/sysdeps/sunc/x86.h +++ b/src/atomic_ops/sysdeps/sunc/x86.h @@ -51,8 +51,9 @@ { AO_t result; - __asm__ __volatile__ ("lock; xadd %0, %1" : - "=r" (result), "+m" (*p) : "0" (incr) + __asm__ __volatile__ ("lock; xadd %0, %1" + : "=r" (result), "+m" (*p) + : "0" (incr) : "memory"); return result; } @@ -64,8 +65,9 @@ AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr) { unsigned char result; - __asm__ __volatile__ ("lock; xaddb %0, %1" : - "=q" (result), "+m" (*p) : "0" (incr) + __asm__ __volatile__ ("lock; xaddb %0, %1" + : "=q" (result), "+m" (*p) + : "0" (incr) : "memory"); return result; } @@ -76,8 +78,9 @@ AO_short_fetch_and_add_full (volatile unsigned short *p, unsigned short incr) { unsigned short result; - __asm__ __volatile__ ("lock; xaddw %0, %1" : - "=r" (result), "+m" (*p) : "0" (incr) + __asm__ __volatile__ ("lock; xaddw %0, %1" + : "=r" (result), "+m" (*p) + : "0" (incr) : "memory"); return result; } @@ -88,8 +91,9 @@ AO_short_fetch_and_add_full (volatile unsigned short *p, unsigned short incr) AO_INLINE void AO_and_full (volatile AO_t *p, AO_t value) { - __asm__ __volatile__ ("lock; and %1, %0" : - "+m" (*p) : "r" (value) + __asm__ __volatile__ ("lock; and %1, %0" + : "+m" (*p) + : "r" (value) : "memory"); } # define AO_HAVE_and_full @@ -97,8 +101,9 @@ AO_short_fetch_and_add_full (volatile unsigned short *p, unsigned short incr) AO_INLINE void AO_or_full (volatile AO_t *p, AO_t value) { - __asm__ __volatile__ ("lock; or %1, %0" : - "+m" (*p) : "r" (value) + __asm__ __volatile__ ("lock; or %1, %0" + : "+m" (*p) + : "r" (value) : "memory"); } # define AO_HAVE_or_full @@ -106,8 +111,9 @@ AO_short_fetch_and_add_full (volatile unsigned short *p, unsigned short incr) AO_INLINE void AO_xor_full (volatile AO_t *p, AO_t value) { - __asm__ __volatile__ ("lock; xor %1, %0" : - "+m" (*p) : "r" (value) + __asm__ __volatile__ ("lock; xor %1, %0" + : "+m" (*p) + : "r" (value) : "memory"); } # define AO_HAVE_xor_full @@ -134,7 +140,7 @@ AO_test_and_set_full (volatile AO_TS_t *addr) char result; __asm__ __volatile__ ("lock; cmpxchg %2, %0; setz %1" : "+m" (*addr), "=a" (result) - : "r" (new_val), "a"(old) + : "r" (new_val), "a" (old) : "memory"); return (int) result; }