From: Terje Mathisen <Terje.Mathisen@hda.hydro.com>
Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so)
Date: 1999/05/18 [thread overview]
Message-ID: <374110A2.67761C35@hda.hydro.com> (raw)
In-Reply-To: 7hq34t$osi$9@nntp.Stanford.EDU
Jonathan Stone wrote:
>
> In article <slrn7k0vuj.hh.mike@ducky.net>, mike@ducky.net (Mike Haertel) writes:
> |> In article <7hp5if$11co$1@news.doit.wisc.edu>, Andy Glew wrote:
> |> >Actually, based pointers have absolutely no overhead
> |> >on processors with the appropriate addressing modes.
> |>
> |> You are conveniently overlooking the fact that providing
> |> the "appropriate addressing modes" may have circuit impact
> |> in a place where you'd rather not.
>
> and plus extra register pressure, which may cause more spills, more
> cache misses, ... ``Absolutely no overhead'' sounds awfully quantitative.
> Got numbers to back it up?
Andy is correct to a first order approximation, on recent x86 cpus, but
as noted the requirement for base+index+offset addressing has been a
sore point on many x86 implementations, i.e. it caused an extra pipeline
bubble on at least the 486 cpus.
The "real" problem with based pointer on x86 though isn't just the
register pressure, but the fact that it takes away the most advanced
addressing mode from the application itself, i.e. it is no longer
possible to directly address something like a specific element in an
array of structs, unless the array starts at the bottom of the based
segment itself (or at a fixed offset from the bottom).
OTOH, as long as we're going to use asm code, based pointers are
definitely easier (more natural) to use on x86 (or M68K) than on more
modern cpus with simpler (faster?) address arithmetic.
It will still be problematical to write stable & portable C code to
support the concept.
Terje
PS. Almost all the really high-performance asm kernels I write tend to
use base+index+offset addressing in the innermost loops:
ESI -> just past the end of input array
EDI -> just past the end of output array
ECX = nr of elements (or size in bytes/size in unrolled blocks etc)
; Unrolled 2-8 times:
OFFSET = 0
next4:
REPT 4
mov eax,[esi + ecx * SCALE_FACTOR + OFFSET]
... Do something
mov [edi+ + ecx * SCALE_FACTOR + OFFSET]
OFFSET = OFFSET + ELEMENT_SIZE
ENDM
; Update loop counter/address index & branch back
add esi, BLOCK_SIZE
jb next4
The individual iterations are of course mixed together for better
pipeling, and the top of the loop will avoid any loop-counter based
addressing which would cause AGIs, but otherwise that is the normal
logic.
With just base or base + offset addresses, I would have needed more
instructions to update the source & destination pointers as well.
--
- <Terje.Mathisen@hda.hydro.com>
Using self-discipline, see http://www.eiffel.com/discipline
"almost all programming can be viewed as an exercise in caching"
next prev parent reply other threads:[~1999-05-18 4:00 UTC|newest]
Thread overview: 328+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-19 4:00 Alpha in peril? First Canion, now Pfieffer Paul DeMone
1999-04-19 4:00 ` Greg Lindahl
1999-04-19 4:00 ` Erik Corry
1999-04-19 4:00 ` Ian Kemmish
1999-04-19 4:00 ` Arthur T. Murray
1999-04-19 4:00 ` Henrik Klagges
1999-04-19 4:00 ` Terry C Shannon
1999-04-19 4:00 ` Doug Siebert
1999-04-20 4:00 ` Anton Ertl
1999-04-20 4:00 ` Greg Lindahl
1999-04-20 4:00 ` Doug Siebert
1999-04-21 4:00 ` Greg Lindahl
1999-04-21 4:00 ` Zalman Stern
1999-04-21 4:00 ` Anton Ertl
1999-04-23 4:00 ` Paul DeMone
1999-04-24 4:00 ` Andreas Kaiser
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-21 4:00 ` Greg Lindahl
1999-04-21 4:00 ` Andy Glew
1999-04-22 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-22 4:00 ` Greg Lindahl
1999-04-22 4:00 ` Dave Cherkus
1999-04-22 4:00 ` Andy Glew
1999-04-22 4:00 ` Dave Cherkus
1999-04-22 4:00 ` Andy Glew
1999-04-23 4:00 ` Bruce Hoult
1999-04-23 4:00 ` Terje Mathisen
1999-04-23 4:00 ` Bruce Hoult
1999-04-22 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-22 4:00 ` Erik Corry
1999-04-22 4:00 ` TTK Ciar
1999-04-22 4:00 ` Thomas Womack
1999-04-23 4:00 ` Jan Vorbrueggen
1999-04-22 4:00 ` Peter da Silva
1999-04-23 4:00 ` Terje Mathisen
1999-04-22 4:00 ` Thor Lancelot Simon
1999-04-22 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-22 4:00 ` Peter da Silva
1999-04-22 4:00 ` Thor Lancelot Simon
1999-04-22 4:00 ` Peter da Silva
1999-04-23 4:00 ` Dave Cherkus
1999-04-26 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-26 4:00 ` Pete Zaitcev
1999-04-26 4:00 ` Dave Cherkus
1999-04-26 4:00 ` Thor Lancelot Simon
1999-04-27 4:00 ` Ketil Z Malde
1999-04-26 4:00 ` Dave Cherkus
1999-04-26 4:00 ` Przemek Klosowski
1999-04-21 4:00 ` Thomas Womack
1999-04-20 4:00 ` Rob Young
1999-04-20 4:00 ` Doug Siebert
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` Zalman Stern
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` John McCalpin
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` John McCalpin
1999-04-21 4:00 ` Del Cecchi
1999-04-21 4:00 ` Peter da Silva
1999-04-21 4:00 ` Rob Young
1999-04-21 4:00 ` Peter da Silva
1999-04-21 4:00 ` Chris Morgan
1999-04-22 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-22 4:00 ` Greg Lindahl
1999-04-22 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-22 4:00 ` Jeffrey J. Potoff
1999-04-22 4:00 ` Greg Lindahl
1999-04-22 4:00 ` Zalman Stern
1999-04-22 4:00 ` Alan Stange
1999-04-23 4:00 ` Jan Vorbrueggen
1999-04-23 4:00 ` Greg Lindahl
1999-04-23 4:00 ` Zalman Stern
1999-04-23 4:00 ` Jan Vorbrueggen
1999-04-23 4:00 ` Steven Hobbs
1999-04-24 4:00 ` Gregory Pfister
1999-04-26 4:00 ` Ketil Z Malde
1999-04-26 4:00 ` John McCalpin
1999-04-26 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-26 4:00 ` Peter da Silva
1999-04-26 4:00 ` Greg Lindahl
1999-04-26 4:00 ` Terje Mathisen
1999-04-26 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-04-26 4:00 ` Peter da Silva
1999-04-28 4:00 ` Jeffrey J. Potoff
1999-04-28 4:00 ` Peter da Silva
1999-04-27 4:00 ` Henrik Klagges
1999-04-27 4:00 ` Achim Gratz
1999-04-27 4:00 ` Henrik Klagges
1999-04-22 4:00 ` Henrik Klagges
1999-04-19 4:00 ` Dave Cherkus
1999-04-19 4:00 ` David Hinds
1999-04-20 4:00 ` Jeffrey Keith Boulier
1999-04-20 4:00 ` Doug Siebert
1999-04-19 4:00 ` JohnC
1999-04-19 4:00 ` Henrik Klagges
1999-04-19 4:00 ` Greg Lindahl
1999-04-19 4:00 ` Terry Murphy
1999-04-19 4:00 ` Greg Lindahl
1999-04-19 4:00 ` Christopher Gomez
1999-04-19 4:00 ` Peter da Silva
1999-04-20 4:00 ` Thor Lancelot Simon
1999-04-21 4:00 ` Andy Glew
1999-04-21 4:00 ` Monty Brandenberg
1999-04-21 4:00 ` Andy Glew
1999-04-22 4:00 ` Aaron Spink
1999-04-23 4:00 ` Jonathan Stone
1999-04-25 4:00 ` Andy Glew
1999-04-25 4:00 ` John Wilson
1999-04-26 4:00 ` Pete Zaitcev
1999-04-26 4:00 ` John Wilson
1999-04-26 4:00 ` Peter da Silva
1999-04-21 4:00 ` Tim Shoppa
1999-04-21 4:00 ` Peter da Silva
1999-04-21 4:00 ` Dave Cherkus
1999-04-21 4:00 ` Sean Eric Fagan
1999-04-21 4:00 ` Jonathan Stone
1999-04-21 4:00 ` Tim Shoppa
1999-04-21 4:00 ` Jonathan Stone
1999-04-21 4:00 ` Tim Shoppa
1999-04-21 4:00 ` Terje Mathisen
1999-05-09 4:00 ` TTK Ciar
1999-04-26 4:00 ` Przemek Klosowski
1999-04-20 4:00 ` Jeffrey Keith Boulier
1999-04-19 4:00 ` Tim Shoppa
1999-04-19 4:00 ` Greg Lindahl
1999-04-19 4:00 ` Dave Schreiber
1999-04-19 4:00 ` Tim Shoppa
1999-04-20 4:00 ` Henrik Klagges
1999-04-20 4:00 ` Greg Lindahl
1999-04-20 4:00 ` Rick Jones
[not found] ` <7flnot$qlb$3@nntp.stanford.edu>
1999-04-22 4:00 ` vhalkka
1999-04-22 4:00 ` Tim Shoppa
1999-04-22 4:00 ` vhalkka
1999-04-22 4:00 ` Jonathan Stone
[not found] ` <371e231d.0@news.de <FAKCxA.7Gx@kithrup.com>
1999-04-22 4:00 ` David Jones
1999-04-22 4:00 ` TTK Ciar
1999-04-25 4:00 ` Daniel P. B. Smith
1999-04-25 4:00 ` Larry Kilgallen
1999-04-25 4:00 ` Dave Cherkus
1999-04-26 4:00 ` Terry C. Shannon
1999-04-24 4:00 ` Bob Kaplow
1999-04-26 4:00 ` Dave Hansen
1999-04-27 4:00 ` Kerm Jensen
1999-04-29 4:00 ` amos
1999-04-29 4:00 ` Andy Glew
1999-04-30 4:00 ` Alpha in peril? First Canion, now Pfieffer (I do think so) George Gollin
1999-04-30 4:00 ` Greg Lindahl
1999-04-30 4:00 ` George Gollin
1999-04-30 4:00 ` Greg Lindahl
1999-04-30 4:00 ` Peter da Silva
1999-04-30 4:00 ` John Hascall
1999-04-30 4:00 ` Jeffrey J. Potoff
1999-04-30 4:00 ` Paul DeMone
1999-05-01 4:00 ` greg pavlov
[not found] ` <372A47F8.2175@ibm.net>
[not found] ` <1999May1.000639.1@eisner>
[not found] ` <372B0716.B5A068BC@igs.net>
1999-05-02 4:00 ` Rob Young
1999-05-05 4:00 ` Aaron Spink
1999-05-05 4:00 ` Zalman Stern
1999-05-06 4:00 ` Peter Seebach
1999-05-11 4:00 ` Zalman Stern
1999-05-11 4:00 ` Jonathan Stone
1999-05-11 4:00 ` Stefan Monnier <foo@acm.com>
1999-05-11 4:00 ` Allen J. Baum
1999-05-11 4:00 ` Jonathan Stone
1999-05-12 4:00 ` Sander Vesik
1999-05-12 4:00 ` Stefan Monnier <foo@acm.com>
1999-05-12 4:00 ` Jonathan Stone
1999-05-12 4:00 ` erik.elmgren
1999-05-17 4:00 ` Jonathan Stone
1999-05-12 4:00 ` Terje Mathisen
1999-05-12 4:00 ` Sander Vesik
1999-05-12 4:00 ` Terje Mathisen
1999-05-12 4:00 ` Zalman Stern
1999-05-13 4:00 ` Sander Vesik
1999-05-17 4:00 ` Andy Glew
1999-05-13 4:00 ` Sander Vesik
1999-05-13 4:00 ` Terje Mathisen
1999-05-13 4:00 ` Sander Vesik
1999-05-14 4:00 ` Bruce Hoult
1999-05-13 4:00 ` Mike Haertel
1999-05-13 4:00 ` Keith Adams
1999-05-14 4:00 ` Bruce Hoult
1999-05-14 4:00 ` Peter da Silva
1999-05-14 4:00 ` Mike Albaugh
1999-05-13 4:00 ` Mike Albaugh
1999-05-29 4:00 ` Stephen E. Halpin
1999-05-13 4:00 ` Greg Franks
1999-05-17 4:00 ` amos
1999-05-18 4:00 ` taniwha
1999-05-17 4:00 ` Andy Glew
1999-05-17 4:00 ` Mike Haertel
1999-05-17 4:00 ` Thor Lancelot Simon
1999-05-17 4:00 ` Jonathan Stone
1999-05-18 4:00 ` Terje Mathisen [this message]
1999-05-18 4:00 ` Andrew Reilly
1999-05-19 4:00 ` Terje Mathisen
1999-05-18 4:00 ` Marinos J. Yannikos
1999-05-12 4:00 ` James Cownie
1999-05-12 4:00 ` Peter da Silva
1999-05-12 4:00 ` Doug Siebert
1999-05-12 4:00 ` Jonathan Stone
1999-05-29 4:00 ` Stephen E. Halpin
1999-05-06 4:00 ` Jan Vorbrueggen
[not found] ` <372A6EF1.793A8BB5@igs.net>
[not found] ` <zaitcev.925529620@mallorn>
1999-05-01 4:00 ` Del Cecchi
1999-05-01 4:00 ` Greg Lindahl
1999-05-01 4:00 ` Paul DeMone
1999-05-29 4:00 ` Stephen E. Halpin
1999-05-29 4:00 ` John McCalpin
1999-05-29 4:00 ` Stephen E. Halpin
1999-05-29 4:00 ` Chris Gomez
1999-05-30 4:00 ` Stephen E. Halpin
1999-05-30 4:00 ` Chris Gomez
1999-06-01 4:00 ` Jeffrey Keith Boulier
1999-06-01 4:00 ` Stephen E. Halpin
1999-05-30 4:00 ` Bruce Hoult
1999-06-01 4:00 ` Chris Gomez
1999-05-30 4:00 ` Anil T Maliyekke
1999-05-30 4:00 ` Aaron Spink
1999-06-02 4:00 ` The Penguin Knows!
1999-05-29 4:00 ` Robert Barris
1999-05-31 4:00 ` Paul Hsieh
1999-06-01 4:00 ` Bruce Hoult
1999-05-31 4:00 ` Chris Gomez
1999-05-31 4:00 ` Del Cecchi
1999-05-31 4:00 ` Joe Pfeiffer
1999-06-02 4:00 ` Del Cecchi
1999-06-01 4:00 ` TTK Ciar
1999-06-01 4:00 ` Del Cecchi
1999-06-01 4:00 ` Aaron Spink
1999-06-01 4:00 ` Chris Gomez
1999-06-01 4:00 ` Bruce Hoult
1999-06-01 4:00 ` Zalman Stern
1999-06-01 4:00 ` Chris Gomez
1999-06-02 4:00 ` Zalman Stern
1999-06-02 4:00 ` Anton Ertl
1999-06-02 4:00 ` Peter da Silva
1999-06-03 4:00 ` Zalman Stern
1999-06-05 4:00 ` Joe Keane
1999-06-05 4:00 ` Zalman Stern
1999-06-01 4:00 ` Chris Gomez
1999-06-02 4:00 ` Del Cecchi
1999-06-06 4:00 ` Chris Gomez
1999-06-12 4:00 ` Del Cecchi
1999-06-12 4:00 ` Chris Gomez
1999-06-13 4:00 ` Stefan Monnier <foo@acm.com>
1999-06-01 4:00 ` Timothy J. Bogart
1999-06-01 4:00 ` John McCalpin
1999-06-01 4:00 ` Timothy J. Bogart
1999-06-01 4:00 ` John McCalpin
1999-06-02 4:00 ` Ilan Horn
1999-06-03 4:00 ` Timothy J. Bogart
1999-06-02 4:00 ` Doug Siebert
1999-06-02 4:00 ` Erik Corry
1999-06-02 4:00 ` Mike Haertel
1999-06-02 4:00 ` Greg Lindahl
1999-06-03 4:00 ` Ketil Z Malde
1999-06-03 4:00 ` Andy Glew
1999-05-30 4:00 ` Greg Lindahl
1999-05-01 4:00 ` Del Cecchi
[not found] ` <1999May1.064257.1@eisner>
1999-05-04 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-04 4:00 ` Rob Young
1999-05-05 4:00 ` Dave Cherkus
1999-05-05 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-05 4:00 ` Nooooo Problem..
1999-05-05 4:00 ` Dave Cherkus
1999-05-05 4:00 ` Greg Lindahl
1999-05-06 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-07 4:00 ` Dave Cherkus
1999-05-07 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-07 4:00 ` Thor Lancelot Simon
1999-05-07 4:00 ` Fred Kleinsorge
1999-05-08 4:00 ` Greg Lindahl
1999-05-08 4:00 ` Terry C. Shannon
1999-05-10 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-10 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-10 4:00 ` Henrik Klagges
1999-05-10 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-11 4:00 ` Don Dossa
1999-05-12 4:00 ` Serguei Patchkovskii
1999-05-12 4:00 ` Chris Petersen
1999-05-12 4:00 ` Terry C. Shannon
1999-05-12 4:00 ` David Bremner
1999-05-12 4:00 ` Terry C. Shannon
1999-05-12 4:00 ` Don Dossa
1999-05-12 4:00 ` Achim Gratz
1999-05-12 4:00 ` Greg Lindahl
1999-05-12 4:00 ` Jeffrey J. Potoff
1999-05-13 4:00 ` Greg Lindahl
1999-05-14 4:00 ` Bruce Hoult
1999-05-13 4:00 ` Peter da Silva
1999-05-12 4:00 ` Toon Moene
1999-05-13 4:00 ` Carlie Coats
1999-05-29 4:00 ` Stephen E. Halpin
1999-05-07 4:00 ` Dave Cherkus
[not found] ` <37330599 <373346d2.0@news.destek.net>
1999-05-10 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-10 4:00 ` Henrik Klagges
1999-05-05 4:00 ` Greg Lindahl
1999-05-05 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-05 4:00 ` Greg Lindahl
1999-05-05 4:00 ` Zalman Stern
1999-05-05 4:00 ` Greg Lindahl
1999-05-06 4:00 ` Kai Harrekilde-Petersen
1999-05-06 4:00 ` Greg Lindahl
1999-05-06 4:00 ` Terry C. Shannon
1999-05-06 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-06 4:00 ` Greg Lindahl
1999-05-06 4:00 ` Rob Young
1999-05-06 4:00 ` Larry Kilgallen
1999-05-08 4:00 ` Rostyslaw Lewyckyj
1999-05-08 4:00 ` Toon Moene
1999-05-09 4:00 ` Zalman Stern
1999-05-10 4:00 ` Toon Moene
1999-05-09 4:00 ` Rob Young
1999-05-11 4:00 ` Jeffrey J. Potoff
1999-05-07 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-08 4:00 ` Greg Lindahl
1999-05-08 4:00 ` Jeffrey Keith Boulier
1999-05-08 4:00 ` Del Cecchi
1999-05-09 4:00 ` TTK Ciar
1999-05-10 4:00 ` Henrik Klagges
1999-05-10 4:00 ` Sander Vesik
1999-05-11 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-10 4:00 ` TTK Ciar
1999-05-10 4:00 ` Jeffrey Keith Boulier
1999-05-11 4:00 ` Henrik Klagges
1999-05-11 4:00 ` andrew.harrison@uk.sun.nospam.com
1999-05-10 4:00 ` Henrik Klagges
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