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

From: H. Peter Anvin
Date: Tue May 10 2016 - 18:32:22 EST


On 05/10/16 12:10, Borislav Petkov wrote:
> On Tue, May 10, 2016 at 12:03:48PM -0700, H. Peter Anvin wrote:
>> Also, to be fair... if the problem is with these being in C then we
>> could just do it in assembly easily enough.
>
> I thought about converting the __sw_hweight* variants to asm but
> __sw_hweight32, for example, is 55 bytes here and that's a lot.
>
> Or do you have a better idea?
>
> peterz's sounds ok to me: we call a thunk which then calls __sw_hweight*
> after having saved regs properly - problem solved.
>

I didn't mean inline assembly.

-hpa