master
Christophe Riccio ago%!(EXTRA string=9 years)
commit c8070624db
  1. 4
      glm/detail/_features.hpp
  2. 6
      glm/detail/func_common.inl
  3. 2
      glm/detail/func_geometric.inl
  4. 2
      glm/detail/func_integer.inl
  5. 2
      glm/detail/func_matrix.inl
  6. 105
      glm/detail/setup.hpp
  7. 2
      glm/detail/type_mat4x4.inl
  8. 2
      glm/detail/type_vec4.inl
  9. 8
      glm/gtc/packing.inl
  10. 30
      glm/simd/platform.h
  11. 1
      readme.md
  12. 30
      test/core/core_setup_message.cpp
  13. 7
      test/core/core_type_vec3.cpp

@ -255,7 +255,7 @@
# define GLM_CXX11_STATIC_ASSERT # define GLM_CXX11_STATIC_ASSERT
# endif # endif
#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) #elif(GLM_COMPILER & GLM_COMPILER_LLVM)
# if(__has_feature(cxx_exceptions)) # if(__has_feature(cxx_exceptions))
# define GLM_CXX98_EXCEPTIONS # define GLM_CXX98_EXCEPTIONS
# endif # endif
@ -396,4 +396,4 @@
# define GLM_CXX11_VARIADIC_TEMPLATES # define GLM_CXX11_VARIADIC_TEMPLATES
# endif # endif
#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) #endif//(GLM_COMPILER & GLM_COMPILER_LLVM)

@ -527,7 +527,7 @@ namespace detail
# else # else
return ::isnan(x) != 0; return ::isnan(x) != 0;
# endif # endif
# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L # elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L
return _isnan(x) != 0; return _isnan(x) != 0;
# elif GLM_COMPILER & GLM_COMPILER_CUDA # elif GLM_COMPILER & GLM_COMPILER_CUDA
return isnan(x) != 0; return isnan(x) != 0;
@ -561,7 +561,7 @@ namespace detail
# else # else
return ::isinf(x); return ::isinf(x);
# endif # endif
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L)
return _isinf(x) != 0; return _isinf(x) != 0;
# else # else
@ -734,6 +734,6 @@ namespace detail
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "func_common_simd.inl" # include "func_common_simd.inl"
#endif #endif

@ -171,6 +171,6 @@ namespace detail
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "func_geometric_simd.inl" # include "func_geometric_simd.inl"
#endif #endif

@ -359,7 +359,7 @@ namespace detail
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "func_integer_simd.inl" # include "func_integer_simd.inl"
#endif #endif

@ -279,7 +279,7 @@ namespace detail
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "func_matrix_simd.inl" # include "func_matrix_simd.inl"
#endif #endif

