use consistent wrappers around clz/ffs
This commit is contained in:
@@ -29,8 +29,18 @@
|
||||
#define STRINGIFY(s) #s
|
||||
#define ALIAS(f) __attribute__((alias(STRINGIFY(f))))
|
||||
|
||||
static inline int ffzl(unsigned long x) {
|
||||
return __builtin_ffsl(~x);
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef unsigned __int128 u128;
|
||||
|
||||
static inline int clz64(u64 x) {
|
||||
return __builtin_clzll(x);
|
||||
}
|
||||
|
||||
static inline int ffz64(u64 x) {
|
||||
return __builtin_ffsll(~x);
|
||||
}
|
||||
|
||||
static inline size_t align(size_t size, size_t align) {
|
||||
@@ -40,12 +50,6 @@ static inline size_t align(size_t size, size_t align) {
|
||||
|
||||
COLD noreturn void fatal_error(const char *s);
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef unsigned __int128 u128;
|
||||
|
||||
#define U64_WIDTH 64
|
||||
|
||||
#if CONFIG_SEAL_METADATA
|
||||
|
||||
Reference in New Issue
Block a user