From: Ivan Maidanski Date: Mon, 8 Oct 2012 14:09:40 +0000 (+0400) Subject: Use built-in __sync CAS for double-CAS if AO_USE_SYNC_CAS_BUILTIN for x86 X-Git-Tag: libatomic_ops-7_4_0~72^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03de7740c21fe6e4a6bdd7af09d5ff5189d4d70e;p=libatomic_ops Use built-in __sync CAS for double-CAS if AO_USE_SYNC_CAS_BUILTIN for x86 * 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). --- diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 188ee0b..ad28d6d 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -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 */