diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2010-03-05 17:34:46 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-04-06 15:52:11 -0700 |
commit | d61931d89be506372d01a90d1755f6d0a9fafe2d (patch) | |
tree | 652c34238edcb6c558163abc3cd9d6ce7c5f91a5 /arch/x86/Kconfig | |
parent | 1527bc8b928dd1399c3d3467dd47d9ede210978a (diff) | |
download | talos-obmc-linux-d61931d89be506372d01a90d1755f6d0a9fafe2d.tar.gz talos-obmc-linux-d61931d89be506372d01a90d1755f6d0a9fafe2d.zip |
x86: Add optimized popcnt variants
Add support for the hardware version of the Hamming weight function,
popcnt, present in CPUs which advertize it under CPUID, Function
0x0000_0001_ECX[23]. On CPUs which don't support it, we fallback to the
default lib/hweight.c sw versions.
A synthetic benchmark comparing popcnt with __sw_hweight64 showed almost
a 3x speedup on a F10h machine.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
LKML-Reference: <20100318112015.GC11152@aftab>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/Kconfig')
-rw-r--r-- | arch/x86/Kconfig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0eacb1ffb421..89d8c54cdd37 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -238,6 +238,11 @@ config X86_32_LAZY_GS def_bool y depends on X86_32 && !CC_STACKPROTECTOR +config ARCH_HWEIGHT_CFLAGS + string + default "-fcall-saved-ecx -fcall-saved-edx" if X86_32 + default "-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" if X86_64 + config KTIME_SCALAR def_bool X86_32 source "init/Kconfig" |