From owner-cvs-src@FreeBSD.ORG Sat Aug 20 06:58:45 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D58B16A41F; Sat, 20 Aug 2005 06:58:45 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 705A343D45; Sat, 20 Aug 2005 06:58:44 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j7K6wgxG017530; Sat, 20 Aug 2005 16:58:42 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j7K6we9u024183; Sat, 20 Aug 2005 16:58:41 +1000 Date: Sat, 20 Aug 2005 16:58:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <200508192210.j7JMAJw0076274@repoman.freebsd.org> Message-ID: <20050820162042.W60498@delplex.bde.org> References: <200508192210.j7JMAJw0076274@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys systm.h src/sys/i386/i386 mp_machdep.c src/sys/amd64/amd64 mp_machdep.c src/sys/geom/stripe g_stripe.c g_stripe.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: Sat, 20 Aug 2005 06:58:45 -0000 On Fri, 19 Aug 2005, Pawel Jakub Dawidek wrote: > pjd 2005-08-19 22:10:19 UTC > > FreeBSD src repository > > Modified files: > sys/sys systm.h > sys/i386/i386 mp_machdep.c > sys/amd64/amd64 mp_machdep.c > sys/geom/stripe g_stripe.c g_stripe.h > Log: > Avoid code duplication and implement bitcount32() function in systm.h only. > > Reviewed by: cperciva > MFC after: 3 days > > Revision Changes Path > 1.262 +1 -53 src/sys/amd64/amd64/mp_machdep.c > 1.27 +1 -1 src/sys/geom/stripe/g_stripe.c > 1.8 +0 -6 src/sys/geom/stripe/g_stripe.h > 1.253 +1 -53 src/sys/i386/i386/mp_machdep.c > 1.235 +52 -0 src/sys/sys/systm.h Kernel library inline functions go in libkern.h. Kernel library functions that are too large to be inline go in libkern. The comment in this one wonders if it should be in libkern. I think it is too large to be inline if its efficiency is unimportant and not as efficient as it should be if its efficiency is important. I get the following times for popcount() of the first 10^8 integers (everything cached) on an AthlonXP 2600 overclocked (-O2 -march=athlon-xp): inline popcount: 0.68 seconds static popcount: 1.03 inline popcount1: 0.71 static popcount1: 1.08 inline table[256] lookup: 0.29 with table of u_ints static table[256] lookup: 0.63 inline table[16] lookup: 0.63 static table[16] lookup: 1.08 inline table[256] lookup: 0.40 with table of u_chars static table[256] lookup: 0.67 Bruce