summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-05-18 00:13:23 +0200
committerH. Peter Anvin <hpa@linux.intel.com>2010-05-18 00:17:16 +0200
commitc59bd5688299cddb71183e156e7a3c1409b90df2 (patch)
treed7b99407367b30aa7766219083ad0262c8edbab8 /arch/sparc
parentarch, hweight: Fix compilation errors (diff)
downloadlinux-c59bd5688299cddb71183e156e7a3c1409b90df2.tar.xz
linux-c59bd5688299cddb71183e156e7a3c1409b90df2.zip
x86, hweight: Use a 32-bit popcnt for __arch_hweight32()
Use a 32-bit popcnt instruction for __arch_hweight32(), even on x86-64. Even though the input register will *usually* be zero-extended due to the standard operation of the hardware, it isn't necessarily so if the input value was the result of truncating a 64-bit operation. Note: the POPCNT32 variant used on x86-64 has a technically unnecessary REX prefix to make it five bytes long, the same as a CALL instruction, therefore avoiding an unnecessary NOP. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Borislav Petkov <borislav.petkov@amd.com> LKML-Reference: <alpine.LFD.2.00.1005171443060.4195@i5.linux-foundation.org>
Diffstat (limited to 'arch/sparc')
0 files changed, 0 insertions, 0 deletions