@ -28,10 +28,8 @@
# pragma message("GLM: CUDA compiler detected") # pragma message("GLM: CUDA compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_VC # elif GLM_COMPILER & GLM_COMPILER_VC
# pragma message("GLM: Visual C++ compiler detected") # pragma message("GLM: Visual C++ compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_APPLE_CLANG
# pragma message("GLM: Clang compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_LLVM # elif GLM_COMPILER & GLM_COMPILER_LLVM
# pragma message("GLM: LLVM compiler detected") # pragma message("GLM: Clang compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_INTEL # elif GLM_COMPILER & GLM_COMPILER_INTEL
# pragma message("GLM: Intel Compiler detected") # pragma message("GLM: Intel Compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_GCC # elif GLM_COMPILER & GLM_COMPILER_GCC
@ -94,7 +92,7 @@
# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
#elif defined(GLM_FORCE_SSE2) #elif defined(GLM_FORCE_SSE2)
# define GLM_ARCH (GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2)
#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) #elif (GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX))
// This is Skylake set of instruction set // This is Skylake set of instruction set
# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__) # if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__)
# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
@ -225,7 +223,7 @@
#elif defined(GLM_FORCE_CXX98) #elif defined(GLM_FORCE_CXX98)
# define GLM_LANG GLM_LANG_CXX98 # define GLM_LANG GLM_LANG_CXX98
#else #else
# if GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) # if GLM_COMPILER & GLM_COMPILER_LLVM
# if __cplusplus >= 201402L // GLM_COMPILER_LLVM34 + -std=c++14 # if __cplusplus >= 201402L // GLM_COMPILER_LLVM34 + -std=c++14
# define GLM_LANG GLM_LANG_CXX14 # define GLM_LANG GLM_LANG_CXX14
# elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y # elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y
@ -296,6 +294,17 @@
# else # else
# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT) # define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
# endif # endif
# elif GLM_COMPILER & GLM_COMPILER_CUDA
# ifdef _MSC_EXTENSIONS
# define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG
# else
# define GLM_MSC_EXT 0
# endif
# if GLM_COMPILER >= GLM_COMPILER_CUDA75
# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT)
# else
# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT)
# endif
# else // Unknown compiler # else // Unknown compiler
# if __cplusplus >= 201402L # if __cplusplus >= 201402L
# define GLM_LANG GLM_LANG_CXX14 # define GLM_LANG GLM_LANG_CXX14
@ -347,7 +356,7 @@
#if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN #if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN
# define GLM_HAS_CXX11_STL 0 # define GLM_HAS_CXX11_STL 0
#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #elif GLM_COMPILER & GLM_COMPILER_LLVM
# if __has_include(<__config>) // libc++ # if __has_include(<__config>) // libc++
# include <__config> # include <__config>
//# else // libstdc++ //# else // libstdc++
@ -366,13 +375,14 @@
#endif #endif
// N1720 // N1720
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_STATIC_ASSERT 1 # define GLM_HAS_STATIC_ASSERT 1
#else #else
# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))))
#endif #endif
@ -382,13 +392,13 @@
#else #else
# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ # define GLM_HAS_EXTENDED_INTEGER_TYPE (\
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)))
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40)))
#endif #endif
// N2235 // N2235
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr) # define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr)
# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR # define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
@ -401,21 +411,22 @@
#endif #endif
// N2672 // N2672
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_INITIALIZER_LISTS 1 # define GLM_HAS_INITIALIZER_LISTS 1
#else #else
# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75))))
#endif #endif
// N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
#define GLM_NOT_BUGGY_VC32BITS (!(GLM_MODEL == GLM_MODEL_32 && (GLM_COMPILER & GLM_COMPILER_VC) && GLM_COMPILER < GLM_COMPILER_VC2013)) #define GLM_NOT_BUGGY_VC32BITS (!(GLM_MODEL == GLM_MODEL_32 && (GLM_COMPILER & GLM_COMPILER_VC) && GLM_COMPILER < GLM_COMPILER_VC2013))
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) #elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG)
# define GLM_HAS_UNRESTRICTED_UNIONS 1 # define GLM_HAS_UNRESTRICTED_UNIONS 1
@ -423,13 +434,12 @@
# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)) || \
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)))
#endif #endif
//#define GLM_HAS_ANONYMOUS_UNION (((GLM_LANG & GLM_LANG_CXXMS_FLAG) | (GLM_LANG & GLM_LANG_CXX11_FLAG)) && GLM_NOT_BUGGY_VC32BITS)
// N2346 // N2346
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_DEFAULTED_FUNCTIONS 1 # define GLM_HAS_DEFAULTED_FUNCTIONS 1
@ -437,22 +447,24 @@
# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12)))) ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12)) || \
(GLM_COMPILER & GLM_COMPILER_CUDA)))
#endif #endif
// N2118 // N2118
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_RVALUE_REFERENCES 1 # define GLM_HAS_RVALUE_REFERENCES 1
#else #else
# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
#endif #endif
// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
@ -460,11 +472,12 @@
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
#endif #endif
// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_TEMPLATE_ALIASES 1 # define GLM_HAS_TEMPLATE_ALIASES 1
@ -472,11 +485,12 @@
# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12_1)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12_1)) || \
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
#endif #endif
// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG #elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_RANGE_FOR 1 # define GLM_HAS_RANGE_FOR 1
@ -484,7 +498,8 @@
# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL13)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL13)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
#endif #endif
// //
@ -503,7 +518,8 @@
# define GLM_HAS_MAKE_SIGNED 1 # define GLM_HAS_MAKE_SIGNED 1
#else #else
# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
#endif #endif
#if GLM_ARCH == GLM_ARCH_PURE #if GLM_ARCH == GLM_ARCH_PURE
@ -516,19 +532,41 @@
// OpenMP // OpenMP
#ifdef _OPENMP #ifdef _OPENMP
# if GLM_COMPILER & GLM_COMPILER_GCC # if GLM_COMPILER & GLM_COMPILER_GCC
# if GLM_COMPILER >= GLM_COMPILER_GCC47 # if GLM_COMPILER >= GLM_COMPILER_GCC61
# define GLM_HAS_OPENMP 45
# elif GLM_COMPILER >= GLM_COMPILER_GCC49
# define GLM_HAS_OPENMP 40
# elif GLM_COMPILER >= GLM_COMPILER_GCC47
# define GLM_HAS_OPENMP 31 # define GLM_HAS_OPENMP 31
# elif GLM_COMPILER >= GLM_COMPILER_GCC44 # elif GLM_COMPILER >= GLM_COMPILER_GCC44
# define GLM_HAS_OPENMP 30 # define GLM_HAS_OPENMP 30
# elif GLM_COMPILER >= GLM_COMPILER_GCC42 # elif GLM_COMPILER >= GLM_COMPILER_GCC42
# define GLM_HAS_OPENMP 25 # define GLM_HAS_OPENMP 25
# else
# define GLM_HAS_OPENMP 0
# endif # endif
# endif// GLM_COMPILER & GLM_COMPILER_GCC # elif GLM_COMPILER & GLM_COMPILER_LLVM
# if GLM_COMPILER >= GLM_COMPILER_LLVM38
# if GLM_COMPILER & GLM_COMPILER_VC # define GLM_HAS_OPENMP 31
# else
# define GLM_HAS_OPENMP 0
# endif
# elif GLM_COMPILER & GLM_COMPILER_VC
# if GLM_COMPILER >= GLM_COMPILER_VC2010 # if GLM_COMPILER >= GLM_COMPILER_VC2010
# define GLM_HAS_OPENMP 20 # define GLM_HAS_OPENMP 20
# else
# define GLM_HAS_OPENMP 0
# endif # endif
# elif GLM_COMPILER & GLM_COMPILER_INTEL
# if GLM_COMPILER >= GLM_COMPILER_INTEL16
# define GLM_HAS_OPENMP 40
# elif GLM_COMPILER >= GLM_COMPILER_INTEL12
# define GLM_HAS_OPENMP 31
# else
# define GLM_HAS_OPENMP 0
# endif
# else
# define GLM_HAS_OPENMP 0
# endif// GLM_COMPILER & GLM_COMPILER_VC # endif// GLM_COMPILER & GLM_COMPILER_VC
#endif #endif
@ -567,9 +605,12 @@
# if GLM_COMPILER & GLM_COMPILER_VC # if GLM_COMPILER & GLM_COMPILER_VC
# define GLM_INLINE __forceinline # define GLM_INLINE __forceinline
# define GLM_NEVER_INLINE __declspec((noinline)) # define GLM_NEVER_INLINE __declspec((noinline))
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)
# define GLM_INLINE inline __attribute__((__always_inline__)) # define GLM_INLINE inline __attribute__((__always_inline__))
# define GLM_NEVER_INLINE __attribute__((__noinline__)) # define GLM_NEVER_INLINE __attribute__((__noinline__))
# elif GLM_COMPILER & GLM_COMPILER_CUDA
# define GLM_INLINE __forceinline__
# define GLM_NEVER_INLINE __noinline__
# else # else
# define GLM_INLINE inline # define GLM_INLINE inline
# define GLM_NEVER_INLINE # define GLM_NEVER_INLINE
@ -644,7 +685,7 @@
# else # else
# define GLM_VECTOR_CALL # define GLM_VECTOR_CALL
# endif # endif
#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_CUDA | GLM_COMPILER_INTEL) #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM | GLM_COMPILER_CUDA | GLM_COMPILER_INTEL)
# define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))

