Skip to content

Commit

Permalink
Fixed SSE code included in GLM tests on pure platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Jan 14, 2014
1 parent dd272c5 commit d7862e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions test/gtx/gtx_bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <glm/gtx/bit.hpp>
#include <glm/gtc/type_precision.hpp>

#include <emmintrin.h>
#if(GLM_ARCH != GLM_ARCH_PURE)
# include <glm/detail/intrinsic_integer.hpp>
#endif
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -267,6 +267,7 @@ namespace bitfieldInterleave

return Result[0];
}
#endif//(GLM_ARCH != GLM_ARCH_PURE)

int test()
{
Expand All @@ -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);
Expand Down Expand Up @@ -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();

Expand All @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions test/gtx/gtx_int_10_10_10_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////

#include <emmintrin.h>

#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/associated_min_max.hpp>

Expand Down
3 changes: 0 additions & 3 deletions test/gtx/gtx_mixed_product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////

#include <emmintrin.h>

#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/associated_min_max.hpp>

Expand Down

0 comments on commit d7862e4

Please sign in to comment.