mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86_64/__iowrite32_copy: don't use string move for PIO writes
@ 2009-07-06 19:07 John Gregor
  2009-07-06 21:30 ` H. Peter Anvin
  0 siblings, 1 reply; 12+ messages in thread
From: John Gregor @ 2009-07-06 19:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: John Gregor, Ralph Campbell, John Gregor

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-10 16:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-06 19:07 [PATCH] x86_64/__iowrite32_copy: don't use string move for PIO writes John Gregor
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

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