[Bug middle-end/31249] pseudo-optimzation with sincos/cexpi

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Mar 19 10:43:00 GMT 2007



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-03-19 10:43 -------
There is no option to turn it off.  But for !TARGET_C99_FUNCTIONS and
!TARGET_HAS_SINCOS targets it's off.  Usually (in fact, for every libm I looked
into), cexp is implemented as

complex double cexp (complex double x)
{
  double cos = cos (imag(x));
  double sin = sin (imag(x));
  double e = 1;
  if (real(x) != 0)
    e = exp (real(x));
...

possibly computing cos and sin in an efficient way (using sincos).  So
cexp () should be never slower than calling sin () and cos ().  If the ABI
were not stupid of course ;)

Does darwin have a sincos() library function?


-- 


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



More information about the Gcc-bugs mailing list