diff options
author | Kristian Høgsberg <[email protected]> | 2010-05-11 12:07:10 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-05-11 14:06:22 -0400 |
commit | 199b0894b501607bf8d599ef5efc08cd6c08c79d (patch) | |
tree | 7c545c23739311eee3c8897b2a1d3b7ee09dae92 /src/mesa/main/compiler.h | |
parent | 08e443a1c8218e43dcd953859843d95d9020a892 (diff) |
mesa: Optimize get.c by using a table-driven approach
Diffstat (limited to 'src/mesa/main/compiler.h')
-rw-r--r-- | src/mesa/main/compiler.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 81704ae2c11..efd8057608c 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -200,6 +200,13 @@ extern "C" { # define __builtin_expect(x, y) x #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 /** * The __FUNCTION__ gcc variable is generally only used for debugging. |