From: Ivan Maidanski Date: Mon, 18 Apr 2016 07:19:20 +0000 (+0300) Subject: Remove AO_T_IS_INT definition for GCC atomic intrinsics case X-Git-Tag: v7.6.0~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5037981549c072ba8f4f71ae3575a49bc29e6ea6;p=libatomic_ops Remove AO_T_IS_INT definition for GCC atomic intrinsics case (Code refactoring) In case of GCC/C11 atomic intrinsics are used, AO_int_* are defined in generic-arithm.h and generic-small.h files. * src/atomic_ops/sysdeps/gcc/arm.h (AO_T_IS_INT): Do not define if AO_GCC_ATOMIC_TEST_AND_SET. * src/atomic_ops/sysdeps/gcc/mips.h (AO_T_IS_INT): Likewise. * src/atomic_ops/sysdeps/gcc/nios2.h (AO_T_IS_INT): Do not define. --- diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index d4bf028..0f7c958 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -703,6 +703,8 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) # define AO_HAVE_test_and_set_full #endif /* !AO_HAVE_test_and_set[_full] && AO_ARM_HAVE_SWP */ +#define AO_T_IS_INT + #else /* AO_GCC_ATOMIC_TEST_AND_SET */ # if defined(__clang__) && !defined(AO_ARM_HAVE_LDREX) @@ -719,5 +721,3 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) # include "generic.h" #endif /* AO_GCC_ATOMIC_TEST_AND_SET */ - -#define AO_T_IS_INT diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h index 13c7cc7..429ab07 100644 --- a/src/atomic_ops/sysdeps/gcc/mips.h +++ b/src/atomic_ops/sysdeps/gcc/mips.h @@ -20,10 +20,6 @@ /* Data dependence does not imply read ordering. */ #define AO_NO_DD_ORDERING -#if !defined(_ABI64) || _MIPS_SIM != _ABI64 -# define AO_T_IS_INT -#endif - /* #include "../standard_ao_double_t.h" */ /* TODO: Implement double-wide operations if available. */ @@ -47,7 +43,8 @@ # include "../test_and_set_t_is_ao_t.h" # include "../all_aligned_atomic_load_store.h" -# ifdef AO_T_IS_INT +# if !defined(_ABI64) || _MIPS_SIM != _ABI64 +# define AO_T_IS_INT # define AO_MIPS_SET_ISA " .set mips2\n" # define AO_MIPS_LL_1(args) " ll " args "\n" # define AO_MIPS_SC(args) " sc " args "\n" diff --git a/src/atomic_ops/sysdeps/gcc/nios2.h b/src/atomic_ops/sysdeps/gcc/nios2.h index 5b976be..a1581bd 100644 --- a/src/atomic_ops/sysdeps/gcc/nios2.h +++ b/src/atomic_ops/sysdeps/gcc/nios2.h @@ -12,5 +12,3 @@ */ #include "generic.h" - -#define AO_T_IS_INT