]> granicus.if.org Git - libatomic_ops/commitdiff
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 d4bf028a8172271a85dd0c673ea38e4efffdc91a..0f7c958d4a260791ba7af59845f7e1fd04de9e7d 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 13c7cc7a6b07c45707d3d43b3f9e8f6d422615ff..429ab0737f6da7d8876c0d46e62cbf0a3118bf54 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 5b976be17941538896012d03329de79df63743d1..a1581bda5faf109c70dcb0097a691e677e99013c 100644 (file)
@@ -12,5 +12,3 @@
  */
 
 #include "generic.h"
-
-#define AO_T_IS_INT