Fixed SSE detection on GCC

This commit is contained in:
Christophe Riccio 2011-01-24 15:43:46 +00:00
parent 438089295e
commit 019c6ced18
4 changed files with 13 additions and 9 deletions

View File

@ -25,7 +25,7 @@ namespace glm
namespace detail namespace detail
{ {
#ifndef GLM_USE_ANONYMOUS_UNION #ifndef _MSC_EXTENSIONS
template <> template <>
struct tvec2<thalf> struct tvec2<thalf>
{ {
@ -319,7 +319,7 @@ namespace glm
tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const; tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W); tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W);
}; };
#endif//GLM_USE_ANONYMOUS_UNION #endif//_MSC_EXTENSIONS
} }
//namespace detail //namespace detail

View File

@ -10,7 +10,7 @@
namespace glm{ namespace glm{
namespace detail{ namespace detail{
#ifndef GLM_USE_ANONYMOUS_UNION #ifndef _MSC_EXTENSIONS
////////////////////////////////////// //////////////////////////////////////
// hvec2 // hvec2
@ -969,7 +969,7 @@ inline tref4<thalf> tvec4<thalf>::swizzle(comp x, comp y, comp z, comp w)
(*this)[w]); (*this)[w]);
} }
#endif//GLM_USE_ANONYMOUS_UNION #endif//_MSC_EXTENSIONS
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -262,10 +262,12 @@
# define GLM_ARCH GLM_ARCH_PURE # define GLM_ARCH GLM_ARCH_PURE
# endif # endif
#elif((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__)))
# if(GLM_COMPILER >= GLM_COMPILER_GCC44) # if(defined(__AVX__))
# define GLM_ARCH GLM_ARCH_AVX # define GLM_ARCH GLM_ARCH_AVX
# elif(GLM_COMPILER >= GLM_COMPILER_GCC40) # elif(defined(__SSE3__))
# define GLM_ARCH GLM_ARCH_SSE3 # define GLM_ARCH GLM_ARCH_SSE3
# elif(defined(__SSE2__))
# define GLM_ARCH GLM_ARCH_SSE2
# else # else
# define GLM_ARCH GLM_ARCH_PURE # define GLM_ARCH GLM_ARCH_PURE
# endif # endif
@ -340,8 +342,10 @@
# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
#elif(defined(BOOST_STATIC_ASSERT)) #elif(defined(BOOST_STATIC_ASSERT))
# define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x) # define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
#else #elif(GLM_COMPILER & GLM_COMPILER_VC)
# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
#else
# define GLM_STATIC_ASSERT(x, message)
#endif//GLM_LANG #endif//GLM_LANG
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -19,12 +19,12 @@ int main()
glm::half C = A + B; glm::half C = A + B;
glm::half D(C); glm::half D(C);
float E = D; float E = D;
int F = C; int F = float(C);
glm::half G = B * C; glm::half G = B * C;
glm::half H = G / C; glm::half H = G / C;
H += glm::half(1.0f); H += glm::half(1.0f);
double J = H; double J = H;
int I = H; int I = float(H);
Result = Result && J == 3.0; Result = Result && J == 3.0;