This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
sincos as a macro
- From: Alexei Podtelezhnikov <apodtele at mccammon dot ucsd dot edu>
- To: gsl-discuss at sources dot redhat dot com
- Date: Wed, 21 Apr 2004 11:47:04 -0700 (PDT)
- Subject: 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