Browse Source

Fixed GCC build issue on new alignment types. More simd stuff to vec4

Christophe Riccio 11 years ago
parent
commit
117634c7ea
3 changed files with 31 additions and 5 deletions
  1. 1 2
      glm/detail/func_common.inl
  2. 1 1
      glm/detail/setup.hpp
  3. 29 2
      glm/detail/type_vec4.hpp

+ 1 - 2
glm/detail/func_common.inl

@@ -526,9 +526,8 @@ namespace detail
 		return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
 	}
 
-	// TODO: Not working on MinGW...
 #	if GLM_HAS_CXX11_STL
-		usign std::isnan;
+		using std::isnan;
 #	else
 		template <typename genType> 
 		GLM_FUNC_QUALIFIER bool isnan(genType x)

+ 1 - 1
glm/detail/setup.hpp

@@ -749,7 +749,7 @@
 #	define GLM_DEPRECATED __attribute__((__deprecated__))
 #	define GLM_ALIGN(x) __attribute__((aligned(x)))
 #	define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))
-#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(x)))
+#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
 #	define GLM_RESTRICT __restrict__
 #	define GLM_RESTRICT_VAR __restrict__
 #else

+ 29 - 2
glm/detail/type_vec4.hpp

@@ -49,21 +49,48 @@ namespace detail
 		typedef T type[4];
 	};
 
-#	if(GLM_ARCH & GLM_ARCH_SSE2)
+#	if GLM_ARCH & GLM_ARCH_SSE2
 		template <>
 		struct simd<float>
 		{
 			typedef __m128 type;
 		};
+
+		template <>
+		struct simd<int>
+		{
+			typedef __m128i type;
+		};
+
+		template <>
+		struct simd<unsigned int>
+		{
+			typedef __m128i type;
+		};
 #	endif
 
-#	if(GLM_ARCH & GLM_ARCH_AVX)
+#	if GLM_ARCH & GLM_ARCH_AVX
 		template <>
 		struct simd<double>
 		{
 			typedef __m256d type;
 		};
 #	endif
+
+#	if GLM_ARCH & GLM_ARCH_AVX2
+		template <>
+		struct simd<int64>
+		{
+			typedef __m256i type;
+		};
+
+		template <>
+		struct simd<uint64>
+		{
+			typedef __m256i type;
+		};
+#	endif
+
 }//namespace detail
 
 	template <typename T, precision P = defaultp>