Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757157AbYCNWQn (ORCPT ); Fri, 14 Mar 2008 18:16:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751865AbYCNWQe (ORCPT ); Fri, 14 Mar 2008 18:16:34 -0400 Received: from one.firstfloor.org ([213.235.205.2]:49855 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbYCNWQd (ORCPT ); Fri, 14 Mar 2008 18:16:33 -0400 Date: Fri, 14 Mar 2008 23:18:45 +0100 From: Andi Kleen To: Alexander van Heukelum Cc: Andi Kleen , Jeremy Fitzhardinge , Alexander van Heukelum , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , LKML Subject: Re: [PATCH] x86: merge the simple bitops and move them to bitops.h Message-ID: <20080314221845.GX2522@one.firstfloor.org> References: <20080312200128.GA24983@mailshack.com> <47DABEFB.3050704@goop.org> <1205523826.7441.1242464129@webmail.messagingengine.com> <20080314195520.GV2522@one.firstfloor.org> <1205530409.27413.1242484373@webmail.messagingengine.com> <20080314214205.GW2522@one.firstfloor.org> <1205532078.32744.1242485965@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1205532078.32744.1242485965@webmail.messagingengine.com> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 965 Lines: 31 > #else > static inline int fls64(__u64 x) > { > if (x == 0) > return 0; > return __fls(x) + 1; That would require a polymorphic macro __fls that adapts to 32bit and 64bit arguments. Not good C style. > This is the only reason that this define exists. With another > name it would be fine. HWEIGHT_USE_MULTIPLIER? AFAIK it only exists because some ancient sparc chips had incredibly slow multipliers. > And my feeling is that this is exactly the reason why this is > not a good version for a generic implementation in bitops.h. But > I don't care much. I bet most different approaches who might be slightly faster for larger bit strings would make the one bit case slower. -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/