This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why performance so poor on Alpha?


Quoting Toon Moene (toon@moene.indiv.nluug.nl):
> Martin Kahlert wrote:
> 
> > i wonder, why gcc/g77 produces such poor code on Alpha.
> > Here is a trivial daxpy routine as an example:
> > 
> >       SUBROUTINE DAXPY(N,ALPHA,X,Y)
> >       IMPLICIT NONE
> >       INTEGER*4 N,I,J
> >       REAL*8 ALPHA,X(N),Y(N)
> > 
> >       DO I=1, N
> >          Y(I)=Y(I)+ALPHA*X(I)
> >       ENDDO
> >       RETURN
> >       END
> 
> [ Compaq compiler generates code between 4 and 5 times as fast as g77 ]
> 
> [Very good explanation skipped...]
> 
> First of all you have to generate different pseudo registers for
> floating temporaries for every loop body copy while unrolling, keeping
> in mind the liveness properties of the floating point values involved.
> 
> If you solved that problem, then you have to prevent local-alloc.c from
> assigning these pseudo's to the minimal number of registers necessary
> (which it can determine because it also knows which value is live over
> which range of instructions) - nicely undoing all the hard work you did
> above.
Does this mean, that even i wrote your pseudo code in Fortran by hand,
local-alloc.c would undo this change, too? (Sorry, i don't have my
Alpha handy now)

So, perhaps some sort of modification of gas would help?
I mean to rewrite the asm gcc outputs using more registers.
On a load store architecture like the Alpha with a clean asm
lifetime analysis of registers should be fairly easy and this could be
done here more easily. Perhaps this is some sort of peep hole opt?

Thanks for your good explanation.
Martin.


-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]