bitcount32: replace lengthy comment with SWAR reference

Andriy Gapon avg at FreeBSD.org
Sun May 8 08:57:25 UTC 2011


on 08/05/2011 00:19 Stefan Bethke said the following:
> Your google-fu is clearly superior.  It took me a couple tries to find the
> page you're refering to.
> 
> http://aggregate.org/MAGIC/#Population%20Count%20%28Ones%20Count%29
> 
> Why not put a link in there directly?  I just prefer a reference I can
> actually look up over an acronym that (by itself) cannot easily be resolved.

Well, picking color for a bikeshed is never easy :-)
What you say makes a lot of sense and I don't disagree.
But I am sticking with the originally proposed color as I believe that in this
age of Internet and search engines a descriptive term is better than an URL that
may change or a reference to a book that may not be readily available to a reader.

> The algorithm itself seems to predate SWAR significantly: according to
> Hackers Delight, it was described in /Combinatorial Algorithms: Theory and
> Pratice/ in 77.
> 
> The code in systm.h appears to be a slightly less optimized version of the
> algorithm presented in SWAR or Hacker's Delight.

-- 
Andriy Gapon


More information about the freebsd-current mailing list