Changeset 3516e7ae3f4df445e780bee77b2a9a7f6ce7ddb8
- Timestamp:
- 04/28/08 09:19:16 (8 months ago)
- Author:
- krayouva <krayouva@…>
- Parents:
- 08b306ad3b952ec99117ba23c795ddb6c733ae52
- Children:
- ed4cf588b31c5ebb50b4d502802d243fec2cb338
- git-committer:
- krayouva <krayouva@gmail.com> / 2008-04-27T19:19:16Z-0400
- Message:
-
* Added likely/unlikely branch prediction hints
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r495f45
|
r3516e7
|
|
| 13 | 13 | #include <stdarg.h> |
| 14 | 14 | #include <assert.h> |
| | 15 | #include <string.h> |
| 15 | 16 | |
| 16 | 17 | #define FRT_MAX_WORD_SIZE 255 |
| … |
… |
|
| 24 | 25 | #endif |
| 25 | 26 | |
| 26 | | /* This version error out if it can't inline the function */ |
| 27 | 27 | #if __GNUC__ >= 3 |
| 28 | 28 | # define FRT_ALWAYS_INLINE inline __attribute__ ((always_inline)) |
| | 29 | # define likely(x) __builtin_expect(!!(x), 1) |
| | 30 | # define unlikely(x) __builtin_expect(!!(x), 0) |
| 29 | 31 | #else |
| 30 | 32 | # define FRT_ALWAYS_INLINE |
| | 33 | # define likely(x) (x) |
| | 34 | # define unlikely(x) (x) |
| 31 | 35 | #endif |
| 32 | 36 | |