always use USE_SSE3_LDDQU on Windows+MSVC, and also on GCC when __SSE3__ is defined
This commit is contained in:
@@ -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)
|
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 );
|
quat = Quat( SSEFloat(_mm_lddqu_si128((const __m128i*)((float*)(fptr)))).m128 );
|
||||||
#else
|
#else
|
||||||
SSEFloat fl;
|
SSEFloat fl;
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ VECTORMATH_FORCE_INLINE __m128 Vector3::get128( ) const
|
|||||||
|
|
||||||
VECTORMATH_FORCE_INLINE void loadXYZ(Vector3& vec, const float* fptr)
|
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 );
|
vec = Vector3( SSEFloat(_mm_lddqu_si128((const __m128i*)((float*)(fptr)))).m128 );
|
||||||
#else
|
#else
|
||||||
SSEFloat fl;
|
SSEFloat fl;
|
||||||
@@ -340,7 +340,7 @@ VECTORMATH_FORCE_INLINE void loadXYZ(Vector3& vec, const float* fptr)
|
|||||||
fl.f[2] = fptr[2];
|
fl.f[2] = fptr[2];
|
||||||
fl.f[3] = fptr[3];
|
fl.f[3] = fptr[3];
|
||||||
vec = Vector3( fl.m128);
|
vec = Vector3( fl.m128);
|
||||||
#endif //USE_SSE2_LDDQU
|
#endif //USE_SSE3_LDDQU
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
#define Matrix3Ref Matrix3&
|
#define Matrix3Ref Matrix3&
|
||||||
|
|
||||||
#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400)
|
#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_ALIGNED_CLASS16(a) __declspec(align(16)) a
|
||||||
#define VM_ATTRIBUTE_ALIGN16 __declspec(align(16))
|
#define VM_ATTRIBUTE_ALIGN16 __declspec(align(16))
|
||||||
#define VECTORMATH_FORCE_INLINE __forceinline
|
#define VECTORMATH_FORCE_INLINE __forceinline
|
||||||
@@ -48,14 +50,15 @@
|
|||||||
#define VM_ATTRIBUTE_ALIGNED_CLASS16(a) a __attribute__ ((aligned (16)))
|
#define VM_ATTRIBUTE_ALIGNED_CLASS16(a) a __attribute__ ((aligned (16)))
|
||||||
#define VM_ATTRIBUTE_ALIGN16 __attribute__ ((aligned (16)))
|
#define VM_ATTRIBUTE_ALIGN16 __attribute__ ((aligned (16)))
|
||||||
#define VECTORMATH_FORCE_INLINE inline
|
#define VECTORMATH_FORCE_INLINE inline
|
||||||
|
#ifdef __SSE3__
|
||||||
|
#define USE_SSE3_LDDQU
|
||||||
|
#endif //__SSE3__
|
||||||
#endif//_WIN32
|
#endif//_WIN32
|
||||||
|
|
||||||
#ifdef __SSE3__
|
|
||||||
#define USE_SSE2_LDDQU
|
#ifdef USE_SSE3_LDDQU
|
||||||
#ifdef USE_SSE2_LDDQU
|
|
||||||
#include <pmmintrin.h>//_mm_lddqu_si128
|
#include <pmmintrin.h>//_mm_lddqu_si128
|
||||||
#endif //USE_SSE2_LDDQU
|
#endif //USE_SSE3_LDDQU
|
||||||
#endif //__SSE3__
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: Tidy
|
// TODO: Tidy
|
||||||
|
|||||||
Reference in New Issue
Block a user