Added AVX optimizations and equal tests

This commit is contained in:
Christophe Riccio
2016-05-30 14:23:58 +02:00
parent d69616bbc8
commit 52f8ecd973
5 changed files with 102 additions and 4 deletions

View File

@@ -83,11 +83,12 @@ int test_vec4_swizzle()
glm::vec4 B = A.wzyx();
glm::vec4 C = B.wzyx();
float f = glm::dot(C.wzyx(), C.xyzw());
Error += A != B ? 0 : 1;
Error += A == C ? 0 : 1;
float f = glm::dot(C.wzyx(), C.xyzw());
Error += glm::abs(f - 20.f) < 0.01f ? 0 : 1;
return Error;
}

View File

@@ -310,6 +310,27 @@ int test_vec4_operators()
return Error;
}
int test_vec4_equal()
{
int Error = 0;
{
glm::vec4 const A(1, 2, 3, 4);
glm::vec4 const B(1, 2, 3, 4);
Error += A == B ? 0 : 1;
Error += A != B ? 1 : 0;
}
{
glm::ivec4 const A(1, 2, 3, 4);
glm::ivec4 const B(1, 2, 3, 4);
Error += A == B ? 0 : 1;
Error += A != B ? 1 : 0;
}
return Error;
}
int test_vec4_size()
{
int Error = 0;
@@ -557,6 +578,7 @@ int main()
Error += test_bvec4_ctor();
Error += test_vec4_size();
Error += test_vec4_operators();
Error += test_vec4_equal();
Error += test_vec4_swizzle_partial();
Error += test_vec4_simd();
Error += test_operator_increment();