add -mfpmath=sse -msse2 compiler flags: x86/amd64

This may speed things up a little in some places, or maybe not, but
should be safe as few if any users are likely to be using a CPU without
SSE2.
This commit is contained in:
Rafael Kitover 2017-10-17 10:26:37 -07:00
parent afb1cd3dfc
commit 21926d6230
1 changed files with 8 additions and 2 deletions

View File

@ -326,12 +326,18 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
ENDIF()
ENDIF(ENABLE_LTO)
unset(MY_C_OPT_FLAGS)
if(X86_32 OR AMD64)
set(MY_C_OPT_FLAGS -mfpmath=sse -msse2)
endif()
# common optimization flags
IF(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3))
SET(MY_C_OPT_FLAGS -O2 -fomit-frame-pointer ${LTO_FLAGS})
SET(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2 -fomit-frame-pointer ${LTO_FLAGS})
ELSE()
# LTO and -fomit-frame-pointer generate broken binaries on Lion with XCode 4.2 tools
SET(MY_C_OPT_FLAGS -O2)
SET(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2)
ENDIF()
# only use -mtune=generic on PC architectures