@ -759,6 +759,6 @@ namespace detail
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "type_mat4x4_simd.inl" # include "type_mat4x4_simd.inl"
#endif #endif

@ -1180,6 +1180,6 @@ namespace glm
} }
}//namespace glm }//namespace glm
#if GLM_ARCH != GLM_FORCE_PURE #if GLM_ARCH != GLM_ARCH_PURE
# include "type_vec4_simd.inl" # include "type_vec4_simd.inl"
#endif #endif

@ -151,7 +151,7 @@ namespace detail
else if(glm::isinf(x)) else if(glm::isinf(x))
return 0x1Fu << 6u; return 0x1Fu << 6u;
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
uint Pack = 0u; uint Pack = 0u;
memcpy(&Pack, &x, sizeof(Pack)); memcpy(&Pack, &x, sizeof(Pack));
# else # else
@ -172,7 +172,7 @@ namespace detail
uint Result = packed11ToFloat(x); uint Result = packed11ToFloat(x);
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
float Temp = 0; float Temp = 0;
memcpy(&Temp, &Result, sizeof(Temp)); memcpy(&Temp, &Result, sizeof(Temp));
return Temp; return Temp;
@ -190,7 +190,7 @@ namespace detail
else if(glm::isinf(x)) else if(glm::isinf(x))
return 0x1Fu << 5u; return 0x1Fu << 5u;
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
uint Pack = 0; uint Pack = 0;
memcpy(&Pack, &x, sizeof(Pack)); memcpy(&Pack, &x, sizeof(Pack));
# else # else
@ -211,7 +211,7 @@ namespace detail
uint Result = packed10ToFloat(x); uint Result = packed10ToFloat(x);
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
float Temp = 0; float Temp = 0;
memcpy(&Temp, &Result, sizeof(Temp)); memcpy(&Temp, &Result, sizeof(Temp));
return Temp; return Temp;

