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>
Showing
- arch/alpha/include/asm/bitops.h 10 additions, 8 deletionsarch/alpha/include/asm/bitops.h
- arch/ia64/include/asm/bitops.h 6 additions, 5 deletionsarch/ia64/include/asm/bitops.h
- arch/sparc/include/asm/bitops_64.h 6 additions, 5 deletionsarch/sparc/include/asm/bitops_64.h
- include/asm-generic/bitops/arch_hweight.h 11 additions, 0 deletionsinclude/asm-generic/bitops/arch_hweight.h
- include/asm-generic/bitops/const_hweight.h 42 additions, 0 deletionsinclude/asm-generic/bitops/const_hweight.h
- include/asm-generic/bitops/hweight.h 2 additions, 6 deletionsinclude/asm-generic/bitops/hweight.h
- include/linux/bitops.h 0 additions, 25 deletionsinclude/linux/bitops.h
- lib/hweight.c 10 additions, 9 deletionslib/hweight.c
include/asm-generic/bitops/arch_hweight.h
0 → 100644
include/asm-generic/bitops/const_hweight.h
0 → 100644
Please register or sign in to comment