1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Bitops: bitflip function

to flip order of bits in 32b numbers
This commit is contained in:
Maria Matejka
2024-03-12 21:08:29 +01:00
parent 27f2fd4aa9
commit b6853989ac
3 changed files with 46 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ uint u32_masklen(u32 x);
u32 u32_log2(u32 v);
u32 u32_bitflip(u32 n);
static inline u32 u32_hash(u32 v) { return v * 2902958171u; }
static inline u8 u32_popcount(u32 v) { return __builtin_popcount(v); }