| @@ -59,6 +59,11 @@ AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);], | |||||
| [AC_MSG_RESULT(yes) | [AC_MSG_RESULT(yes) | ||||
| AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])], | AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])], | ||||
| [AC_MSG_RESULT(no)]) | [AC_MSG_RESULT(no)]) | ||||
| AC_MSG_CHECKING(for fsin/fcos) | |||||
| AC_TRY_COMPILE([],[asm("fsin\n\tfcos");], | |||||
| [AC_MSG_RESULT(yes) | |||||
| AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the `fsin' and `fcos' operands.])], | |||||
| [AC_MSG_RESULT(no)]) | |||||
| AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") | AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") | ||||
| CACA_DRIVERS="" | CACA_DRIVERS="" | ||||
| @@ -227,6 +227,9 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) | |||||
| double cos(double x) | double cos(double x) | ||||
| { | { | ||||
| double ret = 0.0; | double ret = 0.0; | ||||
| #ifdef HAVE_FSIN_FCOS | |||||
| asm volatile("fcos" : "=t" (ret) : "0" (x)); | |||||
| #else | |||||
| double x2; | double x2; | ||||
| double num = 1.0; | double num = 1.0; | ||||
| double fact = 1.0; | double fact = 1.0; | ||||
| @@ -242,13 +245,16 @@ double cos(double x) | |||||
| num *= - x2; | num *= - x2; | ||||
| fact *= (2 * i + 1) * (2 * i + 2); | fact *= (2 * i + 1) * (2 * i + 2); | ||||
| } | } | ||||
| #endif | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| double sin(double x) | double sin(double x) | ||||
| { | { | ||||
| double ret = 0.0; | double ret = 0.0; | ||||
| #ifdef HAVE_FSIN_FCOS | |||||
| asm volatile("fsin" : "=t" (ret) : "0" (x)); | |||||
| #else | |||||
| double x2; | double x2; | ||||
| double num; | double num; | ||||
| double fact = 1.0; | double fact = 1.0; | ||||
| @@ -265,7 +271,7 @@ double sin(double x) | |||||
| num *= - x2; | num *= - x2; | ||||
| fact *= (2 * i + 2) * (2 * i + 3); | fact *= (2 * i + 2) * (2 * i + 3); | ||||
| } | } | ||||
| #endif | |||||
| return ret; | return ret; | ||||
| } | } | ||||