From owner-cvs-src@FreeBSD.ORG Wed Feb 14 12:49:38 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4115216A400 for ; Wed, 14 Feb 2007 12:49:38 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from shell.asta.uni-rostock.de (gateway.stura.uni-rostock.de [139.30.252.67]) by mx1.freebsd.org (Postfix) with ESMTP id 0331213C441 for ; Wed, 14 Feb 2007 12:49:37 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (unknown [192.168.16.3]) by shell.asta.uni-rostock.de (Postfix) with ESMTP id 16C87187E for ; Wed, 14 Feb 2007 12:25:44 +0000 (GMT) Received: by britannica.bec.de (Postfix, from userid 1000) id E06A5B71E; Wed, 14 Feb 2007 13:25:41 +0100 (CET) Date: Wed, 14 Feb 2007 13:25:41 +0100 From: Joerg Sonnenberger To: cvs-src@freebsd.org Message-ID: <20070214122541.GA193@britannica.bec.de> References: <200702140521.l1E5LNQr044119@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200702140521.l1E5LNQr044119@repoman.freebsd.org> User-Agent: Mutt/1.5.13 (2006-08-11) Subject: Re: cvs commit: src/sys/sys systm.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2007 12:49:38 -0000 On Wed, Feb 14, 2007 at 05:21:23AM +0000, Colin Percival wrote: > Log: > Optimize bitcount32 by replacing 6 logical operations with 2. The key > observation here is that it doesn't matter what garbage accumulates in > bits which we're going to end up masking away anyway, as long as the > garbage doesn't overflow into bits which we care about. Three notes: - The version I found uses 0x3f in the last mask. - You might want to use __builtin_popcount for those GCC versions, which support it. - I found the table version to be faster on Intel, at least in the hot case. Joerg