diff --git a/glm/detail/intrinsic_geometric.inl b/glm/detail/intrinsic_geometric.inl index f46f140b..ad33571c 100644 --- a/glm/detail/intrinsic_geometric.inl +++ b/glm/detail/intrinsic_geometric.inl @@ -48,7 +48,7 @@ GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1) //dot GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2) { -# if((GLM_ARCH & GLM_ARCH_SSE4) == GLM_ARCH_SSE4) +# if((GLM_ARCH & GLM_ARCH_AVX) == GLM_ARCH_AVX) return _mm_dp_ps(v1, v2, 0xff); # else __m128 mul0 = _mm_mul_ps(v1, v2); diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index dfe71a8d..958a323c 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -38,7 +38,7 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 5 -#define GLM_VERSION_REVISION 2 +#define GLM_VERSION_REVISION 3 /////////////////////////////////////////////////////////////////////////////////////////////////// // Platform @@ -550,9 +550,8 @@ #define GLM_ARCH_PURE 0x0000 #define GLM_ARCH_SSE2 0x0001 #define GLM_ARCH_SSE3 0x0002// | GLM_ARCH_SSE2 -#define GLM_ARCH_SSE4 0x0004// | GLM_ARCH_SSE3 | GLM_ARCH_SSE2 -#define GLM_ARCH_AVX 0x0008// | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2 -#define GLM_ARCH_AVX2 0x0010// | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2 +#define GLM_ARCH_AVX 0x0008// | GLM_ARCH_SSE3 | GLM_ARCH_SSE2 +#define GLM_ARCH_AVX2 0x0010// | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2 #if(defined(GLM_FORCE_PURE)) # define GLM_ARCH GLM_ARCH_PURE @@ -560,8 +559,6 @@ # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif(defined(GLM_FORCE_AVX)) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif(defined(GLM_FORCE_SSE4)) -# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif(defined(GLM_FORCE_SSE3)) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif(defined(GLM_FORCE_SSE2)) @@ -572,17 +569,22 @@ # elif _M_IX86_FP == 2 # define GLM_ARCH (GLM_ARCH_SSE2) # else -# define GLM_ARCH GLM_ARCH_PURE +# define GLM_ARCH (GLM_ARCH_PURE) # endif #elif((GLM_PLATFORM & GLM_PLATFORM_APPLE) && (GLM_COMPILER & GLM_COMPILER_GCC)) # define GLM_ARCH GLM_ARCH_PURE #elif(((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) || (GLM_COMPILER & GLM_COMPILER_LLVM_GCC)) -# define GLM_ARCH (GLM_ARCH_PURE \ -| (defined(__AVX2__) ? GLM_ARCH_AVX2 : 0) \ -| (defined(__AVX__) ? GLM_ARCH_AVX : 0) \ -| (defined(__SSE4__) ? GLM_ARCH_SSE4 : 0) \ -| (defined(__SSE3__) ? GLM_ARCH_SSE3 : 0) \ -| (defined(__SSE2__) ? GLM_ARCH_SSE2 : 0)) +# if defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE3__) +# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE2__) +# define GLM_ARCH (GLM_ARCH_SSE2) +# else +# define GLM_ARCH (GLM_ARCH_PURE) +# endif #else # define GLM_ARCH GLM_ARCH_PURE #endif diff --git a/readme.txt b/readme.txt index 432aa173..3dfa4ff4 100644 --- a/readme.txt +++ b/readme.txt @@ -42,6 +42,7 @@ GLM 0.9.5.3: 2014-0X-XX - Added instruction set auto detection with Visual C++ using _M_IX86_FP - /arch compiler argument. - Fixed GTX_raw_data code dependency +- Fixed GCC instruction set detection. ================================================================================ GLM 0.9.5.2: 2014-02-08