Skip to content

Commit 75e3a92

Browse files
authored
Add express -mavx and -msse options (and fix a stray = for cooperlake)
1 parent 137ae61 commit 75e3a92

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cmake/cc.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,25 @@ if (${CORE} STREQUAL "COOPERLAKE")
109109
if (NOT NO_AVX512)
110110
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
111111
if (${GCC_VERSION} VERSION_GREATER 10.1 OR ${GCC_VERSION} VERSION_EQUAL 10.1)
112-
set (CCOMMON_OPT = "${CCOMMON_OPT} -march=cooperlake")
112+
set (CCOMMON_OPT "${CCOMMON_OPT} -march=cooperlake")
113113
else ()
114114
set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512")
115115
endif()
116116
endif ()
117117
endif ()
118118
endif ()
119+
120+
if (NOT DYNAMIC_ARCH)
121+
if (HAVE_AVX2)
122+
set (CCOMMON_OPT "${CCOMMON_OPT} -mavx2")
123+
endif ()
124+
if (HAVE_AVX)
125+
set (CCOMMON_OPT "${CCOMMON_OPT} -mavx")
126+
endif ()
127+
if (HAVE_SSE3)
128+
set (CCOMMON_OPT "${CCOMMON_OPT} -msse3")
129+
endif ()
130+
if (HAVE_SSSE3)
131+
set (CCOMMON_OPT "${CCOMMON_OPT} -mssse3")
132+
endif ()
133+
endif()

0 commit comments

Comments
 (0)