|
@@ -82,6 +82,9 @@ endif()
|
|
|
option(GLM_TEST_ENABLE "Build unit tests" ON)
|
|
option(GLM_TEST_ENABLE "Build unit tests" ON)
|
|
|
option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF)
|
|
option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF)
|
|
|
option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF)
|
|
option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF)
|
|
|
|
|
+option(GLM_TEST_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF)
|
|
|
|
|
+option(GLM_TEST_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF)
|
|
|
|
|
+option(GLM_TEST_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF)
|
|
|
option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
|
|
option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
|
|
|
option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
|
|
option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
|
|
|
option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)
|
|
option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)
|
|
@@ -114,13 +117,43 @@ elseif(GLM_TEST_ENABLE_SIMD_AVX)
|
|
|
endif()
|
|
endif()
|
|
|
message(STATUS "GLM: AVX instruction set")
|
|
message(STATUS "GLM: AVX instruction set")
|
|
|
|
|
|
|
|
|
|
+elseif(GLM_TEST_ENABLE_SIMD_SSE4_2)
|
|
|
|
|
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
|
|
|
+ add_compile_options(-msse4.2)
|
|
|
|
|
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
|
|
|
+ add_compile_options(/QxSSE4.2)
|
|
|
|
|
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
|
|
|
|
|
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2
|
|
|
|
|
+ endif()
|
|
|
|
|
+ message(STATUS "GLM: SSE4.2 instruction set")
|
|
|
|
|
+
|
|
|
|
|
+elseif(GLM_TEST_ENABLE_SIMD_SSE4_1)
|
|
|
|
|
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
|
|
|
+ add_compile_options(-msse4.1)
|
|
|
|
|
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
|
|
|
+ add_compile_options(/QxSSE4.1)
|
|
|
|
|
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
|
|
|
|
|
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE4.1
|
|
|
|
|
+ endif()
|
|
|
|
|
+ message(STATUS "GLM: SSE4.1 instruction set")
|
|
|
|
|
+
|
|
|
|
|
+elseif(GLM_TEST_ENABLE_SIMD_SSSE3)
|
|
|
|
|
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
|
|
|
+ add_compile_options(-mssse3)
|
|
|
|
|
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
|
|
|
+ add_compile_options(/QxSSSE3)
|
|
|
|
|
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
|
|
|
|
|
+ add_compile_options(/arch:SSE2) # VC doesn't support SSSE3
|
|
|
|
|
+ endif()
|
|
|
|
|
+ message(STATUS "GLM: SSSE3 instruction set")
|
|
|
|
|
+
|
|
|
elseif(GLM_TEST_ENABLE_SIMD_SSE3)
|
|
elseif(GLM_TEST_ENABLE_SIMD_SSE3)
|
|
|
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
|
add_compile_options(-msse3)
|
|
add_compile_options(-msse3)
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
|
add_compile_options(/QxSSE3)
|
|
add_compile_options(/QxSSE3)
|
|
|
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
|
|
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
|
|
|
- add_compile_options(/arch:SSE2) # VC doesn't support /arch:SSE3
|
|
|
|
|
|
|
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE3
|
|
|
endif()
|
|
endif()
|
|
|
message(STATUS "GLM: SSE3 instruction set")
|
|
message(STATUS "GLM: SSE3 instruction set")
|
|
|
|
|
|