@ -127,16 +127,6 @@
#define GLM_COMPILER_LLVM38 0x20000090 #define GLM_COMPILER_LLVM38 0x20000090
#define GLM_COMPILER_LLVM39 0x200000A0 #define GLM_COMPILER_LLVM39 0x200000A0
// Apple Clang
#define GLM_COMPILER_APPLE_CLANG 0x40000000
#define GLM_COMPILER_APPLE_CLANG40 0x40000010
#define GLM_COMPILER_APPLE_CLANG41 0x40000020
#define GLM_COMPILER_APPLE_CLANG42 0x40000030
#define GLM_COMPILER_APPLE_CLANG50 0x40000040
#define GLM_COMPILER_APPLE_CLANG51 0x40000050
#define GLM_COMPILER_APPLE_CLANG60 0x40000060
#define GLM_COMPILER_APPLE_CLANG61 0x40000070
// Build model // Build model
#define GLM_MODEL_32 0x00000010 #define GLM_MODEL_32 0x00000010
#define GLM_MODEL_64 0x00000020 #define GLM_MODEL_64 0x00000020
@ -192,24 +182,18 @@
// Clang // Clang
#elif defined(__clang__) #elif defined(__clang__)
# if GLM_PLATFORM & GLM_PLATFORM_APPLE # if GLM_PLATFORM & GLM_PLATFORM_APPLE
# if __clang_major__ == 4 && __clang_minor__ == 0 # if __clang_major__ == 5 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG40 # define GLM_COMPILER GLM_COMPILER_LLVM33
# elif __clang_major__ == 4 && __clang_minor__ == 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG41
# elif __clang_major__ == 4 && __clang_minor__ == 2
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG42
# elif __clang_major__ == 5 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG50
# elif __clang_major__ == 5 && __clang_minor__ == 1 # elif __clang_major__ == 5 && __clang_minor__ == 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG51 # define GLM_COMPILER GLM_COMPILER_LLVM34
# elif __clang_major__ == 6 && __clang_minor__ == 0 # elif __clang_major__ == 6 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60 # define GLM_COMPILER GLM_COMPILER_LLVM35
# elif __clang_major__ == 6 && __clang_minor__ >= 1 # elif __clang_major__ == 6 && __clang_minor__ >= 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 # define GLM_COMPILER GLM_COMPILER_LLVM36
# elif __clang_major__ >= 7 # elif __clang_major__ >= 7
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 # define GLM_COMPILER GLM_COMPILER_LLVM37
# else # else
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG # define GLM_COMPILER GLM_COMPILER_LLVM
# endif # endif
# else # else
# if __clang_major__ == 3 && __clang_minor__ == 0 # if __clang_major__ == 3 && __clang_minor__ == 0

