Merge pull request #26190 from mshabunin:fix-rvv-fp16-support

build: enable RISC-V FP16 support in the toolchain
This commit is contained in:
Alexander Smorkalov 2024-09-25 22:57:12 +03:00 committed by GitHub
commit e66d38e15f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,10 @@
# see https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html#index-march-14
function(ocv_set_platform_flags VAR)
if(ENABLE_RVV OR RISCV_RVV_SCALABLE)
if(ENABLE_RVV_ZVFH OR ENABLE_RVV_FP16)
set(flags "-march=rv64gc_v_zvfh")
elseif(ENABLE_RVV_ZVFHMIN OR ENABLE_FP16)
set(flags "-march=rv64gc_v_zvfhmin")
elseif(ENABLE_RVV OR RISCV_RVV_SCALABLE)
set(flags "-march=rv64gcv")
else()
set(flags "-march=rv64gc")