This is the mail archive of the gcc-bugs@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]

[Bug target/31161] __builtin_cexpi is broken on Darwin



------- Comment #13 from dominiq at lps dot ens dot fr  2007-03-16 09:27 -------
> Darwin people.  Or at least someone with enough knowledge of ppc asm...

Do they exist? If yes, are some living on planet earth? If yes, 
how do you catch them (at least their attention!-)?

> Fixed.  (The ICE, the wrong-code is tracked by the other PR)

I have applied the patch, now the code given in the first post yields:

-1 1.22465e-16
6.12323e-17 1

i.e., cexpi returns a wrong answer (first line) when compiled with gcc
(so from a practical point of view the fix is worse than the original
error unless it breaks enough c codes to make more people to look 
at the problem).

Now I have a question that will show how ignorant I am: what "fallback" does
exactly?

If it is just a "remapping" of cexpi to cexp, then I think it is wrong.

If I am not mistaken, cexpi takes real argument x and returns a complex
result (cos(x), sin(x)), while cexp takes a complex argument z and returns
a complex result exp(real(z))*(cos(imag(z)),sin(imag(z))), so the correct
definition of cexpi should be:

cexpi(x)=cexp(complex(0,x))

Is this correct? If yes what should be done to implement this behavior?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31161


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