]> git.baikalelectronics.ru Git - kernel.git/commit
bitops: Optimize hweight() by making use of compile-time evaluation
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Mon, 1 Feb 2010 14:03:07 +0000 (15:03 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 6 Apr 2010 22:52:11 +0000 (15:52 -0700)
commit2a1f3e57f1156c5fbbcf4fcb9dc33a62d27f5e5e
treefb391da915bdae9f933b8170ff61aa43c85ef9ae
parent5b3d7fdf8ddb95b8b0afc5251080f64c8e6f9708
bitops: Optimize hweight() by making use of compile-time evaluation

Rename the extisting runtime hweight() implementations to
__arch_hweight(), rename the compile-time versions to __const_hweight()
and then have hweight() pick between them.

Suggested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100318111929.GB11152@aftab>
Acked-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <1265028224.24455.154.camel@laptop>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/alpha/include/asm/bitops.h
arch/ia64/include/asm/bitops.h
arch/sparc/include/asm/bitops_64.h
include/asm-generic/bitops/arch_hweight.h [new file with mode: 0644]
include/asm-generic/bitops/const_hweight.h [new file with mode: 0644]
include/asm-generic/bitops/hweight.h
include/linux/bitops.h
lib/hweight.c