From 803c58c99e5e80f36180da1752a38588457c19e7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 17 Aug 2018 00:19:59 +0200 Subject: [PATCH] Fixed Clang SIMD usage --- glm/detail/setup.hpp | 15 +++++++-------- glm/detail/type_vec4_simd.inl | 4 +--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index fc365106..bfeada54 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -72,10 +72,9 @@ #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG -//#ifdef _MSC_EXTENSIONS -#if ((GLM_COMPILER & GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS)) +#if (defined(_MSC_EXTENSIONS)) # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG -#elif (!(GLM_COMPILER & GLM_COMPILER_VC) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) +#elif ((GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG #else # define GLM_LANG_EXT 0 @@ -122,9 +121,9 @@ # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX03) -# define GLM_LANG GLM_LANG_CXX03 +# define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) #elif defined(GLM_FORCE_CXX98) -# define GLM_LANG GLM_LANG_CXX98 +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) #else # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) # if GLM_COMPILER >= GLM_COMPILER_VC15_7 @@ -289,7 +288,7 @@ // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_ALIGNOF __has_feature(c_alignof) +# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ALIGNOF 1 #else @@ -757,9 +756,9 @@ namespace detail // Use SIMD instruction sets #if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) -#define GLM_CONFIG_SIMD GLM_ENABLE +# define GLM_CONFIG_SIMD GLM_ENABLE #else -#define GLM_CONFIG_SIMD GLM_DISABLE +# define GLM_CONFIG_SIMD GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index 6d1a206a..4f28b205 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -1,5 +1,3 @@ -/// @ref core - #if GLM_ARCH & GLM_ARCH_SSE2_BIT namespace glm{ @@ -404,7 +402,7 @@ namespace detail {} template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int64, aligned_highp>::vec(detail::int64 _s) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_highp>::vec(detail::int64 _s) : data(_mm256_set1_epi64x(_s)) {} # endif