This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: performance of complex arithmetic
- To: Peter dot Bienstman at rug dot ac dot be
- Subject: Re: performance of complex arithmetic
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 27 Jan 1999 15:17:55 +0100
- CC: egcs at cygnus dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <199901260908.KAA19127@allserv.rug.ac.be>
Peter Bienstman wrote:
> I have a question regarding EGCS's performance on complex arithmetic.
> '-fno-emulate-complex'
> Implement `COMPLEX' arithmetic using the facilities in the `gcc'
> back end that provide direct support of `complex' arithmetic,
> instead of emulating the arithmetic.
>
> `gcc' has some known problems in its back-end support for
> `complex' arithmetic, due primarily to the support not being
> completed as of version 2.7.2.2. Other front ends for the `gcc'
> back end avoid this problem by emulating `complex' arithmetic at a
> higher level, so the back end sees arithmetic on the real and
> imaginary components.
>
> Is it true that the g++ ang g77 frontends still emulate complex arithmetic?
> This would seem like a significant performance penalty, as the optimiser
> would probably miss out on some optimisations.
Worse even, we _know_ it does.
The (remaining) problems seem to concentrate on targets with 64 bit
words using single precision complex. AFAICD, 32 bit targets do not
suffer from "native complex" bugs anymore in current snapshots.
To check this, I ran LAPACK's testsuite to completion on my Pentium II
based laptop, using:
[toon@moene LAPACK]$ /usr/snp/bin/gcc -v
Reading specs from
/usr/snp/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/specs
gcc version egcs-2.93.03 19990125 (gcc2 ss-980609 experimental)
with the following options:
OPTS = -g -O3 -funroll-loops -fomit-frame-pointer
-fno-emulate-complex -malign-double
without any problem.
Eliminating the -fno-emulate-complex option, I ran into the same problem
as Josip Loncaric, namely that xlintstc (test driver for the single
precision complex LINear algebra routines) crashed. Because about one
eighth of the complete LAPACK distribution is linked in with this
program, there's little use posting the constituent parts here ;-)
People who'd like to investigate this have to download the LAPACK
distribution themselves (which, BTW, is a very good test tool for a
Fortran compiler by itself).
One note of caution, though: Although the distribution itself is only
about 4.5 Mb gzip'd, after unpacking and building you need about 120 Mb.
Cheers,
--
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
g77 Support: fortran@gnu.org; egcs: egcs-bugs@cygnus.com