mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user