From d7862e4bb5d58415dd8697b99f85969759dea7b6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 14 Jan 2014 14:07:09 +0100 Subject: [PATCH] Fixed SSE code included in GLM tests on pure platforms --- readme.txt | 1 + test/gtx/gtx_bit.cpp | 14 +++++++++----- test/gtx/gtx_int_10_10_10_2.cpp | 3 --- test/gtx/gtx_mixed_product.cpp | 3 --- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/readme.txt b/readme.txt index e55a3272..336edf43 100644 --- a/readme.txt +++ b/readme.txt @@ -41,6 +41,7 @@ GLM 0.9.5.2: 2014-0X-XX -------------------------------------------------------------------------------- - Fixed warnings with the Android NDK 9c - Fixed non power of two matrix products +- Fixed SSE code included in GLM tests on "pure" platforms ================================================================================ GLM 0.9.5.1: 2014-01-11 diff --git a/test/gtx/gtx_bit.cpp b/test/gtx/gtx_bit.cpp index d3ec857a..34e80364 100644 --- a/test/gtx/gtx_bit.cpp +++ b/test/gtx/gtx_bit.cpp @@ -11,7 +11,6 @@ #include #include -#include #if(GLM_ARCH != GLM_ARCH_PURE) # include #endif @@ -152,6 +151,7 @@ namespace bitfieldInterleave return REG1 | (REG2 << 1); } +#if(GLM_ARCH != GLM_ARCH_PURE) inline glm::uint64 sseBitfieldInterleave(glm::uint32 x, glm::uint32 y) { GLM_ALIGN(16) glm::uint32 const Array[4] = {x, 0, y, 0}; @@ -267,6 +267,7 @@ namespace bitfieldInterleave return Result[0]; } +#endif//(GLM_ARCH != GLM_ARCH_PURE) int test() { @@ -287,16 +288,17 @@ namespace bitfieldInterleave glm::uint64 B = fastBitfieldInterleave(x, y); glm::uint64 C = loopBitfieldInterleave(x, y); glm::uint64 D = interleaveBitfieldInterleave(x, y); - glm::uint64 E = sseBitfieldInterleave(x, y); - glm::uint64 F = sseUnalignedBitfieldInterleave(x, y); assert(A == B); assert(A == C); assert(A == D); - assert(A == E); - assert(A == F); # if(GLM_ARCH != GLM_ARCH_PURE) + glm::uint64 E = sseBitfieldInterleave(x, y); + glm::uint64 F = sseUnalignedBitfieldInterleave(x, y); + assert(A == E); + assert(A == F); + __m128i G = glm::detail::_mm_bit_interleave_si128(_mm_set_epi32(0, y, 0, x)); glm::uint64 Result[2]; _mm_storeu_si128((__m128i*)Result, G); @@ -366,6 +368,7 @@ namespace bitfieldInterleave std::cout << "interleaveBitfieldInterleave Time " << Time << " clocks" << std::endl; } +# if(GLM_ARCH != GLM_ARCH_PURE) { std::clock_t LastTime = std::clock(); @@ -387,6 +390,7 @@ namespace bitfieldInterleave std::cout << "sseUnalignedBitfieldInterleave Time " << Time << " clocks" << std::endl; } +# endif//(GLM_ARCH != GLM_ARCH_PURE) { std::clock_t LastTime = std::clock(); diff --git a/test/gtx/gtx_int_10_10_10_2.cpp b/test/gtx/gtx_int_10_10_10_2.cpp index 65ae56c8..ab59bb2f 100644 --- a/test/gtx/gtx_int_10_10_10_2.cpp +++ b/test/gtx/gtx_int_10_10_10_2.cpp @@ -7,9 +7,6 @@ // File : test/gtx/associated_min_max.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#include - -#include #include #include diff --git a/test/gtx/gtx_mixed_product.cpp b/test/gtx/gtx_mixed_product.cpp index 65ae56c8..ab59bb2f 100644 --- a/test/gtx/gtx_mixed_product.cpp +++ b/test/gtx/gtx_mixed_product.cpp @@ -7,9 +7,6 @@ // File : test/gtx/associated_min_max.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#include - -#include #include #include