Re: [PATCH -v2] x86/hweight: Get rid of the special calling convention
From: Brian Gerst
Date: Wed May 11 2016 - 07:15:25 EST
On Wed, May 11, 2016 at 12:11 AM, Borislav Petkov <bp@xxxxxxx> wrote:
> On Tue, May 10, 2016 at 03:30:48PM -0700, H. Peter Anvin wrote:
>> I didn't mean inline assembly.
>
> How does that matter?
>
> The problem is having as less insn bytes as possible and the minimal
> size we can do is issuing POPCNT everywhere which is 4 or 5 bytes. The
> alternatives then replace that with a CALL which is also 5 bytes.
>
> The way I did it now, it adds 22K more to allyesconfig vmlinux due to
> the static_cpu_has doubled alternatives sections and the JMPs. The
> thunks will keep those 5 bytes *and* get rid of the calling convention
> without the growth.
>
> Or?
I think he meant the out of line version would be asm, so you could
control what registers were clobbered.
--
Brian Gerst