[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r12124 - in /fsf/trunk/ports: ChangeLog.arm sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h



Author: eglibc
Date: Thu Nov 25 00:04:34 2010
New Revision: 12124

Log:
Import glibc-ports-mainline for 2010-11-25

Modified:
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Thu Nov 25 00:04:34 2010
@@ -1,3 +1,9 @@
+2010-11-24  Ken Werner  <ken.werner@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (atomic_full_barrier,
+	__arch_compare_and_exchange_val_32_acq): Use the atomic builtins
+	provided by GCC if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is defined.
+
 2010-11-22  Andreas Schwab  <schwab@xxxxxxxxxx>
 
 	* sysdeps/arm/preconfigure: Only modify CFLAGS when configuring

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h Thu Nov 25 00:04:34 2010
@@ -37,7 +37,12 @@
 
 void __arm_link_error (void);
 
-#ifdef __thumb2__
+/* Use the atomic builtins provided by GCC in case the backend provides
+   a pattern to do this efficiently.  */
+
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define atomic_full_barrier() __sync_synchronize ()
+#elif defined __thumb2__
 #define atomic_full_barrier() \
      __asm__ __volatile__						      \
 	     ("movw\tip, #0x0fa0\n\t"					      \
@@ -64,11 +69,15 @@
 #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
   ({ __arm_link_error (); oldval; })
 
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  __sync_val_compare_and_swap ((mem), (oldval), (newval))
+
 /* It doesn't matter what register is used for a_oldval2, but we must
    specify one to work around GCC PR rtl-optimization/21223.  Otherwise
    it may cause a_oldval or a_tmp to be moved to a different register.  */
 
-#ifdef __thumb2__
+#elif defined __thumb2__
 /* Thumb-2 has ldrex/strex.  However it does not have barrier instructions,
    so we still need to use the kernel helper.  */
 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \