--- a/include/common.h Fri May 02 13:27:47 2008 +0200
+++ b/include/common.h Mon May 05 15:31:14 2008 +0200
@@ -27,8 +27,11 @@
#ifndef COMMON_H
#define COMMON_H
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
+#include <math.h>
#include <float.h>
#include <pthread.h>
#include <string>
@@ -41,30 +44,12 @@
# define Inf DBL_MAX
#else
# define Float float
-# define Eps 1e-6
+# define Eps 1e-6f
# define Inf FLT_MAX
#endif
-#ifndef NO_SSE
-// SSE intrinsics
-#include <xmmintrin.h>
-
-const __m128 mZero = _mm_set_ps1(0.);
-const __m128 mOne = _mm_set_ps1(1.);
-const __m128 mTwo = _mm_set_ps1(2.);
-const __m128 mEps = _mm_set_ps1(Eps);
-const __m128 mMEps = _mm_set_ps1(-Eps);
-const __m128 mInf = _mm_set_ps1(Inf);
-const __m128 mAllSet = _mm_cmplt_ps(mZero, mOne);
-
-inline const __m128 _mm_fastpow(const __m128& base, const __m128& exponent)
-{
- __m128 denom = _mm_mul_ps( exponent, base);
- denom = _mm_sub_ps( exponent, denom);
- denom = _mm_add_ps( base, denom);
- return _mm_mul_ps( base, _mm_rcp_ps(denom));
-}
-#endif
+// enable M_* constants in MSVC
+#define _USE_MATH_DEFINES
/* verbosity level:
0: only errors (E)