From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx2.suse.de", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id C5FD868A20 for ; Wed, 1 Feb 2006 20:07:19 +1100 (EST) From: Andi Kleen To: Akinobu Mita Subject: Re: [patch 14/44] generic hweight{64,32,16,8}() Date: Wed, 1 Feb 2006 10:06:07 +0100 References: <20060201090224.536581000@localhost.localdomain> <20060201090325.905071000@localhost.localdomain> In-Reply-To: <20060201090325.905071000@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <200602011006.09596.ak@suse.de> Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, Ian Molton , David Howells , linuxppc-dev@ozlabs.org, Greg Ungerer , sparclinux@vger.kernel.org, Miles Bader , Yoshinori Sato , Hirokazu Takata , linuxsh-dev@lists.sourceforge.net, Linus Torvalds , Ivan Kokshaysky , Richard Henderson , Chris Zankel , dev-etrax@axis.com, ultralinux@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, linuxsh-shmedia-dev@lists.sourceforge.net, linux390@de.ibm.com, Russell King , parisc-linux@parisc-linux.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wednesday 01 February 2006 10:02, Akinobu Mita wrote: > +static inline unsigned int hweight32(unsigned int w) > +{ > + unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); > + res = (res & 0x33333333) + ((res >> 2) & 0x33333333); > + res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); > + res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); > + return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); > +} How large are these functions on x86? Maybe it would be better to not inline them, but put it into some C file out of line. -Andi