always use USE_SSE3_LDDQU on Windows+MSVC, and also on GCC when __SSE3__ is defined

This commit is contained in:
erwin.coumans
2011-02-27 06:20:35 +00:00
parent cb7f4a9728
commit d2502f80e3
3 changed files with 11 additions and 8 deletions

View File

@@ -530,7 +530,7 @@ VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1,
VECTORMATH_FORCE_INLINE void loadXYZW(Quat& quat, const float* fptr)
{
#ifdef USE_SSE2_LDDQU
#ifdef USE_SSE3_LDDQU
quat = Quat( SSEFloat(_mm_lddqu_si128((const __m128i*)((float*)(fptr)))).m128 );
#else
SSEFloat fl;

View File

@@ -331,7 +331,7 @@ VECTORMATH_FORCE_INLINE __m128 Vector3::get128( ) const
VECTORMATH_FORCE_INLINE void loadXYZ(Vector3& vec, const float* fptr)
{
#ifdef USE_SSE2_LDDQU
#ifdef USE_SSE3_LDDQU
vec = Vector3( SSEFloat(_mm_lddqu_si128((const __m128i*)((float*)(fptr)))).m128 );
#else
SSEFloat fl;
@@ -340,7 +340,7 @@ VECTORMATH_FORCE_INLINE void loadXYZ(Vector3& vec, const float* fptr)
fl.f[2] = fptr[2];
fl.f[3] = fptr[3];
vec = Vector3( fl.m128);
#endif //USE_SSE2_LDDQU
#endif //USE_SSE3_LDDQU
}

View File

@@ -41,6 +41,8 @@
#define Matrix3Ref Matrix3&
#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400)
#define USE_SSE3_LDDQU
#define VM_ATTRIBUTE_ALIGNED_CLASS16(a) __declspec(align(16)) a
#define VM_ATTRIBUTE_ALIGN16 __declspec(align(16))
#define VECTORMATH_FORCE_INLINE __forceinline
@@ -48,14 +50,15 @@
#define VM_ATTRIBUTE_ALIGNED_CLASS16(a) a __attribute__ ((aligned (16)))
#define VM_ATTRIBUTE_ALIGN16 __attribute__ ((aligned (16)))
#define VECTORMATH_FORCE_INLINE inline
#ifdef __SSE3__
#define USE_SSE3_LDDQU
#endif //__SSE3__
#endif//_WIN32
#ifdef __SSE3__
#define USE_SSE2_LDDQU
#ifdef USE_SSE2_LDDQU
#ifdef USE_SSE3_LDDQU
#include <pmmintrin.h>//_mm_lddqu_si128
#endif //USE_SSE2_LDDQU
#endif //__SSE3__
#endif //USE_SSE3_LDDQU
// TODO: Tidy