… | |
… | |
96 | /* booleans, not the expression. */ |
96 | /* booleans, not the expression. */ |
97 | #define ecb_unlikely(expr) ecb_expect (!!(expr), 0) |
97 | #define ecb_unlikely(expr) ecb_expect (!!(expr), 0) |
98 | #define ecb_likely(expr) ecb_expect (!!(expr), 1) |
98 | #define ecb_likely(expr) ecb_expect (!!(expr), 1) |
99 | |
99 | |
100 | /* try to tell the compiler that some condition is definitely true */ |
100 | /* try to tell the compiler that some condition is definitely true */ |
101 | #define ecb_assume(cond) do { if (!(cond)) unreachable (); } while (0) |
101 | #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) |
102 | |
102 | |
103 | /* count trailing zero bits and count # of one bits */ |
103 | /* count trailing zero bits and count # of one bits */ |
104 | #if ECB_GCC_VERSION(3,4) |
104 | #if ECB_GCC_VERSION(3,4) |
105 | #define ecb_ctz32 (x) __builtin_ctz (x) |
105 | #define ecb_ctz32 (x) __builtin_ctz (x) |
106 | #define ecb_popcount32 (x) __builtin_popcount (x) |
106 | #define ecb_popcount32 (x) __builtin_popcount (x) |
107 | #else |
107 | #else |
108 | ECB_HEADER_INLINE int ecb_ctz32 (uint32_t x) ecb_const; |
108 | ECB_HEADER_INLINE int ecb_ctz32 (uint32_t x) ecb_const; |
109 | ECB_HEADER_INLINE |
109 | ECB_HEADER_INLINE |
110 | ecb_ctz32 (uint32_t x) |
110 | ecb_ctz32 (uint32_t x) |
111 | { |
111 | { |
112 | int r = 0; |
112 | int r = 0; |
113 | |
113 | |