From 9841d2a2b443567da497ac7257bba558519292f4 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 11 May 2013 22:40:02 +0200 Subject: [PATCH] Removed SSE tests --- glm/core/dummy.cpp | 20 ++++++++++++++++++++ glm/core/type_mat4x4.inl | 5 +++-- glm/core/type_vec4.hpp | 27 ++++++++++++--------------- glm/core/type_vec4.inl | 8 -------- 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/glm/core/dummy.cpp b/glm/core/dummy.cpp index bc041620..88502490 100644 --- a/glm/core/dummy.cpp +++ b/glm/core/dummy.cpp @@ -32,6 +32,26 @@ #define GLM_MESSAGES #include "../glm.hpp" +struct float4 +{ + union + { + struct {float r, g, b, a;}; + struct {float s, t, p, q;}; + struct {float x, y, z, w;}; + __m128 data; + }; +}; + +int test_simd() +{ + float4 f; + + + + return 0; +} + int main() { glm::mat4 A(1.0f); diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index 74865095..df911608 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -708,6 +708,7 @@ namespace detail typename tmat4x4::row_type const & v ) { +/* __m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0)); __m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1)); __m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); @@ -724,7 +725,8 @@ namespace detail __m128 a2 = _mm_add_ps(a0, a1); return typename tmat4x4::col_type(a2); -/* +*/ + tmat4x4::col_type const Mov0(v[0]); tmat4x4::col_type const Mov1(v[1]); tmat4x4::col_type const Mul0 = m[0] * Mov0; @@ -737,7 +739,6 @@ namespace detail tmat4x4::col_type const Add1 = Mul2 * Mul3; tmat4x4::col_type const Add2 = Add0 * Add1; return Add2; -*/ /* return typename tmat4x4::col_type( diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 38adbb05..e773c8d0 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -37,7 +37,7 @@ namespace glm{ namespace detail { template - struct tvec4 + struct __declspec(align(16)) tvec4 { enum ctor{_null}; @@ -54,22 +54,21 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_CXXMS) union { -# if(defined(GLM_SWIZZLE)) - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a) - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q) -# endif//(defined(GLM_SWIZZLE)) +# if(defined(GLM_SWIZZLE)) + _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) + _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a) + _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q) + _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w) + _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a) + _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q) + _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w) + _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a) + _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q) +# endif//(defined(GLM_SWIZZLE)) struct {value_type r, g, b, a;}; struct {value_type s, t, p, q;}; struct {value_type x, y, z, w;}; - __m128 data; }; # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) union {value_type x, r, s;}; @@ -116,8 +115,6 @@ namespace detail value_type const & s1, value_type const & s2, value_type const & s3); - GLM_FUNC_DECL explicit tvec4( - __m128 const & v); ////////////////////////////////////// // Convertion scalar constructors diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 5af25212..f8df571d 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -115,14 +115,6 @@ namespace detail w(s4) {} - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - __m128 const & v - ) : - data(v) - {} - ////////////////////////////////////// // Swizzle constructors