------- Comment #25 from gdr at integrable-solutions dot net 2010-02-18 04:55 ------- Subject: Re: mixed complex<T> multiplication horribly inefficient
On Wed, Feb 17, 2010 at 4:54 PM, jan at epgmod dot phys dot tue dot nl <gcc-bugzi...@gcc.gnu.org> wrote: > ------- Comment #13 from jan at epgmod dot phys dot tue dot nl 2010-02-17 > 22:54 ------- > (In reply to comment #10) >> Regarding the specific semantics, Richard, there is little to say: we want >> the >> C99 semantics, by and large. Maybe there are some missing details, but we >> decided already that, when we switched the complex multiplication to be the >> slow, C99 annex, by default. Thus, in a first, and second too, approx, the >> C++ >> standard doesn't count, really, this is just, sketched: >> >> __complex__ double val; >> double d; >> val *= d; >> > > But the point in question is that gcc *does not implement Annex G-4.1 (item 2) > correctly*. That clearly states that u*(x+iy) = (ux)+i(uy), whereas gcc does > (u+0i)*(x+iy), leading to wrongly signed zeros. The patch fixes exactly that > (for C++) by circumventing gcc's flawed implementation of mixed arithmetic > involving C99's complex type. then, the proper fix is to fix should be in the compiler. Not in the library. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43108