Better annotate unlikely conditions

And in case of gcc we win also a small
speed optimization due to better branch
prediction.

No functional change.
This commit is contained in:
Marco Costalba
2013-07-15 20:50:24 +02:00
parent a6c5f60caa
commit cbb1a8ed31
3 changed files with 10 additions and 2 deletions

View File

@@ -71,6 +71,14 @@
# define FORCE_INLINE inline
#endif
#ifdef __GNUC__
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else
# define likely(x) (x)
# define unlikely(x) (x)
#endif
#if defined(USE_POPCNT)
const bool HasPopCnt = true;
#else