]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: improve the popcount() operation
authorWilly Tarreau <w@1wt.eu>
Sat, 2 Feb 2019 19:17:31 +0000 (20:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Feb 2019 04:09:15 +0000 (05:09 +0100)
commitcafa56ecd6d1a2d15e7c47d5ebbdb82d7be3f689
tree2ee5124877a2a66fac670c0933ba337fafb433eb
parent4ed84c96cf1f523f56cb869e1b98afa376139920
MINOR: tools: improve the popcount() operation

We'll call popcount() more often so better use a parallel method
than an iterative one. One optimal design is proposed at the site
below. It requires a fast multiplication though, but even without
it will still be faster than the iterative one, and all relevant
64 bit platforms do have a multiply unit.

     https://graphics.stanford.edu/~seander/bithacks.html
include/common/standard.h