diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bfca7f..b74a146 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,9 @@ option(X86 "Build for x86" OFF ) option(RISCV "Build for RISC-V" OFF ) # accelerator options -option(AVX "Use AVX implementation" OFF) -option(RVV "Use RISCV vector extension implementation" OFF) -option(ZVFH "Use RISCV vector extension with half precision floating point" OFF) +option(AVX "Use AVX implementation" OFF ) +option(RVV "Use RISCV vector extension" OFF ) +option(ZVFH "Use RISCV half-precision floating-point vector extension" OFF) add_compile_options(-O1 -Wall -Wextra) @@ -49,18 +49,21 @@ set(SPECS_FILE "htif_nano.specs") set(SPEC_FLAGS -specs=${SPECS_FILE} -specs=${WRAP_SPECS_FILE}) set(MARCH "rv64gc") +set(MABI "lp64d") +set(MCMODEL "medany") + +# generate march flags if (RVV) list(APPEND MARCH "v") list(APPEND MARCH "_zicntr") if (ZVFH) list(APPEND MARCH "_zfh") + list(APPEND MARCH "_zvfh") endif() endif() list(JOIN MARCH "" MARCH) -set(MABI "lp64d") -set(MCMODEL "medany") if (NOT DEFINED LINKER_SCRIPT) set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/toolchain/htif.ld)