openMSX
likely.hh
Go to the documentation of this file.
1 #ifndef LIKELY_HH
2 #define LIKELY_HH
3 
4 /* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
5  * a mechanism by which the user can annotate likely branch directions and
6  * expect the blocks to be reordered appropriately. Define __builtin_expect
7  * to nothing for earlier compilers.
8  */
9 
10 #if __GNUC__ > 2
11 #define likely(x) __builtin_expect((x),1)
12 #define unlikely(x) __builtin_expect((x),0)
13 #else
14 #define likely(x) (x)
15 #define unlikely(x) (x)
16 #endif
17 
18 #endif