Fixed 32-bits build #528 #529, fixed VC 32 bits crash

This commit is contained in:
Christophe Riccio 2016-08-07 12:42:45 +02:00
parent e671d50e05
commit 0dbdf3fad4
3 changed files with 32 additions and 7 deletions

View File

@ -190,7 +190,7 @@ namespace detail
# if GLM_ARCH == GLM_ARCH_X86
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
struct compute_sign<T, P, vecType, Aligned>
struct compute_sign<T, P, vecType, false, Aligned>
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
{

View File

@ -955,12 +955,37 @@ namespace sign
return Error;
}
int test_f32vec4()
{
type<glm::vec4> const Data[] =
{
{glm::vec4( 1), glm::vec4( 1)},
{glm::vec4( 0), glm::vec4( 0)},
{glm::vec4( 2), glm::vec4( 1)},
{glm::vec4( 3), glm::vec4( 1)},
{glm::vec4(-1), glm::vec4(-1)},
{glm::vec4(-2), glm::vec4(-1)},
{glm::vec4(-3), glm::vec4(-1)}
};
int Error = 0;
for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::vec4>); ++i)
{
glm::vec4 Result = glm::sign(Data[i].Value);
Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1;
}
return Error;
}
int test()
{
int Error = 0;
Error += test_int32();
Error += test_i32vec4();
Error += test_f32vec4();
return Error;
}

View File

@ -318,7 +318,7 @@ namespace bitfieldInterleave
return REG1 | (REG2 << 1);
}
/*
inline glm::uint64 loopBitfieldInterleave(glm::uint32 x, glm::uint32 y)
{
static glm::uint64 const Mask[5] =
@ -340,7 +340,7 @@ namespace bitfieldInterleave
return REG1 | (REG2 << 1);
}
*/
#if(GLM_ARCH != GLM_ARCH_PURE)
inline glm::uint64 sseBitfieldInterleave(glm::uint32 x, glm::uint32 y)
{
@ -467,11 +467,11 @@ namespace bitfieldInterleave
{
glm::uint64 A = glm::bitfieldInterleave(x, y);
glm::uint64 B = fastBitfieldInterleave(x, y);
glm::uint64 C = loopBitfieldInterleave(x, y);
//glm::uint64 C = loopBitfieldInterleave(x, y);
glm::uint64 D = interleaveBitfieldInterleave(x, y);
assert(A == B);
assert(A == C);
//assert(A == C);
assert(A == D);
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
@ -540,7 +540,7 @@ namespace bitfieldInterleave
std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast<unsigned int>(Time));
}
/*
{
std::clock_t LastTime = std::clock();
@ -551,7 +551,7 @@ namespace bitfieldInterleave
std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast<unsigned int>(Time));
}
*/
{
std::clock_t LastTime = std::clock();