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 334dba0..de1506d 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 62ad0da..b89905b 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 6c5e221..b2ec7d4 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 c898082..73838f6 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 527a347..13923f7 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 69ec05b..331f7d3 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 b304dd0..ac3933d 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 3c538fd..a4d384e 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 3ab17a1..0265592 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 9abd8a0..c77120a 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