From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751782AbcEKLY3 (ORCPT ); Wed, 11 May 2016 07:24:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:59617 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbcEKLY2 (ORCPT ); Wed, 11 May 2016 07:24:28 -0400 Date: Wed, 11 May 2016 13:24:09 +0200 From: Peter Zijlstra To: Brian Gerst Cc: Borislav Petkov , "H. Peter Anvin" , x86-ml , Denys Vlasenko , LKML , Dmitry Vyukov , Andi Kleen , zengzhaoxiu@163.com, Thomas Gleixner , Ingo Molnar , Andrew Morton , Kees Cook , Zhaoxiu Zeng , Andy Lutomirski Subject: Re: [PATCH -v2] x86/hweight: Get rid of the special calling convention Message-ID: <20160511112409.GE3190@twins.programming.kicks-ass.net> References: <20160504202213.GF23257@pd.tnic> <572B446D.1030000@redhat.com> <20160505140446.GE534@pd.tnic> <20160510165318.GD28520@pd.tnic> <20160510172313.GA3192@twins.programming.kicks-ass.net> <8FE6169B-4F2E-4B7D-A271-14FEC245F663@zytor.com> <20160510191041.GI28520@pd.tnic> <20160511041128.GA2180@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2016 at 07:15:19AM -0400, Brian Gerst wrote: > I think he meant the out of line version would be asm, so you could > control what registers were clobbered. Yeah, it might save a few cycles on the call, but given that most machines should have popcnt these days is it worth the hassle/cost of duplicating the lib/hweight.c magic in asm (and remember, twice, once for 32bit and once for 64bit) ?