Remove AO_T_IS_INT definition for GCC atomic intrinsics case
authorIvan Maidanski <ivmai@mail.ru>
Mon, 18 Apr 2016 07:19:20 +0000 (10:19 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 18 Apr 2016 07:19:20 +0000 (10:19 +0300)
(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.

src/atomic_ops/sysdeps/gcc/arm.h
src/atomic_ops/sysdeps/gcc/mips.h
src/atomic_ops/sysdeps/gcc/nios2.h

index d4bf028..0f7c958 100644 (file)
@@ -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
index 13c7cc7..429ab07 100644 (file)
 /* 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"
index 5b976be..a1581bd 100644 (file)
@@ -12,5 +12,3 @@
  */
 
 #include "generic.h"
-
-#define AO_T_IS_INT