From: W Menn <willus0@ho...> - 2003-09-27 17:02:36
Never mind. I solved my own problem. See code below. It runs in 1.3
seconds on a 1 GHz P3 compared to 2.0 seconds when sine and cosine are
called separately. Cool!
extern __inline__ void sincos (double x,double *s,double *c)
__asm__ ("fsincos;" : "=t" (cc), "=u" (ss) : "0" (x));
sum += x+y;
printf("sum = %g\n",sum);
printf("CPU time = %g seconds.\n",(double)(stop-start)/CLOCKS_PER_SEC);
----Original Message Follows----
I have a lot of code that makes consecutive calls to sin() and cos() with
the same argument. I am just realizing that most x386 chips have an
intrinsic function, FSINCOS, which quickly calculates both of these values
together. Does anybody know how I can make use of this from a C program in
mingw (inline?). Are there any MS (or other) DLL's that access it?
Get MSN 8 Dial-up Internet Service FREE for one month. Limited time offer--
sign up now! http://join.msn.com/?page=dept/dialup
Get latest updates about Open Source Projects, Conferences and News.