Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2011 23:19:14 +0200
From:      Stefan Bethke <stb@lassitu.de>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, current@FreeBSD.org
Subject:   Re: bitcount32: replace lengthy comment with SWAR reference
Message-ID:  <4A9DD4AC-94CF-4AA5-AB17-8597CB6EB394@lassitu.de>
In-Reply-To: <4DC5B2A4.60603@FreeBSD.org>
References:  <4DC517B3.8050502@FreeBSD.org> <20110507104748.GL48734@deviant.kiev.zoral.com.ua> <AEBDC7CF-CB63-41E7-8F1A-33DC0A6F7C8F@lassitu.de> <4DC5B2A4.60603@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 07.05.2011 um 22:59 schrieb Andriy Gapon:

> on 07/05/2011 23:22 Stefan Bethke said the following:
>>=20
>> Am 07.05.2011 um 12:47 schrieb Kostik Belousov:
>>=20
>>> On Sat, May 07, 2011 at 12:58:11PM +0300, Andriy Gapon wrote:
>>>>=20
>>>> I think that the SWAR reference should be more concise and should =
lead an
>>>> interested reader to more information on the topic (and more =
up-to-date as well).
>>>>=20
>>> SWAR acronim seems to be a wikipedia invention. Without the =
abbreviation,
>>> the trimmed down comment looks better, IMHO.
>>=20
>> How about a proper reference, for example Warren's Hackers Delight =
(p. 65)?
>=20
> Hm, what makes that reference proper or more (most) proper?
> My top google results for SWAR seem to point to materials created by =
inventors
> of the algorithm.

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.

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.


Stefan=20

--=20
Stefan Bethke <stb@lassitu.de>   Fon +49 151 14070811






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A9DD4AC-94CF-4AA5-AB17-8597CB6EB394>