From: Marco Costalba Date: Mon, 15 Jul 2013 19:09:06 +0000 (+0200) Subject: Don't use __builtin_expect X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=46fdb14b2f51386d14b3fd0ad49f511bb491bed6 Don't use __builtin_expect Partially revert previous patch and use unlikey() just as code annotation. Actually it is better to rely on a profiler for branch prediction: http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html "In fact, even when only one in ten thousand values is nonzero, we're still at only roughly the break-even point" No functional change, --- diff --git a/src/types.h b/src/types.h index 8eb99455..155c2e89 100644 --- a/src/types.h +++ b/src/types.h @@ -42,6 +42,8 @@ #include "platform.h" +#define unlikely(x) (x) // For code annotation purposes + #if defined(_WIN64) && !defined(IS_64BIT) # include // MSVC popcnt and bsfq instrinsics # define IS_64BIT @@ -71,14 +73,6 @@ # 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