[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 8 Aug 2016 20:55:09 +0200
From: Borislav Petkov <bp@...en8.de>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ville Syrjälä <ville.syrjala@...ux.intel.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>,
Borislav Petkov <bp@...e.de>,
"H . Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...capital.net>,
Brian Gerst <brgerst@...il.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Jiri Kosina <jkosina@...e.cz>
Subject: Re: [PATCH] x86/hweight: Don't clobber %rdi
On Mon, Aug 08, 2016 at 11:45:58AM -0700, Linus Torvalds wrote:
> That would work (although the clobbered registers have a different
> syntax than the in/out registers), but it would be wrong, in my
> opinion.
>
> We want the actual POPCNT instruction to be the common case, and that
> instruction does *not* clobber any other registers than the output.
Ok, that's a good point. We would be punishing the common case.
> So I think it's much better to just say: "the __sw_hweight functions
> should have the same semantics as popcnt" (although without the eflags
> rules that we don't care about).
>
> There's nothing wrong with keeping it as assembly language - it's not
> like it's a maintenance headache once it is written.
Yap, makes a whole lotta sense to me.
Thanks!
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
Powered by blists - more mailing lists