diff --git a/utils/src/util.h b/utils/src/util.h index b54fd147..d7fa787e 100644 --- a/utils/src/util.h +++ b/utils/src/util.h @@ -4,6 +4,7 @@ #include #include #include +#include /* * Generate build warnings if the condition is false but generate no @@ -79,6 +80,11 @@ do { \ (_x == 0 ? 0 : 64 - __builtin_clzll(_x)); \ }) +#define ilog2(x) \ +({ \ + ((unsigned long)log2l((long double)x)); \ +}) + /* * return -1,0,+1 based on the memcmp comparison of the minimum of their * two lengths. If their min shared bytes are equal but the lengths