xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 4/4] x86/memcpy: Reduce code size
Date: Tue, 2 Jun 2015 15:04:27 +0100	[thread overview]
Message-ID: <1433253867-29752-5-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1433253867-29752-1-git-send-email-andrew.cooper3@citrix.com>

'n % BYTES_PER_LONG' is at most 7, and doesn't need a 64bit register mov.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>

---
Admittedly very trivial, but no need to be wasteful
---
 xen/arch/x86/string.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index 3af0ea8..043ae66 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -15,7 +15,7 @@ void *memcpy(void *dest, const void *src, size_t n)
 
     asm volatile (
         "   rep ; movs"__OS" ; "
-        "   mov %4,%3        ; "
+        "   mov %k4,%k3      ; "
         "   rep ; movsb        "
         : "=&c" (d0), "=&D" (d1), "=&S" (d2)
         : "0" (n/BYTES_PER_LONG), "r" (n%BYTES_PER_LONG), "1" (dest), "2" (src)
-- 
1.7.10.4

      parent reply	other threads:[~2015-06-02 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 14:04 [PATCH 0/4] x86/xen Several unassociated fixes Andrew Cooper
2015-06-02 14:04 ` [PATCH 1/4] x86/apic: Disable the LAPIC later in smp_send_stop() Andrew Cooper
2015-06-02 14:04 ` [PATCH 2/4] xen/crash: Don't use set_fixmap() in the crash path Andrew Cooper
2015-06-02 14:04 ` [PATCH 3/4] x86/debugger: Use copy_to/from_guest() in dbg_rw_guest_mem() Andrew Cooper
2015-06-02 14:04 ` Andrew Cooper [this message]

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=1433253867-29752-5-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).