Merge branch 'trivial' into bitfield
This commit is contained in:
@@ -866,7 +866,7 @@ namespace sign
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
std::size_t const Count = 1000000000;
|
||||
std::size_t const Count = 10000000;
|
||||
std::vector<glm::int32> Input, Output;
|
||||
Input.resize(Count);
|
||||
Output.resize(Count);
|
||||
@@ -913,7 +913,7 @@ namespace sign
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
std::size_t const Count = 1000000000;
|
||||
std::size_t const Count = 10000000;
|
||||
std::vector<glm::int32> Input, Output;
|
||||
Input.resize(Count);
|
||||
Output.resize(Count);
|
||||
@@ -960,7 +960,7 @@ namespace sign
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::uint32 const Count = 1000000000;
|
||||
glm::uint32 const Count = 10000000;
|
||||
|
||||
std::clock_t Timestamp0 = std::clock();
|
||||
glm::int32 Sum = 0;
|
||||
|
||||
@@ -37,11 +37,12 @@ namespace bitfieldInsert
|
||||
|
||||
typeU32 const Data32[] =
|
||||
{
|
||||
{0x00000000, 0xffffffff, 0, 31, 0x7fffffff},
|
||||
{0x00000000, 0xffffffff, 0, 32, 0xffffffff},
|
||||
{0x00000000, 0xffffffff, 0, 0, 0x00000000},
|
||||
{0xff000000, 0x0000ff00, 8, 8, 0xff00ff00},
|
||||
{0xffff0000, 0x0000ffff, 16, 16, 0x00000000},
|
||||
{0x0000ffff, 0xffff0000, 16, 16, 0xffffffff},
|
||||
{0x00000000, 0xffffffff, 0, 32, 0xffffffff},
|
||||
{0x00000000, 0xffffffff, 0, 0, 0x00000000}
|
||||
{0x0000ffff, 0xffff0000, 16, 16, 0xffffffff}
|
||||
};
|
||||
|
||||
int test()
|
||||
@@ -664,7 +665,7 @@ namespace findMSB
|
||||
|
||||
std::clock_t Timestamps1 = std::clock();
|
||||
|
||||
for(std::size_t k = 0; k < 10000000; ++k)
|
||||
for(std::size_t k = 0; k < 1000000; ++k)
|
||||
for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
|
||||
{
|
||||
int Result = findMSB_095(Data[i].Value);
|
||||
@@ -723,7 +724,7 @@ namespace findMSB
|
||||
|
||||
std::clock_t Timestamps1 = std::clock();
|
||||
|
||||
for(std::size_t k = 0; k < 10000000; ++k)
|
||||
for(std::size_t k = 0; k < 1000000; ++k)
|
||||
for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
|
||||
{
|
||||
int Result = findMSB_nlz1(Data[i].Value);
|
||||
|
||||
@@ -188,6 +188,14 @@ int test_ctr()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
|
||||
//Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
|
||||
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
|
||||
//Error += std::is_copy_constructible<glm::mat4>::value ? 0 : 1;
|
||||
//Error += std::has_trivial_copy_constructor<glm::mat4>::value ? 0 : 1;
|
||||
#endif
|
||||
|
||||
#if(GLM_HAS_INITIALIZER_LISTS)
|
||||
glm::mat4 m0(
|
||||
glm::vec4(0, 1, 2, 3),
|
||||
|
||||
@@ -44,6 +44,18 @@ int test_vec1_ctor()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
|
||||
// Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
|
||||
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::dvec1>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::ivec1>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::uvec1>::value ? 0 : 1;
|
||||
|
||||
Error += std::has_trivial_copy_constructor<glm::vec1>::value ? 0 : 1;
|
||||
Error += std::is_copy_constructible<glm::vec1>::value ? 0 : 1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
#if GLM_HAS_INITIALIZER_LISTS
|
||||
{
|
||||
|
||||
@@ -201,6 +201,18 @@ int test_vec2_ctor()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
|
||||
// Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
|
||||
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::dvec2>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::ivec2>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::uvec2>::value ? 0 : 1;
|
||||
|
||||
Error += std::has_trivial_copy_constructor<glm::vec2>::value ? 0 : 1;
|
||||
Error += std::is_copy_constructible<glm::vec2>::value ? 0 : 1;
|
||||
#endif
|
||||
|
||||
#if GLM_HAS_INITIALIZER_LISTS
|
||||
{
|
||||
glm::vec2 a{ 0, 1 };
|
||||
|
||||
@@ -19,8 +19,20 @@
|
||||
int test_vec3_ctor()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
#if(GLM_HAS_INITIALIZER_LISTS)
|
||||
|
||||
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
|
||||
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
|
||||
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::dvec3>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::ivec3>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::uvec3>::value ? 0 : 1;
|
||||
|
||||
Error += std::has_trivial_copy_constructor<glm::vec3>::value ? 0 : 1;
|
||||
Error += std::is_copy_constructible<glm::vec3>::value ? 0 : 1;
|
||||
#endif
|
||||
|
||||
#if (GLM_HAS_INITIALIZER_LISTS)
|
||||
{
|
||||
glm::vec3 a{ 0, 1, 2 };
|
||||
std::vector<glm::vec3> v = {
|
||||
|
||||
@@ -42,7 +42,23 @@ enum comp
|
||||
int test_vec4_ctor()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
|
||||
glm::ivec4 A(1, 2, 3, 4);
|
||||
glm::ivec4 B(A);
|
||||
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
|
||||
|
||||
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
|
||||
// Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
|
||||
// Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::dvec4>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::ivec4>::value ? 0 : 1;
|
||||
Error += std::is_trivially_copyable<glm::uvec4>::value ? 0 : 1;
|
||||
|
||||
Error += std::has_trivial_copy_constructor<glm::vec4>::value ? 0 : 1;
|
||||
Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
|
||||
#endif
|
||||
|
||||
#if GLM_HAS_INITIALIZER_LISTS
|
||||
{
|
||||
glm::vec4 a{ 0, 1, 2, 3 };
|
||||
|
||||
@@ -103,10 +103,12 @@ namespace mask
|
||||
{
|
||||
type<glm::uint> const Data[] =
|
||||
{
|
||||
{0, 0x00000000},
|
||||
{1, 0x00000001},
|
||||
{2, 0x00000003},
|
||||
{3, 0x00000007}
|
||||
{ 0, 0x00000000},
|
||||
{ 1, 0x00000001},
|
||||
{ 2, 0x00000003},
|
||||
{ 3, 0x00000007},
|
||||
{31, 0x7fffffff},
|
||||
{32, 0xffffffff}
|
||||
};
|
||||
|
||||
int Error(0);
|
||||
@@ -142,10 +144,12 @@ namespace mask
|
||||
{
|
||||
type<glm::ivec4> const Data[] =
|
||||
{
|
||||
{glm::ivec4(0), glm::ivec4(0x00000000)},
|
||||
{glm::ivec4(1), glm::ivec4(0x00000001)},
|
||||
{glm::ivec4(2), glm::ivec4(0x00000003)},
|
||||
{glm::ivec4(3), glm::ivec4(0x00000007)}
|
||||
{glm::ivec4( 0), glm::ivec4(0x00000000)},
|
||||
{glm::ivec4( 1), glm::ivec4(0x00000001)},
|
||||
{glm::ivec4( 2), glm::ivec4(0x00000003)},
|
||||
{glm::ivec4( 3), glm::ivec4(0x00000007)},
|
||||
{glm::ivec4(31), glm::ivec4(0x7fffffff)},
|
||||
{glm::ivec4(32), glm::ivec4(0xffffffff)}
|
||||
};
|
||||
|
||||
int Error(0);
|
||||
|
||||
Reference in New Issue
Block a user