Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1457994

Re: [PATCH] x86/hweight: Don't clobber %rdi

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/hweight: Don't clobber %rdi
Date 2016-08-08 21:00 +0200
Message-ID <s3XWh-55N-21@gated-at.bofh.it> (permalink)
References <s3WGR-4qo-25@gated-at.bofh.it> <s3X9U-4P8-21@gated-at.bofh.it> <s3Xtg-4VJ-17@gated-at.bofh.it> <s3XCW-4YT-11@gated-at.bofh.it> <s3XMC-52s-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.
--

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] x86/hweight: Don't clobber %rdi ville.syrjala@linux.intel.com - 2016-08-08 19:40 +0200
  Re: [PATCH] x86/hweight: Don't clobber %rdi Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-08 20:00 +0200
    Re: [PATCH] x86/hweight: Don't clobber %rdi Peter Zijlstra <peterz@infradead.org> - 2016-08-08 20:40 +0200
      Re: [PATCH] x86/hweight: Don't clobber %rdi Jiri Kosina <jikos@kernel.org> - 2016-08-08 21:00 +0200
        Re: [PATCH] x86/hweight: Don't clobber %rdi Borislav Petkov <bp@alien8.de> - 2016-08-08 21:40 +0200
  Re: [PATCH] x86/hweight: Don't clobber %rdi Borislav Petkov <bp@alien8.de> - 2016-08-08 20:10 +0200
    Re: [PATCH] x86/hweight: Don't clobber %rdi Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-08 20:30 +0200
      Re: [PATCH] x86/hweight: Don't clobber %rdi Borislav Petkov <bp@alien8.de> - 2016-08-08 20:40 +0200
        Re: [PATCH] x86/hweight: Don't clobber %rdi Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-08 20:50 +0200
          Re: [PATCH] x86/hweight: Don't clobber %rdi Borislav Petkov <bp@alien8.de> - 2016-08-08 21:00 +0200

csiph-web