Detect SSE4.1 support better when compiling.

This commit is contained in:
Unknown W. Brackets 2015-02-25 19:53:31 -08:00
parent 647e841959
commit 945ff359b2

View File

@ -46,6 +46,9 @@ inline __m128 SSENormalizeMultiplierSSE2(__m128 v)
return _mm_shuffle_ps(rt, rt, _MM_SHUFFLE(0, 0, 0, 0)); return _mm_shuffle_ps(rt, rt, _MM_SHUFFLE(0, 0, 0, 0));
} }
#if _M_SSE >= 0x401
#include <smmintrin.h>
inline __m128 SSENormalizeMultiplierSSE4(__m128 v) inline __m128 SSENormalizeMultiplierSSE4(__m128 v)
{ {
return _mm_rsqrt_ps(_mm_dp_ps(v, v, 0xFF)); return _mm_rsqrt_ps(_mm_dp_ps(v, v, 0xFF));
@ -57,6 +60,13 @@ inline __m128 SSENormalizeMultiplier(bool useSSE4, __m128 v)
return SSENormalizeMultiplierSSE4(v); return SSENormalizeMultiplierSSE4(v);
return SSENormalizeMultiplierSSE2(v); return SSENormalizeMultiplierSSE2(v);
} }
#else
inline __m128 SSENormalizeMultiplier(bool useSSE4, __m128 v)
{
return SSENormalizeMultiplierSSE2(v);
}
#endif
#endif #endif