mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Gregor <john.gregor@qlogic.com>
To: linux-kernel@vger.kernel.org
Cc: John Gregor <johng@diamond.mv.qlogic.com>,
	Ralph Campbell <ralph.campbell@qlogic.com>,
	John Gregor <john.gregor@qlogic.com>
Subject: [PATCH] x86_64/__iowrite32_copy: don't use string move for PIO writes
Date: Mon,  6 Jul 2009 12:07:04 -0700	[thread overview]
Message-ID: <1246907224-22758-1-git-send-email-john.gregor@qlogic.com> (raw)

From: John Gregor <johng@diamond.mv.qlogic.com>

Some processors can write the same word more than once if the movs
instruction is used. This version uses normal memory move instructions
and gets the same performance since the speed is limited by PCIe and
write combining.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: John Gregor <john.gregor@qlogic.com>
---
 arch/x86/lib/iomap_copy_64.S |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/iomap_copy_64.S b/arch/x86/lib/iomap_copy_64.S
index 05a95e7..344b00e 100644
--- a/arch/x86/lib/iomap_copy_64.S
+++ b/arch/x86/lib/iomap_copy_64.S
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2009 QLogic Corporation.  All rights reserved.
  * Copyright 2006 PathScale, Inc.  All Rights Reserved.
  *
  * This file is free software; you can redistribute it and/or modify
@@ -23,8 +24,23 @@
  */
 ENTRY(__iowrite32_copy)
 	CFI_STARTPROC
-	movl %edx,%ecx
-	rep movsd
+	movl    %edx, %ecx
+	andl    $-2, %edx
+	je      .L2
+	leaq    (%rsi,%rdx,4), %rdx
+.L1:
+	movq    (%rsi), %rax
+	addq    $8, %rsi
+	movq    %rax, (%rdi)
+	addq    $8, %rdi
+	cmpq    %rsi, %rdx
+	ja      .L1
+.L2:
+	bt      $0, %ecx
+	jae     .L4
+	movl    (%rsi), %eax
+	movl    %eax, (%rdi)
+.L4:
 	ret
 	CFI_ENDPROC
 ENDPROC(__iowrite32_copy)
-- 
1.6.0.6


             reply	other threads:[~2009-07-06 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 19:07 John Gregor [this message]
2009-07-06 21:30 ` H. Peter Anvin
2009-07-06 21:36   ` John A. Gregor
2009-07-06 22:47     ` H. Peter Anvin
2009-07-06 23:44       ` John A. Gregor
2009-07-07  0:03         ` H. Peter Anvin
2009-07-07 16:06           ` John A. Gregor
2009-07-08  0:46             ` H. Peter Anvin
2009-07-09 23:19       ` Pavel Machek
2009-07-10 15:07         ` H. Peter Anvin
2009-07-10 16:02           ` Lu, Hongjiu
2009-07-06 21:41   ` John A. Gregor

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=1246907224-22758-1-git-send-email-john.gregor@qlogic.com \
    --to=john.gregor@qlogic.com \
    --cc=johng@diamond.mv.qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralph.campbell@qlogic.com \
    /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

Powered by JetHome