This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: slow complex<double>'s with g++


It may be that I'm missing something, but you appear to be computing
different things...

Zi = 2.0*Zr*Zi + Ci;
Zr = Tr - Ti + Cr;

vs

 Z = Z*Z + C;

No doubt the 2.0 makes a difference...

There are several minor optimizations also that might speed up your
code... if you're interested, email me offline.

  Brian

On 3/3/06, Greg Buchholz <greg@sleepingsquirrel.org> wrote:
> Brian Budge wrote:
> > Which command line arguments are you using?
>
>     Mostly "-O3", but I've tried lots of combinations of different
> options and I haven't yet found the magic incantation.
>
> >Can you make use of sse2?
>
>     Well, there is a C version that I wrote which uses gcc's vector
> extensions and SSE2...
>
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=mandelbrot&lang=gcc&id=3
>
> ...but right now I'm more interested in why normal complex<double>'s are
> so slow.
>
> Greg Buchholz
>
>


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