CMS 3D CMS Logo

Likely.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_Likely_h
2 #define FWCore_Utilities_Likely_h
4 
5 #if GCC_PREREQUISITE(3, 0, 0)
6 
7 #if defined(NO_LIKELY)
8 #define LIKELY(x) (x)
9 #define UNLIKELY(x) (x)
10 #elif defined(REVERSE_LIKELY)
11 #define UNLIKELY(x) (__builtin_expect(x, true))
12 #define LIKELY(x) (__builtin_expect(x, false))
13 #else
14 #define LIKELY(x) (__builtin_expect(x, true))
15 #define UNLIKELY(x) (__builtin_expect(x, false))
16 #endif
17 
18 #else
19 #define NO_LIKELY
20 #define LIKELY(x) (x)
21 #define UNLIKELY(x) (x)
22 #endif
23 
24 #endif