Util: Make clz consistent

This commit is contained in:
Jeffrey Pfau 2016-06-10 13:20:19 -07:00
parent 12928954ab
commit 6049c1b340
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,9 @@ static inline uint32_t popcount32(unsigned bits) {
static inline unsigned clz32(uint32_t bits) {
#if defined(__GNUC__) || __clang__
if (!bits) {
return 32;
}
return __builtin_clz(bits);
#else
static const int table[256] = {