Release 4.7 arch/x86/include/asm/arch_hweight.h
#ifndef _ASM_X86_HWEIGHT_H
#define _ASM_X86_HWEIGHT_H
#include <asm/cpufeatures.h>
#ifdef CONFIG_64BIT
/* popcnt %edi, %eax -- redundant REX prefix for alignment */
#define POPCNT32 ".byte 0xf3,0x40,0x0f,0xb8,0xc7"
/* popcnt %rdi, %rax */
#define POPCNT64 ".byte 0xf3,0x48,0x0f,0xb8,0xc7"
#define REG_IN "D"
#define REG_OUT "a"
#else
/* popcnt %eax, %eax */
#define POPCNT32 ".byte 0xf3,0x0f,0xb8,0xc0"
#define REG_IN "a"
#define REG_OUT "a"
#endif
/*
* __sw_hweightXX are called from within the alternatives below
* and callee-clobbered registers need to be taken care of. See
* ARCH_HWEIGHT_CFLAGS in <arch/x86/Kconfig> for the respective
* compiler switches.
*/
static __always_inline unsigned int __arch_hweight32(unsigned int w)
{
unsigned int res = 0;
asm (ALTERNATIVE("call __sw_hweight32", POPCNT32, X86_FEATURE_POPCNT)
: "="REG_OUT (res)
: REG_IN (w));
return res;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| borislav petkov | borislav petkov | 20 | 90.91% | 1 | 33.33% |
| h. peter anvin | h. peter anvin | 1 | 4.55% | 1 | 33.33% |
| denys vlasenko | denys vlasenko | 1 | 4.55% | 1 | 33.33% |
| Total | 22 | 100.00% | 3 | 100.00% |
static inline unsigned int __arch_hweight16(unsigned int w)
{
return __arch_hweight32(w & 0xffff);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| borislav petkov | borislav petkov | 20 | 100.00% | 1 | 100.00% |
| Total | 20 | 100.00% | 1 | 100.00% |
static inline unsigned int __arch_hweight8(unsigned int w)
{
return __arch_hweight32(w & 0xff);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| borislav petkov | borislav petkov | 20 | 100.00% | 1 | 100.00% |
| Total | 20 | 100.00% | 1 | 100.00% |
#ifdef CONFIG_X86_32
static inline unsigned long __arch_hweight64(__u64 w)
{
return __arch_hweight32((u32)w) +
__arch_hweight32((u32)(w >> 32));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| borislav petkov | borislav petkov | 31 | 96.88% | 1 | 50.00% |
| denys vlasenko | denys vlasenko | 1 | 3.12% | 1 | 50.00% |
| Total | 32 | 100.00% | 2 | 100.00% |
#else
static __always_inline unsigned long __arch_hweight64(__u64 w)
{
unsigned long res = 0;
asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT)
: "="REG_OUT (res)
: REG_IN (w));
return res;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| denys vlasenko | denys vlasenko | 16 | 76.19% | 1 | 33.33% |
| borislav petkov | borislav petkov | 4 | 19.05% | 1 | 33.33% |
| h. peter anvin | h. peter anvin | 1 | 4.76% | 1 | 33.33% |
| Total | 21 | 100.00% | 3 | 100.00% |
#endif /* CONFIG_X86_32 */
#endif
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| borislav petkov | borislav petkov | 140 | 80.92% | 2 | 50.00% |
| denys vlasenko | denys vlasenko | 24 | 13.87% | 1 | 25.00% |
| h. peter anvin | h. peter anvin | 9 | 5.20% | 1 | 25.00% |
| Total | 173 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.