From 30f014472d8550daad48978aa631dae4110e90d4 Mon Sep 17 00:00:00 2001 From: Hauke Rehfeld Date: Thu, 14 Apr 2016 18:08:46 +0200 Subject: [PATCH 1/6] add: CUDA in setup.hpp --- glm/detail/setup.hpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index b4688035..fdd46d87 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -674,6 +674,7 @@ #else # 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_CUDA)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)))) #endif @@ -683,6 +684,7 @@ #else # 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_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_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) @@ -709,7 +711,8 @@ #else # 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_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // N2544 Unrestricted unions @@ -731,7 +734,8 @@ # 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_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 // N2118 @@ -742,7 +746,8 @@ #else # 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_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 // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf @@ -754,7 +759,8 @@ # 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_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 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf @@ -766,7 +772,8 @@ # 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_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 // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html @@ -778,7 +785,8 @@ # 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_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 // @@ -797,7 +805,8 @@ # define GLM_HAS_MAKE_SIGNED 1 #else # 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 #if GLM_ARCH == GLM_ARCH_PURE @@ -867,6 +876,9 @@ # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) # define GLM_INLINE inline __attribute__((__always_inline__)) # define GLM_NEVER_INLINE __attribute__((__noinline__)) +# elif GLM_COMPILER & GLM_COMPILER_CUDA +# define GLM_INLINE __forceinline__ +# define GLM_NEVER_INLINE __noinline__ # else # define GLM_INLINE inline # define GLM_NEVER_INLINE From c479e444a4b0f3344b75d3aafcea01d5592c08c0 Mon Sep 17 00:00:00 2001 From: Hauke Rehfeld Date: Fri, 26 Jun 2015 14:26:19 +0200 Subject: [PATCH 2/6] fix: cuda can use anonymous unions --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index fdd46d87..fb2fd260 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -836,7 +836,7 @@ #endif // Not standard -#define GLM_HAS_ANONYMOUS_UNION (GLM_LANG & GLM_LANG_CXXMS_FLAG) +#define GLM_HAS_ANONYMOUS_UNION ((GLM_LANG & GLM_LANG_CXXMS_FLAG) || (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_GCC)) /////////////////////////////////////////////////////////////////////////////////// // Static assert From affd5f3ba08fdec2a4fd0ee700e559867ef01153 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 4 May 2016 16:35:57 +0200 Subject: [PATCH 3/6] Fixed CUDA compiler error in type_vec4.inl #504 --- glm/detail/func_common.inl | 2 +- glm/detail/func_geometric.inl | 2 +- glm/detail/func_integer.inl | 2 +- glm/detail/func_matrix.inl | 2 +- glm/detail/type_mat4x4.inl | 2 +- glm/detail/type_vec4.inl | 2 +- test/core/core_type_vec3.cpp | 7 +++++++ 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 3735402d..8e4e01ec 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -734,6 +734,6 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "func_common_simd.inl" #endif diff --git a/glm/detail/func_geometric.inl b/glm/detail/func_geometric.inl index a89fac16..5cd51dd6 100644 --- a/glm/detail/func_geometric.inl +++ b/glm/detail/func_geometric.inl @@ -171,6 +171,6 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "func_geometric_simd.inl" #endif diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index ec4b7047..20445034 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -359,7 +359,7 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "func_integer_simd.inl" #endif diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index a65e656e..d1be5a58 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -279,7 +279,7 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "func_matrix_simd.inl" #endif diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index c88547b9..e9510a74 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -759,6 +759,6 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "type_mat4x4_simd.inl" #endif diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index efee09d6..56ad58a9 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -1180,6 +1180,6 @@ namespace glm } }//namespace glm -#if GLM_ARCH != GLM_FORCE_PURE +#if GLM_ARCH != GLM_ARCH_PURE # include "type_vec4_simd.inl" #endif diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index b2ad2a40..e27b78ae 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -113,6 +113,13 @@ int test_vec3_ctor() return Error; } +float foo() +{ + glm::vec3 bar = glm::vec3(0.0f, 1.0f, 1.0f); + + return glm::length(bar); +} + int test_vec3_operators() { int Error = 0; From ca3abd6e93d969adb3bd48a35658bbc00dd7d1e0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 4 May 2016 17:05:02 +0200 Subject: [PATCH 4/6] Fixed CUDA support #499, #500, #501 --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 397c8283..926ef001 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -422,7 +422,7 @@ # 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_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)))) #endif // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf From 20da5a25dbc48e417d094b0efe2001707a7de089 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 4 May 2016 18:04:44 +0200 Subject: [PATCH 5/6] Improved OpenMP support detection for Clang, GCC, ICC and VC --- glm/detail/setup.hpp | 30 ++++++++++++++++++++++++++---- readme.md | 1 + 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 926ef001..7d50f814 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -535,19 +535,41 @@ // OpenMP #ifdef _OPENMP # 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 # elif GLM_COMPILER >= GLM_COMPILER_GCC44 # define GLM_HAS_OPENMP 30 # elif GLM_COMPILER >= GLM_COMPILER_GCC42 # define GLM_HAS_OPENMP 25 +# else +# define GLM_HAS_OPENMP 0 # endif -# endif// GLM_COMPILER & GLM_COMPILER_GCC - -# if GLM_COMPILER & GLM_COMPILER_VC +# elif GLM_COMPILER & GLM_COMPILER_LLVM +# if GLM_COMPILER >= GLM_COMPILER_LLVM38 +# define GLM_HAS_OPENMP 31 +# else +# define GLM_HAS_OPENMP 0 +# endif +# elif GLM_COMPILER & GLM_COMPILER_VC # if GLM_COMPILER >= GLM_COMPILER_VC2010 # define GLM_HAS_OPENMP 20 +# else +# define GLM_HAS_OPENMP 0 # 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 diff --git a/readme.md b/readme.md index c9fc6b8f..56c1a275 100644 --- a/readme.md +++ b/readme.md @@ -67,6 +67,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Improved GTC_random linearRand documentation - Improved GTC_reciprocal documentation - Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 +- Improved OpenMP support detection for Clang, GCC, ICC and VC ##### Fixes: - Fixed GTX_extended_min_max filename typo #386 From 93612791cd42eabd449695d9e4261fe3005a57ac Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 4 May 2016 18:46:59 +0200 Subject: [PATCH 6/6] Removed Apple specific check for LLVM versions --- glm/detail/_features.hpp | 4 ++-- glm/detail/func_common.inl | 4 ++-- glm/detail/setup.hpp | 35 +++++++++++++++----------------- glm/gtc/packing.inl | 8 ++++---- glm/simd/platform.h | 30 +++++++-------------------- test/core/core_setup_message.cpp | 30 --------------------------- 6 files changed, 31 insertions(+), 80 deletions(-) diff --git a/glm/detail/_features.hpp b/glm/detail/_features.hpp index 4aa4ad5c..5e86caa8 100644 --- a/glm/detail/_features.hpp +++ b/glm/detail/_features.hpp @@ -255,7 +255,7 @@ # define GLM_CXX11_STATIC_ASSERT # endif -#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +#elif(GLM_COMPILER & GLM_COMPILER_LLVM) # if(__has_feature(cxx_exceptions)) # define GLM_CXX98_EXCEPTIONS # endif @@ -396,4 +396,4 @@ # define GLM_CXX11_VARIADIC_TEMPLATES # endif -#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +#endif//(GLM_COMPILER & GLM_COMPILER_LLVM) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 8e4e01ec..5dbcb72a 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -527,7 +527,7 @@ namespace detail # else return ::isnan(x) != 0; # 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; # elif GLM_COMPILER & GLM_COMPILER_CUDA return isnan(x) != 0; @@ -561,7 +561,7 @@ namespace detail # else return ::isinf(x); # 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) return _isinf(x) != 0; # else diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 7d50f814..e528eb72 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -28,10 +28,8 @@ # pragma message("GLM: CUDA compiler detected") # elif GLM_COMPILER & GLM_COMPILER_VC # 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 -# pragma message("GLM: LLVM compiler detected") +# pragma message("GLM: Clang compiler detected") # elif GLM_COMPILER & GLM_COMPILER_INTEL # pragma message("GLM: Intel Compiler detected") # elif GLM_COMPILER & GLM_COMPILER_GCC @@ -94,7 +92,7 @@ # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif defined(GLM_FORCE_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 # 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) @@ -225,7 +223,7 @@ #elif defined(GLM_FORCE_CXX98) # define GLM_LANG GLM_LANG_CXX98 #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 # define GLM_LANG GLM_LANG_CXX14 # elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y @@ -358,7 +356,7 @@ #if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN # 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++ # include <__config> //# else // libstdc++ @@ -377,7 +375,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_STATIC_ASSERT 1 @@ -396,12 +394,11 @@ ((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_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30))) #endif // 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_PARTIAL GLM_HAS_CONSTEXPR #elif GLM_LANG & GLM_LANG_CXX11_FLAG @@ -414,7 +411,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_INITIALIZER_LISTS 1 @@ -429,7 +426,7 @@ #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) #elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) # define GLM_HAS_UNRESTRICTED_UNIONS 1 @@ -442,7 +439,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_DEFAULTED_FUNCTIONS 1 @@ -455,7 +452,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RVALUE_REFERENCES 1 @@ -467,7 +464,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 @@ -480,7 +477,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_TEMPLATE_ALIASES 1 @@ -493,7 +490,7 @@ #endif // 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) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RANGE_FOR 1 @@ -608,7 +605,7 @@ # if GLM_COMPILER & GLM_COMPILER_VC # define GLM_INLINE __forceinline # 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_NEVER_INLINE __attribute__((__noinline__)) # elif GLM_COMPILER & GLM_COMPILER_CUDA @@ -688,7 +685,7 @@ # else # define GLM_VECTOR_CALL # 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_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index 5c6667af..935ce08e 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -151,7 +151,7 @@ namespace detail else if(glm::isinf(x)) 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; memcpy(&Pack, &x, sizeof(Pack)); # else @@ -172,7 +172,7 @@ namespace detail 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; memcpy(&Temp, &Result, sizeof(Temp)); return Temp; @@ -190,7 +190,7 @@ namespace detail else if(glm::isinf(x)) 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; memcpy(&Pack, &x, sizeof(Pack)); # else @@ -211,7 +211,7 @@ namespace detail 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; memcpy(&Temp, &Result, sizeof(Temp)); return Temp; diff --git a/glm/simd/platform.h b/glm/simd/platform.h index 9ef10724..14636a15 100644 --- a/glm/simd/platform.h +++ b/glm/simd/platform.h @@ -127,16 +127,6 @@ #define GLM_COMPILER_LLVM38 0x20000090 #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 #define GLM_MODEL_32 0x00000010 #define GLM_MODEL_64 0x00000020 @@ -192,24 +182,18 @@ // Clang #elif defined(__clang__) # if GLM_PLATFORM & GLM_PLATFORM_APPLE -# if __clang_major__ == 4 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG40 -# 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 +# if __clang_major__ == 5 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_LLVM33 # 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 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60 +# define GLM_COMPILER GLM_COMPILER_LLVM35 # elif __clang_major__ == 6 && __clang_minor__ >= 1 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 +# define GLM_COMPILER GLM_COMPILER_LLVM36 # elif __clang_major__ >= 7 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 +# define GLM_COMPILER GLM_COMPILER_LLVM37 # else -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG +# define GLM_COMPILER GLM_COMPILER_LLVM # endif # else # if __clang_major__ == 3 && __clang_minor__ == 0 diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index d0710ed9..ebdd61dd 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -84,36 +84,6 @@ int test_compiler() { 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) { switch(GLM_COMPILER)