diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-14 18:58:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-14 18:58:34 +0300 |
commit | cf71ad5db541cba69d9214aa4df5752d8c7eec80 (patch) | |
tree | 322f1bfea6947ddfa8c50ee930b93bdbad447214 /src | |
parent | 142ff23dba038330b724372be3653f62ecd979e4 (diff) | |
download | plus-cf71ad5db541cba69d9214aa4df5752d8c7eec80.tar.gz plus-cf71ad5db541cba69d9214aa4df5752d8c7eec80.tar.bz2 plus-cf71ad5db541cba69d9214aa4df5752d8c7eec80.tar.xz plus-cf71ad5db541cba69d9214aa4df5752d8c7eec80.zip |
Add branch prediction macroses for gcc.
Diffstat (limited to 'src')
-rw-r--r-- | src/localconsts.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/localconsts.h b/src/localconsts.h index af97ff723..12c14a5e7 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -223,6 +223,14 @@ #endif // ENABLE_CILKPLUS #endif // __GNUC__ +#ifdef __GNUC__ +#define A_LIKELY(x) __builtin_expect (!!(x), 1) +#define A_UNLIKELY(x) __builtin_expect (!!(x), 0) +#else // __GNUC__ +#define A_LIKELY(x) (x) +#define A_UNLIKELY(x) (x) +#endif // __GNUC__ + #define notfinal #define FOR_EACH(type, iter, array) for (type iter = array.begin(), \ |