From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH 2/5] bitops: compile time optimization for hweight_long(CONSTANT) Date: Thu, 18 Feb 2010 12:51:55 +0100 Message-ID: <20100218115155.GA20473@aftab> References: <4B6FDAED.9060204@zytor.com> <20100208095945.GA14740@a1.tnic> <20100211172424.GB19779@aftab> <4B743F7D.3090605@zytor.com> <20100212170649.GC3114@aftab> <4B758FC0.1020600@zytor.com> <20100212174751.GD3114@aftab> <4B75A66A.70005@zytor.com> <4B7BF5D6.3030701@suse.cz> <1266490310.26719.185.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Michal Marek , "H. Peter Anvin" , linux-kbuild , Borislav Petkov , Andrew Morton , Wu Fengguang , LKML , Jamie Lokier , Roland Dreier , Al Viro , "linux-fsdevel@vger.kernel.org" , Ingo Molnar , Brian Gerst To: Peter Zijlstra Return-path: Received: from s15228384.onlinehome-server.info ([87.106.30.177]:53050 "EHLO mail.x86-64.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757996Ab0BRLvz (ORCPT ); Thu, 18 Feb 2010 06:51:55 -0500 Content-Disposition: inline In-Reply-To: <1266490310.26719.185.camel@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Feb 18, 2010 at 11:51:50AM +0100, Peter Zijlstra wrote: > I guess one way to achieve that is to create a arch/x86/lib/hweight.c > that includes lib/hweight.c and give the x86 one special compile flags > and not build the lib on. That's what I thought initially too but that won't fly because the lib/hweight.c helpers have to be inlined into arch/x86/lib/hweight.c so that gcc can take care of the clobbered registers. Otherwise, it just a "call __sw_hweightXX" that gets issued into asm. -- Regards/Gruss, Boris. - Advanced Micro Devices, Inc. Operating Systems Research Center