Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Martin Ostermann <ost@comnets.rwth-aachen.de>
Subject: Re: Performance revisited
Date: 01 Oct 1996 14:29:54 +0200	[thread overview]
Message-ID: <b5a0733b2d31ed496618dc39b6314aec.axp-list@archive.invalid> (raw)

Eugene Leitl <Eugene.Leitl@lrz.uni-muenchen.de> writes:
> On 1 Oct 1996, Martin Ostermann wrote:

> > But I have to admit, that the Linux/axp is real fun if you use
> > assembler for the inner loops ...
> 
> Why this? Inner loops do not fit into prim. cache? Atrocious gcc code 
> quality?

No, its not a cache problem, the code size is OK (although sometimes
unnecessary instructions are added, especially unnecessary type
conversions). But the instruction scheduling is bad. The latency of
all floating point operations (fop) is 6 cycles on EV4. Now, in case
you got a branch, you want the test at least 6 instructions away from
the actual branch instruction. But if you code something like

	some_calculations;
	if(x<X) { .. }
	if(x>Y) { .. }

gcc is coding it into (pseudo assembler)

	cmplt x,X,$1	
	some_calculations
	fbneq $1, $01
	 {..}
$01:
	cmplt Y,x,$1	; 6 cycles wasted here, if first 
	fbneq $1, $02    ; jump was taken
	 {..}
$02:

whilst it would be most efficient like this:

	cmplt x,X,$1	
	cmplt Y,x,$2
	some_calculations
	fbneq $1, $01
	 {..}
$01:
	fbneq $2, $02   ; no need to wait here ...
	 {..}
$02:

So apparently gcc isn't able to move the test instruction beyond a
branch, even if it's easily done. 

There are many similar examples. If you're interested, just use gcc -S
and look at the results. 

> Is Alpha assembly friendly for human programmers? I know it's RISC, but 
> at least orthogonal RISC, I hope?

I think it's pretty easy. You just have to be willing to look at the
scheduling rules. The instruction set is available online, I think
it's the "Alpha Architecture Handbook". Scheduling rules are
available through the hardware references. Try 

	http://www.netbsd.org/Ports/alpha/doc-list.html

for a collection of papers on Alpha hardware.

Martin

-- 
Martin Ostermann                | mailto:ost@comnets.rwth-aachen.de
Communication Networks          | http://www.comnets.rwth-aachen.de/~ost
Aachen University of Technology | phoneto:++49/241/807917
Germany                         | faxto:++49/241/8890378

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

             reply	other threads:[~1996-10-01 12:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-01 12:29 Martin Ostermann [this message]
     [not found] <199610061512.RAA18788@wopr.campus.luth.se>
1996-10-10 11:45 ` Performance revisited Nigel Sale
     [not found] <331bABA7yRVyEwMz@fgel.demon.co.uk>
1996-10-06 15:12 ` Andreas Johansson
     [not found] <199610011558.IAA00777@panda.mosberger>
1996-10-04 14:18 ` Nigel Sale
  -- strict thread matches above, loose matches on Subject: below --
1996-10-01 15:58 David Mosberger-Tang
     [not found] <Pine.GSO.3.93.961001100023.1917B-100000@computer.soc.uwm.edu>
1996-10-01 15:45 ` Eugene Leitl
1996-10-01 23:38   ` Michal Jaegermann
     [not found] <2KqZYGAJ6RUyEwHZ@fgel.demon.co.uk>
1996-10-01 15:26 ` Osowski
1996-10-01 15:22 Lee Burnside
     [not found] <199610011421.KAA10782@mailserver2.tiac.net>
1996-10-01 14:33 ` Nigel Sale
     [not found] <OVjf$AAhjNUyEwha@fgel.demon.co.uk>
1996-10-01 13:37 ` Nigel Sale
1996-10-01 14:23 ` Michael Brennen
1996-10-01 15:39 ` Michal Jaegermann
1996-10-01 14:21 Stephen J. Gaudet
     [not found] <43lodr8150.fsf@comnets.rwth-aachen.de>
1996-10-01 11:40 ` Eugene Leitl
1996-10-01 16:08   ` Richard Henderson
1996-10-01 13:32 ` Nigel Sale
1996-10-01 12:54 David A Rusling
1996-10-01  9:49 Martin Ostermann
     [not found] <9610010733.ZM8359@zam331>
1996-10-01  8:40 ` Nigel Sale
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