diff options
author | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-06 12:08:32 +0300 |
---|---|---|
committer | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-06 12:08:32 +0300 |
commit | fbcfb21e9de85b6443848c721523d3793ae668ff (patch) | |
tree | ed8666765ee25a2dd6dbbf1783374c8b2ff36e1f /src/ffts_attributes.h | |
parent | ceb8e6aef7f0e406ff4724896a8138bf72911a68 (diff) | |
download | ffts-fbcfb21e9de85b6443848c721523d3793ae668ff.zip ffts-fbcfb21e9de85b6443848c721523d3793ae668ff.tar.gz |
Add new attributes to help auto-vectorization
Diffstat (limited to 'src/ffts_attributes.h')
-rw-r--r-- | src/ffts_attributes.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/ffts_attributes.h b/src/ffts_attributes.h index 6ac2ac3..763a6af 100644 --- a/src/ffts_attributes.h +++ b/src/ffts_attributes.h @@ -68,10 +68,32 @@ #define FFTS_INLINE inline #endif -#if defined(_MSC_VER) +#if defined(__GNUC__) +#define FFTS_RESTRICT __restrict +#elif defined(_MSC_VER) +#define FFTS_RESTRICT __restrict +#else #define FFTS_RESTRICT +#endif + +#if GCC_VERSION_AT_LEAST(4,5) +#define FFTS_ASSUME(cond) do { if (!(cond)) __builtin_unreachable(); } while (0) +#elif defined(_MSC_VER) +#define FFTS_ASSUME(cond) __assume(cond) #else -#define FFTS_RESTRICT __restrict +#define FFTS_ASSUME(cond) +#endif + +#if GCC_VERSION_AT_LEAST(4,7) +#define FFTS_ASSUME_ALIGNED_16(x) __builtin_assume_aligned(x, 16) +#else +#define FFTS_ASSUME_ALIGNED_16(x) x +#endif + +#if GCC_VERSION_AT_LEAST(4,7) +#define FFTS_ASSUME_ALIGNED_32(x) __builtin_assume_aligned(x, 32) +#else +#define FFTS_ASSUME_ALIGNED_32(x) x #endif #endif /* FFTS_ATTRIBUTES_H */ |