… | |
… | |
377 | /* for compatibility to the rest of the world */ |
377 | /* for compatibility to the rest of the world */ |
378 | #define ecb_likely(expr) ecb_expect_true (expr) |
378 | #define ecb_likely(expr) ecb_expect_true (expr) |
379 | #define ecb_unlikely(expr) ecb_expect_false (expr) |
379 | #define ecb_unlikely(expr) ecb_expect_false (expr) |
380 | |
380 | |
381 | /* count trailing zero bits and count # of one bits */ |
381 | /* count trailing zero bits and count # of one bits */ |
|
|
382 | #if ECB_GCC_VERSION(3,4) \ |
382 | #if ECB_GCC_VERSION(3,4) || (ECB_CLANG_BUILTIN(__builtin_clz) && ECB_CLANG_BUILTIN(__builtin_clzll) \ |
383 | || (ECB_CLANG_BUILTIN(__builtin_clz) && ECB_CLANG_BUILTIN(__builtin_clzll) \ |
383 | && ECB_CLANG_BUILTIN(__builtin_ctz) && ECB_CLANG_BUILTIN(__builtin_ctzll) \ |
384 | && ECB_CLANG_BUILTIN(__builtin_ctz) && ECB_CLANG_BUILTIN(__builtin_ctzll) \ |
384 | && ECB_CLANG_BUILTIN(__builtin_popcount)) |
385 | && ECB_CLANG_BUILTIN(__builtin_popcount)) |
385 | /* we assume int == 32 bit, long == 32 or 64 bit and long long == 64 bit */ |
386 | /* we assume int == 32 bit, long == 32 or 64 bit and long long == 64 bit */ |
386 | #define ecb_ld32(x) (__builtin_clz (x) ^ 31) |
387 | #define ecb_ld32(x) (__builtin_clz (x) ^ 31) |
387 | #define ecb_ld64(x) (__builtin_clzll (x) ^ 63) |
388 | #define ecb_ld64(x) (__builtin_clzll (x) ^ 63) |
388 | #define ecb_ctz32(x) __builtin_ctz (x) |
389 | #define ecb_ctz32(x) __builtin_ctz (x) |
389 | #define ecb_ctz64(x) __builtin_ctzll (x) |
390 | #define ecb_ctz64(x) __builtin_ctzll (x) |