From: "P Dickerson" <peter@localhost>
Subject: Re: 21264 performance anomalies (was: Compaq to port ...)
Date: 1999/04/09 [thread overview]
Message-ID: <923660402.19654.0.nnrp-12.9e981e55@news.demon.co.uk> (raw)
In-Reply-To: 7ej80q$o1a$1@news.tuwien.ac.at
Is this really a C program? Have I missed the inclusion of dynamic gotos?
--
P.M.Dickerson.
email: peter (at) izabella (dot) demon (dot) co (dot) uk
Anton Ertl wrote in message <7ej80q$o1a$1@news.tuwien.ac.at>...
>In article <370CF898.BD85182@moene.indiv.nluug.nl>,
> Toon Moene <toon@moene.indiv.nluug.nl> writes:
>> Anton Ertl wrote:
>> > And no, appendix A of the Alpha AXP Architecture reference manual does
>> > not cut it. Its "factor of" terminology is unclear, and, e.g., it does
>> > not explain the results I see on a 21264 when I vary
>> > http://www.complang.tuwien.ac.at/forth/threading/direct.c.
>>
>> Hmmm, I didn't realize there's actual evidence that the information in
>> the Alpha Architecture Manual is not sufficient
>
>Ok, I wanted to write this for some time, so here we go:
>
>The C program is this:
>
>#define NEXT goto **ip++
>main()
>{
> static void *prog[] = {&&next,&&next,&&next,&&next,&&next,
> &&next,&&next,&&next,&&next,&&loop};
> void **ip=prog;
> int count = 10000000;
>
> next:
> NEXT;
> loop:
> if (count>0) {
> count--;
> ip=prog;
> NEXT;
> }
>}
>
>Here's what egcs-1.03 produces for the first NEXT:
>
>0x120000690 <main+16>: ldah t2,153(t2)
>next:
>0x120000694 <main+20>: ldq t0,0(t1)
>0x120000698 <main+24>: addq t1,0x8,t1
>0x12000069c <main+28>: jmp zero,(t0),0x1200006a0 <main+32>
>
>This takes 3.45s (~17 cycles/NEXT)
>
>Here are various variations on this code, with instructions before the
>"next:" jump target in parentheses:
>
>0x1200006a0 ldq (nop) (ldah) (addq) nop
>0x1200006a4 addq ldq ldq ldq nop
>0x1200006a8 jmp addq addq addq ldq
>0x1200006ac jmp jmp jmp addq
>0x1200006b0 jmp
> 1.12s 2.56s 3.48s 3.45s 0.72s
>
>The conclusions I draw are:
>
>1) Code should be aligned to 16-byte boundaries; Penalty for
>non-conformance: ~8 cycles/NEXT in this benchmark. Why so much?
>
>2) In an unaligned block the kind of instruction *before* the jump
>target does play a role. nops are cheap, while the other instructions
>I tried apparently cost another ~5 cycles/NEXT. Why is that and why so
>much?
>
>3) Pushing the jmp into the next 16-byte block by adding nops saves
>~2cycles/NEXT. Why?
>
>Overall I see a factor of five variation in speed by simply inserting
>a few nops in the right spots.
>
>Crossposted to comp.os.linux.alpha,comp.arch.
>
>- anton
>--
>M. Anton Ertl Some things have to be seen to be believed
>anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
>http://www.complang.tuwien.ac.at/anton/home.html
next prev parent reply other threads:[~1999-04-09 4:00 UTC|newest]
Thread overview: 114+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-06 4:00 Compaq to port its Fortran and C compilers to Alpha Linux Steve Lionel
1999-04-07 4:00 ` NewsMan
1999-04-06 4:00 ` Jeffrey J. Potoff
1999-04-06 4:00 ` Ron Flory
1999-04-07 4:00 ` Paul English
1999-04-07 4:00 ` Dave Cherkus
1999-04-07 4:00 ` essoft
1999-04-08 4:00 ` bmeyer
1999-04-09 4:00 ` Richard Heathfield
1999-04-09 4:00 ` Dave Cherkus
1999-04-07 4:00 ` Greg Lindahl
1999-04-07 4:00 ` Gary Scott
1999-04-07 4:00 ` Toon Moene
1999-04-07 4:00 ` Ben Pfaff
1999-04-07 4:00 ` Peter Mardahl
1999-04-07 4:00 ` bmeyer
1999-04-07 4:00 ` Jim Klein
1999-04-07 4:00 ` Jeffrey J. Potoff
1999-04-07 4:00 ` Greg Lindahl
1999-04-07 4:00 ` Toon Moene
1999-04-08 4:00 ` Anton Ertl
1999-04-08 4:00 ` Toon Moene
1999-04-08 4:00 ` 21264 performance anomalies (was: Compaq to port ...) Anton Ertl
1999-04-09 4:00 ` P Dickerson [this message]
1999-04-09 4:00 ` Anton Ertl
1999-04-10 4:00 ` Bruce Hoult
1999-04-14 4:00 ` 21264 performance anomalies Robert Herndon
1999-04-14 4:00 ` Dennis Ritchie
1999-04-15 4:00 ` Erik Corry
1999-04-15 4:00 ` Dave Cherkus
1999-04-15 4:00 ` Erik Corry
1999-04-15 4:00 ` Dave Cherkus
1999-04-15 4:00 ` Linus Torvalds
1999-04-15 4:00 ` Dave Cherkus
1999-04-15 4:00 ` Jim Gettys
1999-04-18 4:00 ` Bernd Paysan
1999-04-18 4:00 ` How hard would it be to improve gcc's performance to match DEC CC? Peter Mardahl
1999-04-19 4:00 ` TTK Ciar
1999-04-19 4:00 ` 21264 performance anomalies peter
1999-04-19 4:00 ` Dave Cherkus
1999-04-20 4:00 ` Larry Kilgallen
1999-04-21 4:00 ` Bernd Paysan
1999-04-21 4:00 ` Greg Lindahl
1999-04-22 4:00 ` Terje Mathisen
1999-04-22 4:00 ` Greg Lindahl
1999-04-22 4:00 ` Jan Vorbrueggen
1999-04-22 4:00 ` Larry Kilgallen
1999-04-22 4:00 ` Paul DeMone
1999-04-23 4:00 ` Jan Vorbrueggen
1999-04-23 4:00 ` Paul DeMone
1999-04-24 4:00 ` Zalman Stern
1999-04-23 4:00 ` Donald C. Lindsay
1999-05-09 4:00 ` TTK Ciar
1999-05-11 4:00 ` Peter Mayne
1999-04-22 4:00 ` Fred Kleinsorge
1999-04-22 4:00 ` John Pieper
1999-04-22 4:00 ` Thomas Womack
1999-04-20 4:00 ` Larry Kilgallen
1999-04-22 4:00 ` Anton Ertl
1999-04-16 4:00 ` first-class labels (was: 21264 performance anomalies) Anton Ertl
1999-04-15 4:00 ` 21264 performance anomalies amos
1999-04-11 4:00 ` 21264 performance anomalies (was: Compaq to port ...) Michael Gschwind
1999-04-11 4:00 ` 21264 performance anomalies Donald C. Lindsay
1999-04-12 4:00 ` Justin Carlson
1999-04-14 4:00 ` Anton Ertl
1999-04-14 4:00 ` Jan Vorbrueggen
1999-04-14 4:00 ` Justin Carlson
1999-04-08 4:00 ` Compaq to port its Fortran and C compilers to Alpha Linux James D. Freels
1999-04-09 4:00 ` Greg Lindahl
1999-04-11 4:00 ` Michal Jaegermann
1999-04-09 4:00 ` Jim Gettys
1999-04-09 4:00 ` Anton Ertl
1999-04-09 4:00 ` Toon Moene
1999-04-09 4:00 ` Jim Gettys
1999-04-09 4:00 ` bmeyer
1999-04-09 4:00 ` Anton Ertl
1999-04-09 4:00 ` Jim Gettys
1999-04-08 4:00 ` Keith Higgs
1999-04-09 4:00 ` Daniel Barker
1999-04-10 4:00 ` Phillip Helbig
1999-04-10 4:00 ` Christopher B. Browne
1999-04-10 4:00 ` James D. Freels
1999-04-11 4:00 ` Christopher B. Browne
1999-04-11 4:00 ` Zane H. Healy
1999-04-11 4:00 ` James Van Buskirk
1999-04-11 4:00 ` Greg Lindahl
1999-04-12 4:00 ` Robert Harley
1999-04-12 4:00 ` Phillip Helbig
1999-04-12 4:00 ` Greg Lindahl
1999-04-12 4:00 ` Glenn C. Everhart
1999-04-19 4:00 ` Bob Koehler
1999-04-19 4:00 ` Jim Reiss
1999-04-12 4:00 ` James Van Buskirk
1999-04-14 4:00 ` Greg Lindahl
1999-04-12 4:00 ` Richard Levitte - VMS Whacker
1999-04-11 4:00 ` Greg Lindahl
1999-04-11 4:00 ` Toon Moene
1999-04-07 4:00 ` Steve Lionel
1999-04-07 4:00 ` Peter Mardahl
1999-04-07 4:00 ` Ron Flory
1999-04-07 4:00 ` Helmut Katzgraber
1999-04-08 4:00 ` Steve Lionel
1999-04-08 4:00 ` Helmut Katzgraber
1999-04-08 4:00 ` Steve Lionel
1999-04-09 4:00 ` Dave Cherkus
1999-04-09 4:00 ` Steve Lionel
1999-04-09 4:00 ` Christopher B. Browne
1999-04-08 4:00 ` Udo Klasmeier
1999-04-09 4:00 ` Jacob Gladish
1999-04-10 4:00 ` Phillip Helbig
1999-04-10 4:00 ` Christopher B. Browne
1999-04-15 4:00 ` Jim Gettys
1999-04-12 4:00 ` Christian Simmendinger
1999-04-15 4:00 ` Dr. Scott A. Furman
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox