Browse Source

Removed SSE tests

Christophe Riccio 12 years ago
parent
commit
9841d2a2b4
4 changed files with 35 additions and 25 deletions
  1. 20 0
      glm/core/dummy.cpp
  2. 3 2
      glm/core/type_mat4x4.inl
  3. 12 15
      glm/core/type_vec4.hpp
  4. 0 8
      glm/core/type_vec4.inl

+ 20 - 0
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);

+ 3 - 2
glm/core/type_mat4x4.inl

@@ -708,6 +708,7 @@ namespace detail
 		typename tmat4x4<T, P>::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<T, P>::col_type(a2);
-/*
+*/
+
 		tmat4x4<T, P>::col_type const Mov0(v[0]);
 		tmat4x4<T, P>::col_type const Mov1(v[1]);
 		tmat4x4<T, P>::col_type const Mul0 = m[0] * Mov0;
@@ -737,7 +739,6 @@ namespace detail
 		tmat4x4<T, P>::col_type const Add1 = Mul2 * Mul3;
 		tmat4x4<T, P>::col_type const Add2 = Add0 * Add1;
 		return Add2;
-*/
 
 /*
 		return typename tmat4x4<T, P>::col_type(

+ 12 - 15
glm/core/type_vec4.hpp

@@ -37,7 +37,7 @@ namespace glm{
 namespace detail
 {
 	template <typename T, precision P>
-	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

+ 0 - 8
glm/core/type_vec4.inl

@@ -115,14 +115,6 @@ namespace detail
 		w(s4)
 	{}
 
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
-	(
-		__m128 const & v
-	) :
-		data(v)
-	{}
-
 	//////////////////////////////////////
 	// Swizzle constructors