diff -r f6a72eb99631 -r 9d66d323c354 include/common.h --- a/include/common.h Tue Apr 29 23:31:08 2008 +0200 +++ b/include/common.h Fri May 02 13:27:47 2008 +0200 @@ -33,9 +33,6 @@ #include #include -// SSE intrinsics -#include - using namespace std; #ifdef PYRIT_DOUBLE @@ -48,13 +45,27 @@ # define Inf FLT_MAX #endif +#ifndef NO_SSE +// SSE intrinsics +#include + 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 + /* verbosity level: 0: only errors (E) 1: major status messages (*)