]> granicus.if.org Git - libatomic_ops/commitdiff
Use built-in __sync CAS for double-CAS if AO_USE_SYNC_CAS_BUILTIN for x86
authorIvan Maidanski <ivmai@mail.ru>
Mon, 8 Oct 2012 14:09:40 +0000 (18:09 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 8 Oct 2012 14:09:40 +0000 (18:09 +0400)
* src/atomic_ops/sysdeps/gcc/x86.h
(AO_compare_double_and_swap_double_full): Do not define if
AO_USE_SYNC_CAS_BUILTIN, define AO_double_compare_and_swap_full
(based on __sync_bool_compare_and_swap) instead (for x86).

src/atomic_ops/sysdeps/gcc/x86.h

index 188ee0bdf2a671352092366ef05b067a8c9f6d79..ad28d6daed8179bfff8a0008717672a8e3f00b7a 100644 (file)
@@ -179,7 +179,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
 }
 #define AO_HAVE_fetch_compare_and_swap_full
 
-#if !defined(__x86_64__)
+#if !defined(__x86_64__) && !defined(AO_USE_SYNC_CAS_BUILTIN)
 # include "../standard_ao_double_t.h"
 
   /* Returns nonzero if the comparison succeeded.       */
@@ -246,7 +246,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
 
 # define AO_T_IS_INT
 
-#elif defined(__ILP32__)
+#elif defined(__ILP32__) || !defined(__x86_64__)
 # include "../standard_ao_double_t.h"
 
   /* X32 has native support for 64-bit integer operations (AO_double_t  */