summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-04-18 10:19:20 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-04-18 10:19:20 +0300
commit5037981549c072ba8f4f71ae3575a49bc29e6ea6 (patch)
tree920a0b016e32f0255efc4c0dad56044d1e0399e9
parented76ab0f2428478560d57284359c56ba3b33f2f7 (diff)
downloadlibatomic_ops-5037981549c072ba8f4f71ae3575a49bc29e6ea6.tar.gz
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.
-rw-r--r--src/atomic_ops/sysdeps/gcc/arm.h4
-rw-r--r--src/atomic_ops/sysdeps/gcc/mips.h7
-rw-r--r--src/atomic_ops/sysdeps/gcc/nios2.h2
3 files changed, 4 insertions, 9 deletions
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