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,sf_4_base
parent
cbb1a8ed31
commit
46fdb14b2f
10
src/types.h
10
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 <intrin.h> // 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
|
||||
|
|
Loading…
Reference in New Issue