public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: performance of complex arithmetic
@ 1999-01-27 14:00 Billinghurst, David (RTD)
  1999-01-31 23:58 ` Billinghurst, David (RTD)
  0 siblings, 1 reply; 20+ messages in thread
From: Billinghurst, David (RTD) @ 1999-01-27 14:00 UTC (permalink / raw)
  To: 'Toon Moene', Peter.Bienstman; +Cc: egcs

I can compile and run the LAPACK testsuite with 'FFLAGS=-O3 -funroll-loops'
using recent snapshots on Irix 6.2,
provided I compile routine SRC/cspr.f with -O1.

I have narrowed the problem down to
http://www.cygnus.com/ml/egcs-bugs/1999-Jan/0334.html

Interestingly, using -fnoemulate-complex gives an ICE 

/exd4/billingd/tmp/egcs-19990124/bin/g77 -O2 -g -Wall -o labug2a
-fno-emulate-complex labug2a.f
/exd4/billingd/src/egcs-19990124/gcc/emit-rtl.c:991: Internal compiler error
in function gen_lowpart


> -----Original Message-----
> From:	Toon Moene [SMTP:toon@moene.indiv.nluug.nl]
> Sent:	Thursday, January 28, 1999 1:18 AM
> To:	Peter.Bienstman@rug.ac.be
> Cc:	egcs@cygnus.com
> Subject:	Re: performance of complex arithmetic
> 
> 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

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: performance of complex arithmetic
@ 1999-01-26 19:24 Stephen L Moshier
  1999-01-27  0:33 ` Michael Hayes
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Stephen L Moshier @ 1999-01-26 19:24 UTC (permalink / raw)
  To: Peter Bienstman, egcs

    Is any work being done on the improvement of complex arithmetic?

I am currently interested in this subject and would like to receive
simple test cases of inefficient or wrong code relating to the native
complex type (preferably in C, as opposed to FORTRAN or C++).


    `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.

This remark is a bit obsolete.  There was a severe problem in gcc-2.7
on i386, but it was fixed in gcc-2.8.  Currently gcc's native complex
data type seems to work pretty well in C language, except that single
precision complex does not yet work on 64-bit target computers.


^ permalink raw reply	[flat|nested] 20+ messages in thread
* performance of complex arithmetic
@ 1999-01-26  1:08 Peter Bienstman
  1999-01-27  6:28 ` Toon Moene
  1999-01-31 23:58 ` Peter Bienstman
  0 siblings, 2 replies; 20+ messages in thread
From: Peter Bienstman @ 1999-01-26  1:08 UTC (permalink / raw)
  To: egcs

Hello,

I have a question regarding EGCS's performance on complex arithmetic.

A first point regards the following switch for g77:

'-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.

Secondly, I was wondering if g++ is able to eliminate complex temporaries
the same way it is able to eliminate e.g. real or integer temporaries. A
while ago, this was a point of concern on the Blitz mailing list.

Is any work being done on the improvement of complex arithmetic? The code
I'm writing relies heavily on complex numbers, so it would be really bad
news if an otherwise great compiler wouldn't perform well in this area.

Greetings,

-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - University of Gent
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~1999-01-31 23:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-27 14:00 performance of complex arithmetic Billinghurst, David (RTD)
1999-01-31 23:58 ` Billinghurst, David (RTD)
  -- strict thread matches above, loose matches on Subject: below --
1999-01-26 19:24 Stephen L Moshier
1999-01-27  0:33 ` Michael Hayes
1999-01-31 23:58   ` Michael Hayes
1999-01-27  1:37 ` Peter Bienstman
1999-01-27  9:25   ` Stephen L Moshier
1999-01-27  9:55     ` Joe Buck
1999-01-31 23:58       ` Joe Buck
1999-01-31 23:58     ` Stephen L Moshier
1999-01-27 13:24   ` craig
1999-01-27 13:45     ` Stephen L Moshier
1999-01-31 23:58       ` Stephen L Moshier
1999-01-31 23:58     ` craig
1999-01-31 23:58   ` Peter Bienstman
1999-01-31 23:58 ` Stephen L Moshier
1999-01-26  1:08 Peter Bienstman
1999-01-27  6:28 ` Toon Moene
1999-01-31 23:58   ` Toon Moene
1999-01-31 23:58 ` Peter Bienstman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).