diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-07-07 14:29:13 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-07-07 14:29:13 +0000 |
commit | 7667d814899d8e67cb8e45d5d04adf22e388e4d8 (patch) | |
tree | 72e101af59f3b6842be4554458b524a805d2f94f /lib/make/cctk_Config.h.in | |
parent | 51cef93356584dc23771ef43ccb827a1abcf8159 (diff) |
Add CCTK_BUILTIN_ASSUME_ALIGNED
This checks whether the GCC extension __builtin_assume_aligned is
available, which can generate more efficient code when accessing data
via pointers.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@5033 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/cctk_Config.h.in')
-rw-r--r-- | lib/make/cctk_Config.h.in | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index 2e3a0c48..4858893a 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -373,7 +373,7 @@ typedef enum {false, true} bool; /* Whether __builtin_expect exists. */ #undef HAVE_CCTK_C_BUILTIN_EXPECT #ifdef HAVE_CCTK_C_BUILTIN_EXPECT -# define CCTK_BUILTIN_EXPECT(x,y) __builtin_expect(x,y) +# define CCTK_BUILTIN_EXPECT __builtin_expect #else # define CCTK_BUILTIN_EXPECT(x,y) (x) #endif @@ -381,11 +381,19 @@ typedef enum {false, true} bool; /* Whether __builtin_unreachable exists. */ #undef HAVE_CCTK_C_BUILTIN_UNREACHABLE #ifdef HAVE_CCTK_C_BUILTIN_UNREACHABLE -# define CCTK_BUILTIN_UNREACHABLE() __builtin_unreachable() +# define CCTK_BUILTIN_UNREACHABLE __builtin_unreachable #else # define CCTK_BUILTIN_UNREACHABLE() CCTK_Abort(0, 1) #endif +/* Whether __builtin_assume_aligned exists. */ +#undef HAVE_CCTK_C_BUILTIN_ASSUME_ALIGNED +#ifdef HAVE_CCTK_C_BUILTIN_ASSUME_ALIGNED +# define CCTK_BUILTIN_ASSUME_ALIGNED __builtin_assume_aligned +#else +# define CCTK_BUILTIN_ASSUME_ALIGNED(exp, ...) (exp) +#endif + /* OpenMP collapse clause */ #if (defined CCTK_DISABLE_OMP_COLLAPSE || \ (defined __IBMC__ && defined _ARCH_450D) || \ @@ -582,7 +590,7 @@ typedef enum {false, true} bool; /* Whether __builtin_expect exists. */ #undef HAVE_CCTK_CXX_BUILTIN_EXPECT #ifdef HAVE_CCTK_CXX_BUILTIN_EXPECT -# define CCTK_BUILTIN_EXPECT(x,y) __builtin_expect(x,y) +# define CCTK_BUILTIN_EXPECT __builtin_expect #else # define CCTK_BUILTIN_EXPECT(x,y) (x) #endif @@ -590,11 +598,19 @@ typedef enum {false, true} bool; /* Whether __builtin_unreachable exists. */ #undef HAVE_CCTK_CXX_BUILTIN_UNREACHABLE #ifdef HAVE_CCTK_CXX_BUILTIN_UNREACHABLE -# define CCTK_BUILTIN_UNREACHABLE() __builtin_unreachable() +# define CCTK_BUILTIN_UNREACHABLE __builtin_unreachable #else # define CCTK_BUILTIN_UNREACHABLE() CCTK_Abort(0, 1) #endif +/* Whether __builtin_assume_aligned exists. */ +#undef HAVE_CCTK_CXX_BUILTIN_ASSUME_ALIGNED +#ifdef HAVE_CCTK_CXX_BUILTIN_ASSUME_ALIGNED +# define CCTK_BUILTIN_ASSUME_ALIGNED __builtin_assume_aligned +#else +# define CCTK_BUILTIN_ASSUME_ALIGNED(exp, ...) (exp) +#endif + /* Whether static_assert exists. */ #undef HAVE_CCTK_CXX_STATIC_ASSERT #ifdef HAVE_CCTK_CXX_STATIC_ASSERT |