From 44140e61aacec8598276d2ac1a1d63007df0e617 Mon Sep 17 00:00:00 2001 From: WillisMedwell Date: Thu, 25 Jan 2024 15:42:46 +1100 Subject: [PATCH] Added requirement for sse3 --- CMakeLists.txt | 6 +++--- include/Utily/Simd.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec3de7c..9d5af5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_CURRENT_ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) if(DEFINED EMSCRIPTEN) - message(STATUS "For Emscripten SIMD use flags: \"-msimd128 -mrelaxed-simd -msse -msse2 -mavx\"") + message(STATUS "For Emscripten SIMD use flags: \"-msimd128 -mrelaxed-simd -msse -msse2 -msse3 -mavx\"") elseif(NOT MSVC) target_compile_options(Utily_Utily PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-Wcast-align" "-Wcast-qual" "-Wctor-dtor-privacy" "-Wformat=2" "-Winit-self" "-Wmissing-declarations" "-Wmissing-include-dirs" "-Wold-style-cast" "-Woverloaded-virtual" "-Wredundant-decls" "-Wshadow" "-Wsign-conversion" "-Wsign-promo" "-Wstrict-overflow=5" "-Wswitch-default" "-Wundef" "-Wno-unused" "-Wconversion" "-Wsign-compare") message(STATUS "For Native SIMD use flags: \"-march=native\"") @@ -53,7 +53,7 @@ if(BUILD_UTILY_TESTS) add_executable(UtilyTest ${UTILY_TEST_SOURCES}) if(DEFINED EMSCRIPTEN) target_compile_options(UtilyTest PRIVATE "-Wdeprecated-declarations") - target_compile_options(UtilyTest PRIVATE -msimd128 -mrelaxed-simd -msse -msse2 -mavx) + target_compile_options(UtilyTest PRIVATE -msimd128 -mrelaxed-simd -msse -msse2 -msse3 -mavx) set(CMAKE_EXECUTABLE_SUFFIX ".html") elseif(NOT MSVC) target_compile_options(UtilyTest PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-Wcast-align" "-Wcast-qual" "-Wctor-dtor-privacy" "-Wformat=2" "-Winit-self" "-Wmissing-declarations" "-Wmissing-include-dirs" "-Wold-style-cast" "-Woverloaded-virtual" "-Wredundant-decls" "-Wshadow" "-Wsign-conversion" "-Wsign-promo" "-Wstrict-overflow=5" "-Wswitch-default" "-Wundef" "-Wno-unused" "-Wconversion" "-Wsign-compare") @@ -97,7 +97,7 @@ if(BUILD_UTILY_BENCHMARKS) endforeach() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PRELOAD_FILES} -Wno-unused-command-line-argument") target_compile_options(UtilyBenchmark PRIVATE -Wno-deprecated-declarations -Wno-unused-command-line-argument) - target_compile_options(UtilyBenchmark PRIVATE -msimd128 -mrelaxed-simd -msse -msse2 -mavx) + target_compile_options(UtilyBenchmark PRIVATE -msimd128 -mrelaxed-simd -msse -msse2 -msse3 -mavx) elseif(NOT MSVC) target_compile_options(UtilyBenchmark PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-Wcast-align" "-Wcast-qual" "-Wctor-dtor-privacy" "-Wformat=2" "-Winit-self" "-Wmissing-declarations" "-Wmissing-include-dirs" "-Wold-style-cast" "-Woverloaded-virtual" "-Wredundant-decls" "-Wshadow" "-Wsign-conversion" "-Wsign-promo" "-Wstrict-overflow=5" "-Wswitch-default" "-Wundef" "-Wno-unused" "-Wconversion" "-Wsign-compare") target_compile_options(UtilyBenchmark PRIVATE -march=native) diff --git a/include/Utily/Simd.hpp b/include/Utily/Simd.hpp index 63541c6..4b73f0f 100644 --- a/include/Utily/Simd.hpp +++ b/include/Utily/Simd.hpp @@ -22,7 +22,7 @@ #include // Check for SSE support -#if defined(__SSE__) && defined(__SSE2__) +#if defined(__SSE__) && defined(__SSE2__) && defined(__SSE3__) #define UTY_SUPPORTS_128 1 #include #include