performance of complex arithmetic

Joe Buck jbuck@Synopsys.COM
Sun Jan 31 23:58:00 GMT 1999


> This one, 0109.html, optimizes ok when rewritten in C to use the built-in
> complex type.  I don't know enough about the C++ or FORTRAN to say why
> they would have trouble with it.  I could not locate the test case
> mentioned in number 0108.html.

The backend has special support for the builtin C complex; the C++ complex
just uses the generic struct stuff, which isn't so good.

In principle it would be possible to rewrite libstdc++'s <complex> to
use this builtin support.  However, ideally special builtin complex
support shouldn't be needed, rather the same special handling should be
available for all structs (let the compiler treat them as an unordered
collection of values unless they are being read or written to a
struct/class variable in memory ... even for spills you can spill the
different members separately).





More information about the Gcc mailing list