From 011a05626728d5ed95c18253016460991a13a3c6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 22 Nov 2014 22:31:44 +0100 Subject: [PATCH] Added AVX2 detection for GLM tests --- CMakeLists.txt | 1 + glm/detail/setup.hpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 818af5b2..daf45035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,7 @@ elseif(GLM_TEST_ENABLE_SIMD_AVX2) elseif(GLM_USE_INTEL) add_definitions(/QxAVX2) elseif(MSVC) + message("AVX2") add_definitions(/arch:AVX2) endif() elseif(GLM_TEST_ENABLE_SIMD_AVX) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index ffa74640..d45dc37b 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -592,7 +592,9 @@ # define GLM_ARCH GLM_ARCH_PURE # endif #elif GLM_COMPILER & GLM_COMPILER_VC -# if _M_IX86_FP == 2 && defined(__AVX__) +# if defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # elif _M_IX86_FP == 2 # define GLM_ARCH (GLM_ARCH_SSE2)