From: H. Peter Anvin Date: Mon, 17 May 2010 22:13:23 +0000 (-0700) Subject: x86, hweight: Use a 32-bit popcnt for __arch_hweight32() X-Git-Tag: v2.6.35-rc1~512^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c59bd5688299cddb71183e156e7a3c1409b90df2;p=pandora-kernel.git 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 Signed-off-by: H. Peter Anvin Cc: Borislav Petkov LKML-Reference: --- Reading git-diff-tree failed