diff --git a/Jenkinsfile b/Jenkinsfile index baeeee59ff..c4d2a4147f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,5 +10,10 @@ pipeline { sh 'make clean && make' } } + stage('CMakeBuild') { + steps { + sh 'sudo apt update && sudo apt install cmake -y && make clean && rm -rf build && mkdir build && cd build && cmake -DDYNAMIC_ARCH=1 .. && make' + } + } } } diff --git a/cmake/arch.cmake b/cmake/arch.cmake index d9a7aafd62..f5e901a316 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -94,7 +94,13 @@ if (DYNAMIC_ARCH) set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST}) endif () endif () - + + if (ZARCH) + set(DYNAMIC_CORE Z13 Z14 ZARCH_GENERIC) + set(DYN_Z13 1) + set(DYN_Z14 1) + endif () + if (LOONGARCH64) set(DYNAMIC_CORE LA64_GENERIC LA264 LA464) endif () diff --git a/cmake/cc.cmake b/cmake/cc.cmake index 952b2dd7ad..b3d9e9dc7b 100644 --- a/cmake/cc.cmake +++ b/cmake/cc.cmake @@ -86,6 +86,10 @@ if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "LS set(BINARY_DEFINED 1) endif () + if (ZARCH) + set (BINARY_DEFINED 1) + endif () + if (CMAKE_SYSTEM_NAME STREQUAL "AIX") set(BINARY_DEFINED 1) endif () diff --git a/cmake/system.cmake b/cmake/system.cmake index bf4c548b92..8dded3c215 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -316,6 +316,13 @@ if (DEFINED TARGET) set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math") endif() +if (${TARGET} STREQUAL Z13) + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=z13 -mzvector") +endif() +if (${TARGET} STREQUAL Z14) + set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=z14 -mzvector") +endif() + if (${TARGET} STREQUAL NEOVERSEV1) if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE) set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -Msve_intrinsics -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1") @@ -485,7 +492,7 @@ if (SMALL_MATRIX_OPT) endif () if (DYNAMIC_ARCH) - if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64 OR LOONGARCH64) + if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64 OR LOONGARCH64 OR ZARCH) set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH") if (DYNAMIC_OLDER) set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER") diff --git a/cmake/system_check.cmake b/cmake/system_check.cmake index dd0dfab637..3d987c3062 100644 --- a/cmake/system_check.cmake +++ b/cmake/system_check.cmake @@ -50,6 +50,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64.*") set(LOONGARCH64 1) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64.*") set(RISCV64 1) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390.*") + set(ZARCH 1) + set(BINARY 64) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")) if (NOT BINARY) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") @@ -100,6 +103,8 @@ elseif(X86) set(ARCH "x86") elseif(POWER) set(ARCH "power") +elseif(ZARCH) + set(ARCH "zarch") elseif(MIPS32) set(ARCH "mips") elseif(MIPS64) diff --git a/driver/others/CMakeLists.txt b/driver/others/CMakeLists.txt index ebcc0aa781..e963fd9dda 100644 --- a/driver/others/CMakeLists.txt +++ b/driver/others/CMakeLists.txt @@ -52,6 +52,8 @@ if (DYNAMIC_ARCH) list(APPEND COMMON_SOURCES dynamic_arm64.c) elseif (POWER) list(APPEND COMMON_SOURCES dynamic_power.c) + elseif (ZARCH) + list(APPEND COMMON_SOURCES dynamic_zarch.c) elseif (RISCV64) list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c) elseif (LOONGARCH64)