@ -69,6 +69,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Improved GTC_random linearRand documentation - Improved GTC_random linearRand documentation
- Improved GTC_reciprocal documentation - Improved GTC_reciprocal documentation
- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 - Improved GLM_FORCE_EXPLICIT_CTOR coverage #481
- Improved OpenMP support detection for Clang, GCC, ICC and VC
##### Fixes: ##### Fixes:
- Fixed GTX_extended_min_max filename typo #386 - Fixed GTX_extended_min_max filename typo #386

@ -84,36 +84,6 @@ int test_compiler()
{ {
std::printf("GLM_COMPILER_CUDA\n"); std::printf("GLM_COMPILER_CUDA\n");
} }
else if(GLM_COMPILER & GLM_COMPILER_APPLE_CLANG)
{
switch(GLM_COMPILER)
{
case GLM_COMPILER_APPLE_CLANG40:
std::printf("GLM_COMPILER_APPLE_CLANG40\n");
break;
case GLM_COMPILER_APPLE_CLANG41:
std::printf("GLM_COMPILER_APPLE_CLANG41\n");
break;
case GLM_COMPILER_APPLE_CLANG42:
std::printf("GLM_COMPILER_APPLE_CLANG42\n");
break;
case GLM_COMPILER_APPLE_CLANG50:
std::printf("GLM_COMPILER_APPLE_CLANG50\n");
break;
case GLM_COMPILER_APPLE_CLANG51:
std::printf("GLM_COMPILER_APPLE_CLANG51\n");
break;
case GLM_COMPILER_APPLE_CLANG60:
std::printf("GLM_COMPILER_APPLE_CLANG60\n");
break;
case GLM_COMPILER_APPLE_CLANG61:
std::printf("GLM_COMPILER_APPLE_CLANG61\n");
break;
default:
std::printf("Apple Clang version not detected\n");
break;
}
}
else if(GLM_COMPILER & GLM_COMPILER_LLVM) else if(GLM_COMPILER & GLM_COMPILER_LLVM)
{ {
switch(GLM_COMPILER) switch(GLM_COMPILER)

@ -113,6 +113,13 @@ int test_vec3_ctor()
return Error; return Error;
} }
float foo()
{
glm::vec3 bar = glm::vec3(0.0f, 1.0f, 1.0f);
return glm::length(bar);
}
int test_vec3_operators() int test_vec3_operators()
{ {
int Error = 0; int Error = 0;

Loading…
Cancel
Save