From owner-freebsd-current@FreeBSD.ORG Sat May 7 21:19:17 2011 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F553106566C; Sat, 7 May 2011 21:19:17 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 345B68FC13; Sat, 7 May 2011 21:19:17 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 0620C4101F; Sat, 7 May 2011 23:19:15 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Stefan Bethke In-Reply-To: <4DC5B2A4.60603@FreeBSD.org> Date: Sat, 7 May 2011 23:19:14 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4A9DD4AC-94CF-4AA5-AB17-8597CB6EB394@lassitu.de> References: <4DC517B3.8050502@FreeBSD.org> <20110507104748.GL48734@deviant.kiev.zoral.com.ua> <4DC5B2A4.60603@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1084) Cc: Kostik Belousov , current@FreeBSD.org Subject: Re: bitcount32: replace lengthy comment with SWAR reference X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 21:19:17 -0000 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 Fon +49 151 14070811