]> granicus.if.org Git - libatomic_ops/commitdiff
Include ao_t_is_int.h from atomic_ops.h after first generalization if
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 Nov 2011 17:11:06 +0000 (21:11 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 29 Nov 2011 17:11:06 +0000 (21:11 +0400)
AO_T_IS_INT (new macro) is defined in 'sysdeps' file

* src/atomic_ops.h (AO_T_IS_INT): Test macro after first
generalization, if set then include ao_t_is_int.h file and force
AO_GENERALIZE_TWICE.
* src/atomic_ops/sysdeps/gcc/hexagon.h (AO_T_IS_INT): Define new macro
instead of ao_t_is_int.h inclusion.
* src/atomic_ops/sysdeps/gcc/ia64.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/gcc/m68k.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/gcc/mips.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/gcc/x86.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/hpc/ia64.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/msftc/x86.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/sunc/x86.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/gcc/powerpc.h: Add place-holder comment (in
case of ppc64).
* src/atomic_ops/sysdeps/gcc/hexagon.h: Do not include generalize.h
any longer (since ao_t_is_int.h is included from atomic_ops.h now).
* src/atomic_ops/sysdeps/gcc/ia64.h: Likewise.
* src/atomic_ops/sysdeps/hpc/ia64.h: Likewise.

src/atomic_ops.h
src/atomic_ops/sysdeps/gcc/hexagon.h
src/atomic_ops/sysdeps/gcc/ia64.h
src/atomic_ops/sysdeps/gcc/m68k.h
src/atomic_ops/sysdeps/gcc/mips.h
src/atomic_ops/sysdeps/gcc/powerpc.h
src/atomic_ops/sysdeps/gcc/x86.h
src/atomic_ops/sysdeps/hpc/ia64.h
src/atomic_ops/sysdeps/msftc/x86.h
src/atomic_ops/sysdeps/sunc/x86.h

index 334dba0accb1e73c7596af994461fa3c1912a950..de1506d897ce12fe2a1b755ea0cb8cb26972cfd1 100644 (file)
 /* In fact, we observe that this converges after a small fixed number   */
 /* of iterations, usually one.                                          */
 #include "atomic_ops/generalize.h"
+
+#ifdef AO_T_IS_INT
+  /* Included after the first generalization pass.      */
+# include "atomic_ops/sysdeps/ao_t_is_int.h"
+# ifndef AO_GENERALIZE_TWICE
+    /* Always generalize again. */
+#   define AO_GENERALIZE_TWICE
+# endif
+#endif /* AO_T_IS_INT */
+
 #ifdef AO_GENERALIZE_TWICE
 # include "atomic_ops/generalize.h"
 #endif
index 62ad0da89134da51d5456f0cf81c12f71e60cde7..b89905bbd104a3721453cb47d50b808d98ca369d 100644 (file)
@@ -92,7 +92,4 @@ AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val)
 }
 #define AO_HAVE_compare_and_swap
 
-/* Generalize first to define more AO_int_... primitives.       */
-#include "../../generalize.h"
-
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT
index 6c5e221c10950654d536e208d7732e86a98b2fa4..b2ec7d4f5e5190469936a9dc8a448e56542b6473 100644 (file)
@@ -279,7 +279,5 @@ AO_int_compare_and_swap_release(volatile unsigned int *addr,
 /* FIXME: Add compare_double_and_swap_double for the _ILP32 case.       */
 
 #ifdef _ILP32
-  /* Generalize first to define more AO_int_... primitives.     */
-# include "../../generalize.h"
-# include "../ao_t_is_int.h"
+# define AO_T_IS_INT
 #endif
index c8980821eacf958b3042986ef398b6e3b1bc82e0..73838f6837c8a5c55095721232e2a6e98636ad2c 100644 (file)
@@ -63,4 +63,4 @@ AO_compare_and_swap_full(volatile AO_t *addr,
 }
 #define AO_HAVE_compare_and_swap_full
 
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT
index 527a34741a663fab11582e0bfbab36120533c90a..13923f7527cdd1801057fe67eeb8b94d00057bf2 100644 (file)
@@ -99,4 +99,4 @@ AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
  * directly.
  */
 
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT
index 69ec05b14897f9b66c0cda35faeff7400a0d8a56..331f7d3b90c3aa57fd9bc623d2967a5d11281a82 100644 (file)
@@ -279,6 +279,7 @@ AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr) {
 #define AO_HAVE_fetch_and_add_full
 
 #if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
+  /* Empty */
 #else
-# include "../ao_t_is_int.h"
+# define AO_T_IS_INT
 #endif
index b304dd0455a33c79aee746902426b69088888c40..ac3933def0858370345ca1828c37cfc0e34cb558 100644 (file)
@@ -182,4 +182,4 @@ AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
 }
 #define AO_HAVE_compare_double_and_swap_double_full
 
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT
index 3c538fde84465301ff9ae3265025ca6aa02869cd..a4d384e58e14242978d147aaa13ce3fe70f2aab8 100644 (file)
@@ -160,7 +160,5 @@ AO_short_compare_and_swap_release(volatile unsigned short *addr,
 #define AO_HAVE_short_compare_and_swap_release
 
 #ifndef __LP64__
-  /* Generalize first to define more AO_int_... primitives.     */
-# include "../../generalize.h"
-# include "../ao_t_is_int.h"
+# define AO_T_IS_INT
 #endif
index 3ab17a1b7b7a44fed57b17ac5a18ba422d030cde..0265592213be9a3472056913a9cad1a85156f9ab 100644 (file)
@@ -117,4 +117,4 @@ AO_double_compare_and_swap_full(volatile AO_double_t *addr,
 
 #endif /* AO_ASSUME_VISTA */
 
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT
index 9abd8a00057a315b117bd2513b797e833cfdfcc2..c77120a2295e3679fba983bddd8031fd51f30736 100644 (file)
@@ -179,4 +179,4 @@ AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
 #define AO_HAVE_compare_double_and_swap_double_full
 #endif
 
-#include "../ao_t_is_int.h"
+#define AO_T_IS_INT