// SPDX-License-Identifier: GPL-2.0 #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. */ #ifndef __HAVE_ARCH_SW_HWEIGHT
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 | 137 | 98.56% | 3 | 60.00% |
Borislav Petkov | 1 | 0.72% | 1 | 20.00% |
Linus Torvalds | 1 | 0.72% | 1 | 20.00% |
Total | 139 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 70 | 98.59% | 2 | 66.67% |
Borislav Petkov | 1 | 1.41% | 1 | 33.33% |
Total | 71 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 56 | 98.25% | 2 | 66.67% |
Borislav Petkov | 1 | 1.75% | 1 | 33.33% |
Total | 57 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 121 | 66.48% | 2 | 40.00% |
Andi Kleen | 57 | 31.32% | 1 | 20.00% |
Borislav Petkov | 3 | 1.65% | 1 | 20.00% |
Linus Torvalds | 1 | 0.55% | 1 | 20.00% |
Total | 182 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 405 | 82.65% | 3 | 30.00% |
Andi Kleen | 59 | 12.04% | 1 | 10.00% |
Borislav Petkov | 20 | 4.08% | 2 | 20.00% |
Linus Torvalds | 2 | 0.41% | 1 | 10.00% |
Jiri Slaby | 2 | 0.41% | 1 | 10.00% |
Greg Kroah-Hartman | 1 | 0.20% | 1 | 10.00% |
Paul Gortmaker | 1 | 0.20% | 1 | 10.00% |
Total | 490 | 100.00% | 10 | 100.00% |