10#ifndef __WSUTIL_BITS_COUNT_ONES_H__
11#define __WSUTIL_BITS_COUNT_ONES_H__
40ws_count_ones(
const uint64_t x)
44 bits = bits - ((bits >> 1) & UINT64_C(0x5555555555555555));
45 bits = (bits & UINT64_C(0x3333333333333333)) + ((bits >> 2) & UINT64_C(0x3333333333333333));
46 bits = (bits + (bits >> 4)) & UINT64_C(0x0F0F0F0F0F0F0F0F);
48 return (
int)((bits * UINT64_C(0x0101010101010101)) >> 56);