mirror of
https://github.com/OpenMathLib/OpenBLAS
synced 2026-06-15 07:51:43 +08:00
Merge pull request #5509 from martin-frbg/cmake_riscv
CMake: Add default compiler options for RISCV
This commit is contained in:
@@ -391,6 +391,30 @@ if (${CORE} STREQUAL PPCG4)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
if ((${CORE} STREQUAL RISCV64_ZVL128B) OR (${CORE} STREQUAL RISCV64_ZVL256B))
|
||||
set (RISCV64_OPT "rv64imafdcv")
|
||||
if (BUILD_BFLOAT16)
|
||||
set (RISCV64_OPT "${RISCV64_OPT}_zvfbfwma")
|
||||
endif()
|
||||
if (BUILD_HFLOAT16)
|
||||
set (RISCV64_OPT "${RISCV64_OPT}_zvfh_zfh")
|
||||
endif()
|
||||
if (${CORE} STREQUAL RISCV64_ZVL256B)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=${RISCV64_OPT}_zvl256b -mabi=lp64d")
|
||||
endif()
|
||||
if (${CORE} STREQUAL RISCV64_ZVL128B)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=${RISCV64_OPT}_zvl128b -mabi=lp64d")
|
||||
endif()
|
||||
endif()
|
||||
if (${CORE} STREQUAL RISCV64_GENERIC)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=rv64imafdc -mabi=lp64d")
|
||||
endif()
|
||||
if (${CORE} STREQUAL x280)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=rv64imafdcv_zba_zbb_zfh_zvl512b -mabi=lp64d")
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
if (HAVE_AVX2)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -mavx2")
|
||||
|
||||
@@ -381,6 +381,28 @@ if (${TARGET} STREQUAL NEOVERSEV1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ((${TARGET} STREQUAL RISCV64_ZVL128B) OR (${TARGET} STREQUAL RISCV64_ZVL256B))
|
||||
set (RISCV64_OPT "rv64imafdcv")
|
||||
if (BUILD_BFLOAT16)
|
||||
set (RISCV64_OPT "${RISCV64_OPT}_zvfbfwma")
|
||||
endif()
|
||||
if (BUILD_HFLOAT16)
|
||||
set (RISCV64_OPT "${RISCV64_OPT}_zvfh_zfh")
|
||||
endif()
|
||||
if (${TARGET} STREQUAL RISCV64_ZVL256B)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=${RISCV64_OPT}_zvl256b -mabi=lp64d")
|
||||
endif()
|
||||
if (${TARGET} STREQUAL RISCV64_ZVL128B)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=${RISCV64_OPT}_zvl128b -mabi=lp64d")
|
||||
endif()
|
||||
endif()
|
||||
if (${TARGET} STREQUAL RISCV64_GENERIC)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=rv64imafdc -mabi=lp64d")
|
||||
endif()
|
||||
if (${TARGET} STREQUAL x280)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=rv64imafdcv_zba_zbb_zfh_zvl512b -mabi=lp64d")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (DEFINED BINARY)
|
||||
|
||||
Reference in New Issue
Block a user