Re: [RFC PATCH] x86/hweight: Get rid of the special calling convention

From: Borislav Petkov
Date: Wed May 04 2016 - 16:22:22 EST


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:~#

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--