Commit d1ea9995 authored by Davis King's avatar Davis King

Added message statements to print if simd instructions are being enabled.

parent a4c38a62
...@@ -32,10 +32,13 @@ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ...@@ -32,10 +32,13 @@ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF) option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
if(USE_AVX_INSTRUCTIONS) if(USE_AVX_INSTRUCTIONS)
add_definitions(-mavx) add_definitions(-mavx)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS) elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(-msse4) add_definitions(-msse4)
message(STATUS "Enabling SSE4 instructions")
elseif(USE_SSE2_INSTRUCTIONS) elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(-msse2) add_definitions(-msse2)
message(STATUS "Enabling SSE2 instructions")
endif() endif()
elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
# Use SSE2 by default when using Visual Studio. # Use SSE2 by default when using Visual Studio.
...@@ -52,12 +55,14 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu ...@@ -52,12 +55,14 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
check_type_size( "void*" SIZE_OF_VOID_PTR) check_type_size( "void*" SIZE_OF_VOID_PTR)
if(USE_AVX_INSTRUCTIONS) if(USE_AVX_INSTRUCTIONS)
add_definitions(/arch:AVX) add_definitions(/arch:AVX)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS) elseif (USE_SSE4_INSTRUCTIONS)
# Visual studio doesn't have an /arch:SSE2 flag when building in 64 bit modes. # Visual studio doesn't have an /arch:SSE2 flag when building in 64 bit modes.
# So only give it when we are doing a 32 bit build. # So only give it when we are doing a 32 bit build.
if (SIZE_OF_VOID_PTR EQUAL 4) if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2) add_definitions(/arch:SSE2)
endif() endif()
message(STATUS "Enabling SSE4 instructions")
add_definitions(-DDLIB_HAVE_SSE2) add_definitions(-DDLIB_HAVE_SSE2)
add_definitions(-DDLIB_HAVE_SSE3) add_definitions(-DDLIB_HAVE_SSE3)
add_definitions(-DDLIB_HAVE_SSE41) add_definitions(-DDLIB_HAVE_SSE41)
...@@ -67,6 +72,7 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu ...@@ -67,6 +72,7 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
if (SIZE_OF_VOID_PTR EQUAL 4) if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2) add_definitions(/arch:SSE2)
endif() endif()
message(STATUS "Enabling SSE2 instructions")
add_definitions(-DDLIB_HAVE_SSE2) add_definitions(-DDLIB_HAVE_SSE2)
endif() endif()
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment