#include <linux/export.h> #include <linux/bitops.h> #include <asm/types.h> /** * hweightN - returns the hamming weight of a N-bit word * @x: the word to weigh * * The Hamming Weight of a number is the total number of bits set in it. */
unsigned int __sw_hweight32(unsigned int w) { #ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER w -= (w >> 1) & 0x55555555; w = (w & 0x33333333) + ((w >> 2) & 0x33333333); w = (w + (w >> 4)) & 0x0f0f0f0f; return (w * 0x01010101) >> 24; #else unsigned int res = w - ((w >> 1) & 0x55555555); res = (res & 0x33333333) + ((res >> 2) & 0x33333333); res = (res + (res >> 4)) & 0x0F0F0F0F; res = res + (res >> 8); return (res + (res >> 16)) & 0x000000FF; #endif }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
akinobu mita | akinobu mita | 137 | 98.56% | 3 | 60.00% |
borislav petkov | borislav petkov | 1 | 0.72% | 1 | 20.00% |
linus torvalds | linus torvalds | 1 | 0.72% | 1 | 20.00% |
Total | 139 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
akinobu mita | akinobu mita | 70 | 98.59% | 2 | 66.67% |
borislav petkov | borislav petkov | 1 | 1.41% | 1 | 33.33% |
Total | 71 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
akinobu mita | akinobu mita | 56 | 98.25% | 2 | 66.67% |
borislav petkov | borislav petkov | 1 | 1.75% | 1 | 33.33% |
Total | 57 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
akinobu mita | akinobu mita | 121 | 66.48% | 2 | 40.00% |
andi kleen | andi kleen | 57 | 31.32% | 1 | 20.00% |
borislav petkov | borislav petkov | 3 | 1.65% | 1 | 20.00% |
linus torvalds | linus torvalds | 1 | 0.55% | 1 | 20.00% |
Total | 182 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
akinobu mita | akinobu mita | 405 | 84.55% | 3 | 37.50% |
andi kleen | andi kleen | 59 | 12.32% | 1 | 12.50% |
borislav petkov | borislav petkov | 10 | 2.09% | 1 | 12.50% |
jiri slaby | jiri slaby | 2 | 0.42% | 1 | 12.50% |
linus torvalds | linus torvalds | 2 | 0.42% | 1 | 12.50% |
paul gortmaker | paul gortmaker | 1 | 0.21% | 1 | 12.50% |
Total | 479 | 100.00% | 8 | 100.00% |