From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,1177a02b35e507b5 X-Google-Attributes: gid111c93,public From: Toon Moene Subject: Re: gcc/egcs C optimization Date: 1998/11/05 Message-ID: <71t89b$221$5@newnews.nl.uu.net>#1/1 X-Deja-AN: 408813587 References: <363F3118.7A28BB64@nist.gov> <3640478F.4F2C8020@theo.physik.uni-stuttgart.de> Organization: Moene Computational Physics, Maartensdijk, The Netherlands Newsgroups: comp.os.linux.alpha "C.Simmendinger" wrote: > The only thing which is sort of sad about egcs ist the absolutely poor > performance of g77 with respect to complex numbers. > I'm just trying to optimize the BLAS a bit more, i.e. just wrote > a faster cgemv/zgemv. Had to do all calculations in floats > with the corresponding conversions complex->float, float->complex. > In doing so i got a speedup of *4-6*. > I just keep wondering why the performace is so > embarrassing with respect to this ? > Since a lot of numerical stuff (e.g LAPACK) is written in fortran, > improvements on this sector would help quite a bit. The cause is not exactly known - it is related to the way complex numbers are treated in the "middle-end" of the compiler, i.e. as a (real, imag) pair. On 64-bit hosts (Alpha, MIPS-4000 and higher, UltraSPARC, etc.) a COMPLEX number is a 2x32 bits entity, which (for optimisation purposes) sometimes is treated as a single 64 bit quantity. When storing/retrieving this from memory that's not a problem - however, when trying to stuff a COMPLEX number in a 64 bit register, you're asking for trouble. The corollary of this is that for DOUBLE COMPLEX, this shouldn't be an issue. Unfortunately, although I haven't seen evidence of the contrary, I cannot proof this. HTH, -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; egcs: mailto:egcs-bugs@cygnus.com