From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755512AbcEENCn (ORCPT ); Thu, 5 May 2016 09:02:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40398 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbcEENCl (ORCPT ); Thu, 5 May 2016 09:02:41 -0400 Message-ID: <572B446D.1030000@redhat.com> Date: Thu, 05 May 2016 15:02:37 +0200 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Borislav Petkov , "H. Peter Anvin" CC: Brian Gerst , LKML , Dmitry Vyukov , Andi Kleen , zengzhaoxiu@163.com, Thomas Gleixner , Ingo Molnar , Andrew Morton , Kees Cook , Zhaoxiu Zeng , Andy Lutomirski , Peter Zijlstra Subject: Re: [RFC PATCH] x86/hweight: Get rid of the special calling convention References: <57031D9D.801@gmail.com> <1459934085-7152-1-git-send-email-zengzhaoxiu@163.com> <87wpoay10o.fsf@tassilo.jf.intel.com> <20160407094333.GD3866@pd.tnic> <20160504184612.GC23257@pd.tnic> <5998407c-3497-22c1-45dc-a86afcb73c94@zytor.com> <20160504194101.GE23257@pd.tnic> <20160504202213.GF23257@pd.tnic> In-Reply-To: <20160504202213.GF23257@pd.tnic> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/04/2016 10:22 PM, Borislav Petkov wrote: > On Wed, May 04, 2016 at 12:49:17PM -0700, H. Peter Anvin wrote: >> Sigh. Doesn't look like -Wa is going to help due to the lack of the >> equivalent of an -include option in gas. > > So much for the register "freedom" - I'll resurrect the hardcoded insn > bytes. :-\ > > Unless my gcc friends have some other ideas... > > sarge:~# gcc --version > gcc (GCC) 3.3.5 (Debian 1:3.3.5-13) > Copyright (C) 2003 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > sarge:~# cat popcnt.c > int main(void) > { > int a, b; > > asm volatile("popcnt %0, %1" : "=r" (a) : "r" (b)); > > return 0; > } > sarge:~# gcc -Wall -o popcnt{,.c} > /tmp/ccHmmgjH.s: Assembler messages: > /tmp/ccHmmgjH.s:14: Error: no such instruction: `popcnt %eax,%eax' > sarge:~# You are looking at the version of a wrong program. gcc doesn't process assembly, it generates it. as is part of binutils, not gcc. "as --version".