diff options
author | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-09 15:30:18 +0300 |
---|---|---|
committer | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-09 15:30:18 +0300 |
commit | 06eb1e603f9527c1cf205d630fa5c58bd808f9fb (patch) | |
tree | 1121b403297bce3ff504706f6f152e8cb575b520 | |
parent | ed8a12ca33ffa69604bc261e65a17ea6c04fbeb8 (diff) | |
download | ffts-06eb1e603f9527c1cf205d630fa5c58bd808f9fb.zip ffts-06eb1e603f9527c1cf205d630fa5c58bd808f9fb.tar.gz |
Add new attributes to control/improve branch predictions
-rw-r--r-- | src/ffts_attributes.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ffts_attributes.h b/src/ffts_attributes.h index 763a6af..bdfd616 100644 --- a/src/ffts_attributes.h +++ b/src/ffts_attributes.h @@ -96,4 +96,16 @@ #define FFTS_ASSUME_ALIGNED_32(x) x #endif +#if defined(__GNUC__) +#define FFTS_LIKELY(cond) __builtin_expect(!!(cond), 1) +#else +#define FFTS_LIKELY(cond) cond +#endif + +#if defined(__GNUC__) +#define FFTS_UNLIKELY(cond) __builtin_expect(!!(cond), 0) +#else +#define FFTS_UNLIKELY(cond) cond +#endif + #endif /* FFTS_ATTRIBUTES_H */ |