This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/43108] mixed complex<T> multiplication horribly inefficient
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2010 22:15:55 -0000
- Subject: [Bug libstdc++/43108] mixed complex<T> multiplication horribly inefficient
- References: <bug-43108-2589@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2010-02-17 22:15 -------
(In reply to comment #4)
> (In reply to comment #3)
> > Well, but float * complex<float> isn't the same as complex<float> *
> > complex<float>. But the library (and also C promotion if you write
> > that in literal C) presents us with complex<float> * complex<float>.
>
> Where, exactly, the library presents complex * complex instead of complex *
> float? I really don't see it. I see things like:
>
> complex<float>&
> operator*=(float __f)
> {
> _M_value *= __f;
> return *this;
> }
>
> and I don't see where the library explicitly transforms __f to a complex, I see
> something like complex = complex * float. But really, we have been through this
> *already*, I'm absolutely sure, and I have zero problems with changing the
> above, if Gaby agrees and you all are sure something changed since the lat
> time, it's a 5 minutes work, but I'm still convinced that this is something
> much more generally useful to optimize than the library.
Well, also in C++ you get promotion to _M_value * complex <__f, 0.0> which
we cannot optimize in case we care for the sign of zeros (you get the
desired optimization with -fno-signed-zeros).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43108