From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5e9282cef392ed198db2aa62a645071e.axp-list@archive.invalid> X-Archive-Original-Message-ID: <3.0.2.32.19971113160919.00c54d20@mail.vt.edu> Date: Thu, 13 Nov 1997 23:16:22 +0100 From: Claus Denk Subject: Re: Perf. of F77 on Alpha David van der Spoel wrote: > > > Actually, I just did. I had C-code from when we used to do these > computation on i860 chips. The DEC compiler does *not* inline intrinsic > functions, at least I have not found a way how to do it. > The fortran compiler will inline it for me I hope... Hi David, wouldn't the compiler need the library functions (as sqrt) in assembler or in its internal format in order to be able to inline them ? At the moment of inlining, the compiler needs to know about register usage and all that, so it think that the compiler would probably need an internal representation of sqrt in order to be able to inline it. If you write your own fortran code for sqrt, it suppose it should be quite difficult to write a function that comes even close to the Digital "-math_library fast" sqrt, as these functions are heavily optimized for the alpha. And even if your new sqrt now might be inlined, the result would probably be a slower code. The following (stupid) program: PROGRAM SQRTTEST REAL*8 A(0:9),SUM DO I=0,9 A(I)=1.0D10*(I+1) ENDDO DO K=1,10000000 DO I=0,9 A(I)=dsqrt(A(I)) ENDDO ENDDO SUM=0.0d0 DO I=0,9 SUM=SUM+A(I) ENDDO write(*,*) SUM END takes 21 seconds when compiled with g77 -O2 -funroll-loops and 11 seconds when compiled with Digital f77 -fast on our 500 MHz 21164. This difference should be mainly due to the efficient implementation of the Digital sqrt library function. By the way, does this mean that you are optimizing gromacs for the alpha ? regards, Claus -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com