Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933261Ab0BDQE4 (ORCPT ); Thu, 4 Feb 2010 11:04:56 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:60987 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932935Ab0BDQEz (ORCPT ); Thu, 4 Feb 2010 11:04:55 -0500 Subject: Re: [PATCH 2/5] bitops: compile time optimization for hweight_long(CONSTANT) From: Peter Zijlstra To: Borislav Petkov Cc: "H. Peter Anvin" , Andrew Morton , Wu Fengguang , LKML , Jamie Lokier , Roland Dreier , Al Viro , "linux-fsdevel@vger.kernel.org" , Ingo Molnar In-Reply-To: <20100204155419.GD32711@aftab> References: <20100201124825.cc024f2a.akpm@linux-foundation.org> <20100203133951.GA24357@localhost> <20100203070825.e36b3932.akpm@linux-foundation.org> <1265210157.24455.646.camel@laptop> <20100203074251.e2caa3f3.akpm@linux-foundation.org> <20100203181425.GB1367@aftab> <1265222875.24455.1020.camel@laptop> <4B69D362.10608@zytor.com> <20100204151050.GC32711@aftab> <1265296432.22001.18.camel@laptop> <20100204155419.GD32711@aftab> Content-Type: text/plain; charset="UTF-8" Date: Thu, 04 Feb 2010 17:04:17 +0100 Message-ID: <1265299457.22001.72.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 27 On Thu, 2010-02-04 at 16:54 +0100, Borislav Petkov wrote: > On Thu, Feb 04, 2010 at 04:13:52PM +0100, Peter Zijlstra wrote: > > hweight_long() isn't an arch primitive, only __arch_hweight{8,16,32,64} > > are. > > Yeah, I'm still looking for the proper location. hweight_long() is the > generic version so do we want to do the > > #ifndef __HAVE_ARCH_POPCNT > static inline unsigned long hweight_long(unsigned long w) > .... > > #endif > > thing and define a x86-specific version? No, just don't touch hweight_long(), simply provide __arch_hweight{8,16,32,64} and all will be well. hweight_long() is provided by and is constructed from height32() and hweight64() depending on the actual word size. -- 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/