35 #if defined(__clang__) 36 int flsll(
long long mask)
38 #if __has_builtin(__builtin_flsll) 39 return __builtin_flsll(mask);
40 #elif __has_builtin(__builtin_clzll) 48 return ((
int)
sizeof(mask) << 3) - __builtin_clzll((
unsigned long long)mask);
54 for(bit = 1; mask != 1; bit++)
55 mask = (
unsigned long long)mask >> 1;
60 #else // not __clang__ 71 return ((
int)
sizeof(mask) << 3) - __builtin_clzll((
unsigned long long)mask);
74 #endif // if __clang__
int flsll(long long mask)
Finds the last (most significant) bit set in the given mask.