From: Dave Jones <davej@codemonkey.org.uk>
To: Ed Sweetman <ed.sweetman@wmich.edu>
Cc: Robert Love <rml@tech9.net>, linux-kernel@vger.kernel.org
Subject: Re: [CFT] faster athlon/duron memory copy implementation
Date: Thu, 24 Oct 2002 21:49:06 +0100 [thread overview]
Message-ID: <20021024204906.GC14351@suse.de> (raw)
In-Reply-To: <3DB858A3.10104@wmich.edu>
On Thu, Oct 24, 2002 at 04:31:31PM -0400, Ed Sweetman wrote:
> which is almost a 30MB/s difference or 6% simply from compiler options
> of the same compiler. It may not mean much in 1 second. But few things
> where we care about performance are only run for one second.
Looking at the assembly output of both optimised and unoptimised, we
see quite startling differences in the way the loops are done..
The unoptimised case..
movl $0, -12(%ebp)
.L75:
cmpl $63, -12(%ebp)
jle .L78
jmp .L76
...
movntq/movq inline asm bits
...
leal 12(%ebp), %eax
addl $64, (%eax)
addl $64, 8(%ebp)
leal -12(%ebp), %eax
incl (%eax)
jmp .L75
Note it uses -12(%ebp) to keep track of how much its copied.
The optimised version is much more sensible..
movl $63, %ebx
.p2align 2
.L98:
...
movntq/movq inline asm bits
...
addl $64, %ecx
addl $64, %edx
decl %ebx
jns .L98
Keeping track of the count in an register, no indirect memory references,
leaving the only memory references to be the actual memory copies, which
let it achieve the full bandwidth of the memory bus.
Quite surprising. I doubt going over the top with CFLAGS buys you much.
The above optimisation comes in with just -O2.
Dave
--
| Dave Jones. http://www.codemonkey.org.uk
next prev parent reply other threads:[~2002-10-24 20:41 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-24 17:15 [CFT] faster athlon/duron memory copy implementation Manfred Spraul
2002-10-24 17:37 ` Robert Love
2002-10-24 18:05 ` Zach Brown
2002-10-24 17:41 ` Andreas Steinmetz
2002-10-24 17:48 ` Matthias Welk
2002-10-24 19:01 ` erich
2002-10-24 19:11 ` Arjan van de Ven
2002-10-24 19:38 ` Manfred Spraul
2002-10-25 0:59 ` Panagiotis Papadakos
2002-10-24 17:53 ` Roger Luethi
2002-10-24 18:10 ` Daniel Egger
2002-10-24 19:15 ` Florin Iucha
2002-10-24 19:28 ` Manfred Spraul
2002-10-24 19:38 ` Dave Jones
2002-10-24 19:43 ` Ken Witherow
2002-10-25 13:08 ` Daniel Egger
2002-10-24 18:17 ` Eric Lammerts
2002-10-24 18:26 ` David Rees
2002-10-24 18:35 ` Josh McKinney
2002-10-24 18:36 ` Dave Jones
2002-10-24 18:43 ` Simon Fowler
2002-10-24 18:50 ` Simon Fowler
2002-10-24 18:56 ` Dave Jones
2002-10-24 18:48 ` Ernst Herzberg
2002-10-24 20:09 ` Ed Sweetman
2002-10-24 20:13 ` Robert Love
2002-10-24 20:31 ` Ed Sweetman
2002-10-24 20:49 ` Dave Jones [this message]
2002-10-24 20:26 ` Dave Jones
2002-10-25 9:19 ` Måns Rullgård
2002-10-24 19:11 ` Marcus Libäck
2002-10-24 19:19 ` Brian Gerst
2002-10-24 19:31 ` Matthias Schniedermeyer
2002-10-24 19:33 ` Pascal Schmidt
2002-10-24 19:39 ` Olaf Dietsche
2002-10-24 20:27 ` Mike Civil
2002-10-24 20:44 ` Willy TARREAU
2002-10-24 21:46 ` Josh Fryman
2002-10-24 22:18 ` Tim Schmielau
2002-10-24 23:09 ` Hirokazu Takahashi
2002-10-24 23:37 ` Ryan Cumming
2002-10-25 0:10 ` Matthias Andree
2002-10-25 8:35 ` venom
2002-10-25 13:31 ` Denis Vlasenko
2002-10-26 12:11 ` Jurjen Oskam
-- strict thread matches above, loose matches on Subject: below --
2002-10-24 18:27 Shawn Starr
2002-10-24 20:51 Dieter Nützel
2002-10-24 21:01 ` Dieter Nützel
2002-10-24 21:16 ` Willy TARREAU
2002-10-24 22:01 Harm Verhagen
2002-10-25 16:29 Jorge Bernal "Koke"
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=20021024204906.GC14351@suse.de \
--to=davej@codemonkey.org.uk \
--cc=ed.sweetman@wmich.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
/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).