mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-23 00:07:07 +03:00
hweight32()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
57840fed19
commit
64ddfc9fc5
@ -137,6 +137,11 @@ static inline unsigned long hweight64(u64 w)
|
||||
__builtin_popcount(w >> 32);
|
||||
}
|
||||
|
||||
static inline unsigned long hweight32(u32 w)
|
||||
{
|
||||
return __builtin_popcount(w);
|
||||
}
|
||||
|
||||
static inline unsigned long hweight8(unsigned long w)
|
||||
{
|
||||
return __builtin_popcountl(w);
|
||||
|
Loading…
Reference in New Issue
Block a user