Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964788AbWBAJIL (ORCPT ); Wed, 1 Feb 2006 04:08:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932420AbWBAJHf (ORCPT ); Wed, 1 Feb 2006 04:07:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:34716 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S932407AbWBAJHQ (ORCPT ); Wed, 1 Feb 2006 04:07:16 -0500 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 User-Agent: KMail/1.8.2 Cc: linux-kernel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Russell King , Ian Molton , dev-etrax@axis.com, David Howells , Yoshinori Sato , Linus Torvalds , linux-ia64@vger.kernel.org, Hirokazu Takata , linux-m68k@vger.kernel.org, Greg Ungerer , linux-mips@linux-mips.org, parisc-linux@parisc-linux.org, linuxppc-dev@ozlabs.org, linux390@de.ibm.com, linuxsh-dev@lists.sourceforge.net, linuxsh-shmedia-dev@lists.sourceforge.net, sparclinux@vger.kernel.org, ultralinux@vger.kernel.org, Miles Bader , Chris Zankel 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" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602011006.09596.ak@suse.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 836 Lines: 20 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/