diff options
Diffstat (limited to 'src/vppinfra/clib.h')
-rw-r--r-- | src/vppinfra/clib.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h index 7a8029a30bd..b8257bf1164 100644 --- a/src/vppinfra/clib.h +++ b/src/vppinfra/clib.h @@ -197,6 +197,15 @@ 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 @@ -237,15 +246,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) { word y = (word) 1 << min_log2 (x); |