commit d4d9457d4fd51a931f3e503c52d2d3257ff99a31 parent bc1356576f5085d69e007abd45d00592b24b25e3 Author: d.levin256@gmail.com <d.levin256@gmail.com> Date: Mon, 2 Dec 2019 16:44:42 +0000 Detect SSE4.2, detect_cpu executable Diffstat:
M | CMakeLists.txt | | | 4 | ++++ |
M | include/kfr/runtime/cpuid.hpp | | | 2 | ++ |
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -159,6 +159,10 @@ endif() message(STATUS CPU_ARCH=${CPU_ARCH}) +add_executable(detect_cpu ${CMAKE_CURRENT_SOURCE_DIR}/cmake/detect_cpu.cpp) +target_link_libraries(detect_cpu PRIVATE kfr) +target_set_arch(detect_cpu PRIVATE generic) + if (ENABLE_TESTS) if (MSVC) diff --git a/include/kfr/runtime/cpuid.hpp b/include/kfr/runtime/cpuid.hpp @@ -289,6 +289,8 @@ cpu_t detect_cpu() return cpu_t::avx2; if (c.hasAVX && c.hasAVXOSSUPPORT) return cpu_t::avx1; + if (c.hasSSE42) + return cpu_t::sse42; if (c.hasSSE41) return cpu_t::sse41; if (c.hasSSSE3)