]> xenbits.xensource.com Git - xen.git/commit
bitops: speed up hweight<N>()
authorJan Beulich <jbeulich@suse.com>
Mon, 3 Jun 2019 15:20:13 +0000 (17:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 Jun 2019 15:20:13 +0000 (17:20 +0200)
commitaad7bdae14676f07d6e7fec70941c72078d01562
tree52b1e152801a0b78d84160e0133998291e13f70e
parent570a1047f06cab13bea041d22c5885a96d27e90b
bitops: speed up hweight<N>()

Algorithmically this gets us in line with current Linux, where the same
change did happen about 13 years ago. See in particular Linux commits
f9b4192923 ("bitops: hweight() speedup") and 0136611c62 ("optimize
hweight64 for x86_64").

Kconfig changes for actually setting HAVE_FAST_MULTIPLY will follow.

Take the opportunity and change generic_hweight64()'s return type to
unsigned int.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/Kconfig
xen/include/xen/bitops.h