diff --git a/lib/TH/CMakeLists.txt b/lib/TH/CMakeLists.txt index 803dfe1a..518c1573 100644 --- a/lib/TH/CMakeLists.txt +++ b/lib/TH/CMakeLists.txt @@ -217,16 +217,25 @@ IF(C_AVX2_FOUND OR C_AVX_FOUND OR C_SSE4_2_FOUND OR C_SSE4_1_FOUND) SET(simd generic/simd/convolve.c) ENDIF(C_AVX2_FOUND OR C_AVX_FOUND OR C_SSE4_2_FOUND OR C_SSE4_1_FOUND) -# IF SSE4 FOUND -IF(C_SSE4_1_FOUND AND C_SSE4_2_FOUND) - SET(CMAKE_C_FLAGS "${C_SSE4_1_FLAGS} -DUSE_SSE4_1 ${C_SSE4_2_FLAGS} -DUSE_SSE4_2 ${CMAKE_C_FLAGS}") +# IF SSE4.1 FOUND +IF(C_SSE4_1_FOUND) + SET(CMAKE_C_FLAGS "${C_SSE4_1_FLAGS} -DUSE_SSE4_1") +ENDIF(C_SSE4_1_FOUND) + +# IF SSE4.2 FOUND +IF(C_SSE4_2_FOUND) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_SSE4_2_FLAGS} -DUSE_SSE4_2") +ENDIF(C_SSE4_2_FOUND) + +# IF SSE4.1 OR SSE4.2 FOUND +IF(C_SSE4_1_FOUND OR C_SSE4_2_FOUND) IF(MSVC) SET_SOURCE_FILES_PROPERTIES(generic/simd/convolve5x5_sse.c PROPERTIES COMPILE_FLAGS "/Ox /fp:fast") ELSE(MSVC) SET_SOURCE_FILES_PROPERTIES(generic/simd/convolve5x5_sse.c PROPERTIES COMPILE_FLAGS "-O3 -ffast-math") ENDIF(MSVC) SET(simd ${simd} generic/simd/convolve5x5_sse.c) -ENDIF(C_SSE4_1_FOUND AND C_SSE4_2_FOUND) +ENDIF(C_SSE4_1_FOUND OR C_SSE4_2_FOUND) # IF AVX FOUND IF(C_AVX_FOUND)