/*
* Return the number of bits set in a unsigned int
*/
int
_shr_popcount(unsigned int n)
{
n = (n & 0x55555555) + ((n >> 1) & 0x55555555);
n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
n = (n + (n >> 4)) & 0x0f0f0f0f;
n = n + (n >> 8);
return (n + (n >> 16)) & 0xff;
}
1 统计bit置位数/* * Return the number of bits set in a unsigned int */int_shr_popcount(unsigned int n){ n = (n & 0x55555555) + ((n >> 1) & 0x55555555); n = (n & 0x33333333) + ((n >> 2) & 0x33333333); n = (n + (n &g