Browse Source

Added error message if included without SSE support

Christophe Riccio 15 years ago
parent
commit
83809b1066

+ 6 - 3
glm/core/intrinsic_common.hpp

@@ -12,10 +12,13 @@
 
 #include "../setup.hpp"
 
-//#if(GLM_ARCH >= GLM_ARCH_SSE2)
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
 
 namespace glm{
-namespace detail{
+namespace detail
+{
 	__m128 sse_abs_ps(__m128 x);
 
 	__m128 sse_sgn_ps(__m128 x);
@@ -63,5 +66,5 @@ namespace detail{
 
 #include "intrinsic_common.inl"
 
-//#endif//(GLM_ARCH >= GLM_ARCH_SSE2)
+#endif//GLM_ARCH
 #endif//glm_detail_intrinsic_common

+ 4 - 2
glm/core/intrinsic_exponential.hpp

@@ -12,7 +12,9 @@
 
 #include "../setup.hpp"
 
-#if(GLM_ARCH != GLM_ARCH_PURE)
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
 
 namespace glm{
 namespace detail
@@ -54,5 +56,5 @@ inline __m128 sse_normalize_fast_ps(  float * RESTRICT vOut, float * RESTRICT vI
 }//namespace detail
 }//namespace glm
 
-#endif//GLM_ARCH != GLM_ARCH_PURE)
+#endif//GLM_ARCH
 #endif//glm_detail_intrinsic_exponential

+ 7 - 0
glm/core/intrinsic_geometric.hpp

@@ -10,6 +10,12 @@
 #ifndef glm_core_intrinsic_geometric
 #define glm_core_intrinsic_geometric
 
+#include "../setup.hpp"
+
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
+
 #include "intrinsic_common.hpp"
 
 namespace glm{
@@ -47,4 +53,5 @@ namespace detail
 
 #include "intrinsic_geometric.inl"
 
+#endif//GLM_ARCH
 #endif//glm_core_intrinsic_geometric

+ 7 - 0
glm/core/intrinsic_matrix.hpp

@@ -10,6 +10,12 @@
 #ifndef glm_detail_intrinsic_matrix
 #define glm_detail_intrinsic_matrix
 
+#include "../setup.hpp"
+
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
+
 #include "intrinsic_geometric.hpp"
 
 namespace glm{
@@ -40,4 +46,5 @@ namespace detail
 
 #include "intrinsic_matrix.inl"
 
+#endif//GLM_ARCH
 #endif//glm_detail_intrinsic_matrix

+ 5 - 0
glm/core/intrinsic_trigonometric.hpp

@@ -12,6 +12,10 @@
 
 #include "../setup.hpp"
 
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
+
 namespace glm{
 namespace detail
 {
@@ -21,4 +25,5 @@ namespace detail
 
 #include "intrinsic_trigonometric.inl"
 
+#endif//GLM_ARCH
 #endif//glm_detail_intrinsic_trigonometric

+ 5 - 0
glm/core/intrinsic_vector_relational.hpp

@@ -12,6 +12,10 @@
 
 #include "../setup.hpp"
 
+#if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2)
+#	error "SSE2 instructions not supported or enabled"
+#else
+
 namespace glm{
 namespace detail
 {
@@ -21,4 +25,5 @@ namespace detail
 
 #include "intrinsic_vector_relational.inl"
 
+#endif//GLM_ARCH
 #endif//glm_detail_intrinsic_vector_relational