Added experiments and tests for roundEven

This commit is contained in:
Christophe Riccio
2011-09-17 11:12:35 +01:00
parent 472174a206
commit cc48ab3697
3 changed files with 175 additions and 110 deletions

View File

@@ -11,75 +11,6 @@
#include <glm/glm.hpp>
#include <iostream>
/*
#define GLM_COMPILER_UNKNOWN 0x00000000
// Visual C++ defines
#define GLM_COMPILER_VC 0x01000000
#define GLM_COMPILER_VC2 0x01000010
#define GLM_COMPILER_VC4 0x01000020
#define GLM_COMPILER_VC5 0x01000030
#define GLM_COMPILER_VC6 0x01000040
#define GLM_COMPILER_VC2002 0x01000050
#define GLM_COMPILER_VC2003 0x01000060
#define GLM_COMPILER_VC2005 0x01000070
#define GLM_COMPILER_VC2008 0x01000080
#define GLM_COMPILER_VC2010 0x01000090
#define GLM_COMPILER_VC2011 0x010000A0
// GCC defines
#define GLM_COMPILER_GCC 0x02000000
#define GLM_COMPILER_GCC_LLVM 0x02000001
#define GLM_COMPILER_GCC_CLANG 0x02000002
#define GLM_COMPILER_GCC30 0x02000010
#define GLM_COMPILER_GCC31 0x02000020
#define GLM_COMPILER_GCC32 0x02000030
#define GLM_COMPILER_GCC33 0x02000040
#define GLM_COMPILER_GCC34 0x02000050
#define GLM_COMPILER_GCC35 0x02000060
#define GLM_COMPILER_GCC40 0x02000070
#define GLM_COMPILER_GCC41 0x02000080
#define GLM_COMPILER_GCC42 0x02000090
#define GLM_COMPILER_GCC43 0x020000A0
#define GLM_COMPILER_GCC44 0x020000B0
#define GLM_COMPILER_GCC45 0x020000C0
#define GLM_COMPILER_GCC46 0x020000D0
#define GLM_COMPILER_GCC47 0x020000E0
#define GLM_COMPILER_GCC48 0x020000F0
#define GLM_COMPILER_GCC49 0x02000100
#define GLM_COMPILER_GCC50 0x02000200
// G++ command line to display defined
// echo "" | g++ -E -dM -x c++ - | sort
// Borland C++ defines. How to identify BC?
#define GLM_COMPILER_BC 0x04000000
#define GLM_COMPILER_BCB4 0x04000100
#define GLM_COMPILER_BCB5 0x04000200
#define GLM_COMPILER_BCB6 0x04000300
//#define GLM_COMPILER_BCBX 0x04000400 // What's the version value?
#define GLM_COMPILER_BCB2009 0x04000500
// CodeWarrior
#define GLM_COMPILER_CODEWARRIOR 0x08000000
// CUDA
#define GLM_COMPILER_CUDA 0x10000000
#define GLM_COMPILER_CUDA30 0x10000010
#define GLM_COMPILER_CUDA31 0x10000020
#define GLM_COMPILER_CUDA32 0x10000030
#define GLM_COMPILER_CUDA40 0x10000040
// Clang
#define GLM_COMPILER_CLANG 0x20000000
#define GLM_COMPILER_CLANG26 0x20000010
#define GLM_COMPILER_CLANG27 0x20000020
#define GLM_COMPILER_CLANG28 0x20000030
#define GLM_COMPILER_CLANG29 0x20000040
// LLVM GCC
#define GLM_COMPILER_LLVM_GCC 0x40000000
*/
int test_compiler()
{
int Error = 0;
@@ -89,12 +20,98 @@ int test_compiler()
case GLM_COMPILER_VC:
std::cout << "GLM_COMPILER_VC" << std::endl;
break;
case GLM_COMPILER_VC2:
std::cout << "GLM_COMPILER_VC2" << std::endl;
break;
case GLM_COMPILER_VC4:
std::cout << "GLM_COMPILER_VC4" << std::endl;
break;
case GLM_COMPILER_VC5:
std::cout << "GLM_COMPILER_VC5" << std::endl;
break;
case GLM_COMPILER_VC6:
std::cout << "GLM_COMPILER_VC6" << std::endl;
break;
case GLM_COMPILER_VC2002:
std::cout << "GLM_COMPILER_VC2002" << std::endl;
break;
case GLM_COMPILER_VC2003:
std::cout << "GLM_COMPILER_VC2003" << std::endl;
break;
case GLM_COMPILER_VC2005:
std::cout << "GLM_COMPILER_VC2005" << std::endl;
break;
case GLM_COMPILER_VC2008:
std::cout << "GLM_COMPILER_VC2008" << std::endl;
break;
case GLM_COMPILER_VC2010:
std::cout << "GLM_COMPILER_VC2010" << std::endl;
break;
case GLM_COMPILER_VC2011:
std::cout << "GLM_COMPILER_VC2011" << std::endl;
break;
case GLM_COMPILER_GCC:
std::cout << "GLM_COMPILER_GCC" << std::endl;
break;
case GLM_COMPILER_GCC30:
std::cout << "GLM_COMPILER_GCC30" << std::endl;
break;
case GLM_COMPILER_GCC31:
std::cout << "GLM_COMPILER_GCC31" << std::endl;
break;
case GLM_COMPILER_GCC32:
std::cout << "GLM_COMPILER_GCC32" << std::endl;
break;
case GLM_COMPILER_GCC33:
std::cout << "GLM_COMPILER_GCC33" << std::endl;
break;
case GLM_COMPILER_GCC34:
std::cout << "GLM_COMPILER_GCC34" << std::endl;
break;
case GLM_COMPILER_GCC35:
std::cout << "GLM_COMPILER_GCC35" << std::endl;
break;
case GLM_COMPILER_GCC40:
std::cout << "GLM_COMPILER_GCC40" << std::endl;
break;
case GLM_COMPILER_GCC41:
std::cout << "GLM_COMPILER_GCC41" << std::endl;
break;
case GLM_COMPILER_GCC42:
std::cout << "GLM_COMPILER_GCC42" << std::endl;
break;
case GLM_COMPILER_GCC43:
std::cout << "GLM_COMPILER_GCC43" << std::endl;
break;
case GLM_COMPILER_GCC44:
std::cout << "GLM_COMPILER_GCC44" << std::endl;
break;
case GLM_COMPILER_GCC45:
std::cout << "GLM_COMPILER_GCC45" << std::endl;
break;
case GLM_COMPILER_GCC46:
std::cout << "GLM_COMPILER_GCC46" << std::endl;
break;
case GLM_COMPILER_GCC47:
std::cout << "GLM_COMPILER_GCC47" << std::endl;
break;
case GLM_COMPILER_BC:
std::cout << "GLM_COMPILER_BC" << std::endl;
break;
case GLM_COMPILER_BCB4:
std::cout << "GLM_COMPILER_BCB4" << std::endl;
break;
case GLM_COMPILER_BCB5:
std::cout << "GLM_COMPILER_BCB5" << std::endl;
break;
case GLM_COMPILER_BCB6:
std::cout << "GLM_COMPILER_BCB6" << std::endl;
break;
case GLM_COMPILER_BCB2009:
std::cout << "GLM_COMPILER_BCB2009" << std::endl;
break;
case GLM_COMPILER_CODEWARRIOR:
std::cout << "GLM_COMPILER_CODEWARRIOR" << std::endl;
break;
@@ -104,12 +121,24 @@ int test_compiler()
case GLM_COMPILER_CLANG:
std::cout << "GLM_COMPILER_CLANG" << std::endl;
break;
case GLM_COMPILER_CLANG26:
std::cout << "GLM_COMPILER_CLANG26" << std::endl;
break;
case GLM_COMPILER_CLANG27:
std::cout << "GLM_COMPILER_CLANG27" << std::endl;
break;
case GLM_COMPILER_CLANG28:
std::cout << "GLM_COMPILER_CLANG28" << std::endl;
break;
case GLM_COMPILER_CLANG29:
std::cout << "GLM_COMPILER_CLANG29" << std::endl;
break;
case GLM_COMPILER_LLVM_GCC:
std::cout << "GLM_COMPILER_LLVM_GCC" << std::endl;
break;
default:
std::cout << "Undetected compiler" << std::endl;
break;
Error += 1;
}
return Error;
@@ -121,6 +150,11 @@ int test_model()
Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1;
if(GLM_MODEL == GLM_MODEL_32)
std::cout << "GLM_MODEL_32" << std::endl;
else if(GLM_MODEL == GLM_MODEL_64)
std::cout << "GLM_MODEL_64" << std::endl;
return Error;
}