This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL 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]

sincos as a macro


GSL community,

I have stumbled upon multiple occurances of

  *x = cos (t);
  *y = sin (t);

As far as I know even -ffast-math does not yet calls for fsincos i87 
instruction. I often use a dangerous macro and call gcc -DWITH_SINCOS. 

/* intentionally dangerous internal macro */
#ifndef WITH_SINCOS
# define sin_cos(si, co, x)     si = sin(x); co = cos(x)
#else
# define sin_cos(si, co, x)     asm ("fsincos" : "=t" (co), "=u" (si) : "0" (x))
#endif

or one can come up with a function. What are the plans in GSL for this 
worthy optimization?

Alexei
 





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