35 #if defined(__clang__) 38 #if __has_builtin(__builtin_fls) 39 return __builtin_fls(mask);
40 #elif __has_builtin(__builtin_clz) 48 return ((
int)
sizeof(mask) << 3) - __builtin_clz((
unsigned)mask);
57 for(bit = 1; mask != 1; bit++)
59 mask = (unsigned)mask >> 1;
77 return ((
int)
sizeof(mask) << 3) - __builtin_clz((
unsigned)mask);
int fls(int mask)
Finds the last (most significant) bit set in the given mask.