From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <199610011205.HAA02905@saratoga.compassnet.com> Date: 01 Oct 1996 14:29:54 +0200 From: Martin Ostermann Subject: Re: Performance revisited Eugene Leitl 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(xY) { .. } 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