optimization for SSE4.1 required, check SSE4.1 support

pull/25/head
SASANO Takayoshi 2020-04-26 11:16:56 +09:00
parent ca9e9e02ab
commit 7b45883477
1 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ if(NOT DISABLE_CPU_OPTIMIZATION)
OUTPUT_VARIABLE AVX2) OUTPUT_VARIABLE AVX2)
execute_process(COMMAND grep -c "avx " /proc/cpuinfo execute_process(COMMAND grep -c "avx " /proc/cpuinfo
OUTPUT_VARIABLE AVX) OUTPUT_VARIABLE AVX)
execute_process(COMMAND grep -c "sse " /proc/cpuinfo execute_process(COMMAND grep -c "sse4_1 " /proc/cpuinfo
OUTPUT_VARIABLE SSE) OUTPUT_VARIABLE SSE)
execute_process(COMMAND grep -c "neon" /proc/cpuinfo execute_process(COMMAND grep -c "neon" /proc/cpuinfo
OUTPUT_VARIABLE NEON) OUTPUT_VARIABLE NEON)
@ -92,9 +92,9 @@ elseif(${AVX} OR ${AVX} GREATER 0)
message(STATUS "avx processor flags found or enabled.") message(STATUS "avx processor flags found or enabled.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
elseif(${SSE} OR ${SSE} GREATER 0) elseif(${SSE} OR ${SSE} GREATER 0)
# AVX and AVX2 machines will also match on AVX # AVX and AVX2 machines will also match on SSE
message(STATUS "sse processor flags found or enabled.") message(STATUS "sse processor flags found or enabled.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
endif() endif()
# RPi / ARM 32bit # RPi / ARM 32bit