All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/current: Provide additional information to optimise get_cpu_info()
Date: Mon, 01 Sep 2014 12:24:55 +0100	[thread overview]
Message-ID: <540473A7020000780002F6C2@mail.emea.novell.com> (raw)
In-Reply-To: <1409569130-19066-1-git-send-email-andrew.cooper3@citrix.com>

>>> On 01.09.14 at 12:58, <andrew.cooper3@citrix.com> wrote:
> Exactly as with c/s d55c5eefe "x86: use compiler visible "add" instead of
> inline assembly "or" in get_cpu_info()", this is achieved by providing more
> information to the compiler.
> 
> With this modification, gcc replaces the older:
>     mov imm, %reg
>     and %rsp, %reg
> 
> with:
>     mov %rsp, %reg
>     and imm, %reg
> 
> which is one byte shorter.

I'm in no way opposed to the change, but is that really true? Afaict
it can be 1 byte shorter only when %rax gets selected as the register
here.

>  It also considers all general purpose registers
> for %reg rather than just the legacy ones (i.e. will now use %r12 etc), 
> which
> allows for better register scheduling in larger functions.

Same here - why would with the old code not all registers be
available for selection by the compiler?

Jan

  reply	other threads:[~2014-09-01 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 10:58 [PATCH] x86/current: Provide additional information to optimise get_cpu_info() Andrew Cooper
2014-09-01 11:24 ` Jan Beulich [this message]
2014-09-01 12:18   ` Andrew Cooper
2014-09-01 12:32     ` Jan Beulich
2014-09-01 15:27       ` [PATCH v2] " Andrew Cooper
2014-09-13 16:10         ` Marcin Cieslak
2014-09-15  8:16           ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540473A7020000780002F6C2@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.