vppinfra: refactor uword bitmaps
[vpp.git] / src / vppinfra / clib.h
index 7a8029a..b8257bf 100644 (file)
   decl __attribute ((destructor));             \
   decl
 
+always_inline uword
+pow2_mask (uword x)
+{
+#ifdef __BMI2__
+  return _bzhi_u64 (-1ULL, x);
+#endif
+  return ((uword) 1 << x) - (uword) 1;
+}
+
 #include <vppinfra/bitops.h>
 
 always_inline uword
@@ -236,15 +245,6 @@ min_log2_u64 (u64 x)
     }
 }
 
-always_inline uword
-pow2_mask (uword x)
-{
-#ifdef __BMI2__
-  return _bzhi_u64 (-1ULL, x);
-#endif
-  return ((uword) 1 << x) - (uword) 1;
-}
-
 always_inline uword
 max_pow2 (uword x)
 {