about summary refs log tree commit diff
path: root/nptl/sysdeps/i386/i486/bits
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-07 18:34:43 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-07 18:34:43 +0000
commit0a0ee8be8f5e1caf73f7801b6cfdde56f23a63d5 (patch)
treef5ff825ee1399a07039cb90da02d7c8330e70cc9 /nptl/sysdeps/i386/i486/bits
parent6326c93cfd7bba8e0abd9f306ae9161294b2620f (diff)
downloadglibc-0a0ee8be8f5e1caf73f7801b6cfdde56f23a63d5.tar.gz
glibc-0a0ee8be8f5e1caf73f7801b6cfdde56f23a63d5.tar.xz
glibc-0a0ee8be8f5e1caf73f7801b6cfdde56f23a63d5.zip
Fix a few unused definitions.
Diffstat (limited to 'nptl/sysdeps/i386/i486/bits')
-rw-r--r--nptl/sysdeps/i386/i486/bits/atomic.h47
1 files changed, 27 insertions, 20 deletions
diff --git a/nptl/sysdeps/i386/i486/bits/atomic.h b/nptl/sysdeps/i386/i486/bits/atomic.h
index 5d27326825..80a49872e1 100644
--- a/nptl/sysdeps/i386/i486/bits/atomic.h
+++ b/nptl/sysdeps/i386/i486/bits/atomic.h
@@ -121,26 +121,35 @@ typedef uintmax_t uatomic_max_t;
 
 #define atomic_exchange_and_add(mem, value) \
   ({ __typeof (*mem) result;						      \
+     __typeof (value) addval = (value);					      \
      if (sizeof (*mem) == 1)						      \
-       __asm __volatile (LOCK "xaddb %b0, %1"				      \
-			 : "=r" (result), "=m" (*mem)			      \
-			 : "0" (value), "1" (*mem));			      \
+       {								      \
+	 __asm __volatile (LOCK "xaddb %b0, %1"				      \
+			   : "=r" (result), "=m" (*mem)			      \
+			   : "0" (addval), "1" (*mem));			      \
+	 result += addval;						      \
+       }								      \
      else if (sizeof (*mem) == 2)					      \
-       __asm __volatile (LOCK "xaddw %w0, %1"				      \
-			 : "=r" (result), "=m" (*mem)			      \
-			 : "0" (value), "1" (*mem));			      \
+       {								      \
+	 __asm __volatile (LOCK "xaddw %w0, %1"				      \
+			   : "=r" (result), "=m" (*mem)			      \
+			   : "0" (addval), "1" (*mem));			      \
+	 result += addval;						      \
+       }								      \
      else if (sizeof (*mem) == 4)					      \
-       __asm __volatile (LOCK "xaddl %0, %1"				      \
-			 : "=r" (result), "=m" (*mem)			      \
-			 : "0" (value), "1" (*mem));			      \
+       {								      \
+	 __asm __volatile (LOCK "xaddl %0, %1"				      \
+			   : "=r" (result), "=m" (*mem)			      \
+			   : "0" (addval), "1" (*mem));			      \
+	 result += addval;						      \
+       }								      \
      else								      \
        {								      \
-	 __typeof (value) addval = (value);				      \
 	 __typeof (*mem) oldval;					      \
 	 __typeof (mem) memp = (mem);					      \
 	 do								      \
 	   result = (oldval = *memp) + addval;				      \
-	 while (! __arch_compare_and_exchange_64_acq (memp, result, oldval)); \
+	 while (__arch_compare_and_exchange_64_acq (memp, result, oldval));   \
        }								      \
      result; })
 
@@ -169,9 +178,9 @@ typedef uintmax_t uatomic_max_t;
 		__typeof (mem) memp = (mem);				      \
 		do							      \
 		  oldval = *memp;					      \
-		while (! __arch_compare_and_exchange_64_acq (memp,	      \
-							     oldval + addval, \
-							     oldval));	      \
+		while (__arch_compare_and_exchange_64_acq (memp,	      \
+							   oldval + addval,   \
+							   oldval));	      \
 	      }								      \
 	    })
 
@@ -233,9 +242,8 @@ typedef uintmax_t uatomic_max_t;
 		__typeof (mem) memp = (mem);				      \
 		do							      \
 		  oldval = *memp;					      \
-		while (! __arch_compare_and_exchange_64_acq (memp,	      \
-							     oldval + 1,      \
-							     oldval));	      \
+		while (__arch_compare_and_exchange_64_acq (memp, oldval + 1,  \
+							   oldval));	      \
 	      }								      \
 	    })
 
@@ -278,9 +286,8 @@ typedef uintmax_t uatomic_max_t;
 		__typeof (mem) memp = (mem);				      \
 		do							      \
 		  oldval = *memp;					      \
-		while (! __arch_compare_and_exchange_64_acq (memp,	      \
-							     oldval - 1,      \
-							     oldval));	      \
+		while (__arch_compare_and_exchange_64_acq (memp, oldval - 1,  \
+							   oldval));	      \
 	      }								      \
 	    })