From b9bc76aec4c869fed0b5cfbbe11336206a6ff5ec Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 2 Nov 2020 22:43:50 +0100 Subject: [PATCH] Add files via upload --- cmake/os.cmake | 4 +++- cmake/prebuild.cmake | 30 ++++++++++++++++++++++++++++++ cmake/system.cmake | 31 +++++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/cmake/os.cmake b/cmake/os.cmake index 1eb2b74..feb4c05 100644 --- a/cmake/os.cmake +++ b/cmake/os.cmake @@ -84,9 +84,11 @@ if (X86) set(NO_EXPRECISION 1) endif () -if ((DYNAMIC_ARCH) AND (${TARGET} STREQUAL "GENERIC")) +if (DYNAMIC_ARCH) +if (${TARGET} STREQUAL "GENERIC") set(NO_EXPRECISION 1) endif () +endif () if (UTEST_CHECK) set(CCOMMON_OPT "${CCOMMON_OPT} -DUTEST_CHECK") diff --git a/cmake/prebuild.cmake b/cmake/prebuild.cmake index 3e38abb..b1b4c50 100644 --- a/cmake/prebuild.cmake +++ b/cmake/prebuild.cmake @@ -139,6 +139,36 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS set(CGEMM3M_UNROLL_N 4) set(ZGEMM3M_UNROLL_M 4) set(ZGEMM3M_UNROLL_N 4) + elseif ("${TCORE}" STREQUAL "BARCELONA") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_SSE3\n") + elseif ("${TCORE}" STREQUAL "STEAMROLLER") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_SSE3\n") + elseif ("${TCORE}" STREQUAL "EXCAVATOR") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_SSE3\n") + elseif ("${TCORE}" STREQUAL "NEHALEM") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_SSE3\n") + elseif ("${TCORE}" STREQUAL "PRESCOTT") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_SSE3\n") + elseif ("${TCORE}" STREQUAL "SANDYBRIDGE") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_AVX\n") + elseif ("${TCORE}" STREQUAL "HASWELL") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_AVX2\n") + elseif ("${TCORE}" STREQUAL "ZEN") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_AVX2\n") + elseif ("${TCORE}" STREQUAL "SKYLAKEX") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_AVX512\n") + elseif ("${TCORE}" STREQUAL "COOPERLAKE") + file(APPEND ${TARGET_CONF_TEMP} + "#define HAVE_AVX512\n") elseif ("${TCORE}" STREQUAL "ARMV7") file(APPEND ${TARGET_CONF_TEMP} "#define L1_DATA_SIZE\t65536\n" diff --git a/cmake/system.cmake b/cmake/system.cmake index 4cc4623..83b79ba 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -64,12 +64,39 @@ if (DEFINED TARGET) if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7) - set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3 -mavx2") endif() elseif (${CMAKE_C_COMPILER_ID} STREQUAL "CLANG") - set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3 -mavx2") endif() endif() + if (${TARGET} STREQUAL "ZEN" AND NOT NO_AVX2) + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3 -mavx2") + endif() + if (${TARGET} STREQUAL "SANDYBRIDGE" AND NOT NO_AVX) + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3 -mavx") + endif() + if (${TARGET} STREQUAL "BARCELONA") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "STEAMROLLER") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "EXCAVATOR") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "PILEDRIVER") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "PRESCOTT") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "NEHALEM") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() + if (${TARGET} STREQUAL "CORE2") + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3") + endif() if (DEFINED HAVE_SSE) set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse") endif() -- 2.7.4