diff --git a/Makefile.riscv64 b/Makefile.riscv64 index cffc77e803..d8da98d5f0 100644 --- a/Makefile.riscv64 +++ b/Makefile.riscv64 @@ -11,7 +11,7 @@ ifeq ($(BUILD_HFLOAT16), 1) RISCV64_OPT := $(RISCV64_OPT)_zvfh_zfh endif ifeq ($(BUILD_BFLOAT16), 1) -RISCV64_OPT := $(RISCV64_OPT)_zfbfmin_zvfbfmin_zvfbfwma +RISCV64_OPT := $(RISCV64_OPT)_zvfbfwma endif ifeq ($(CORE), RISCV64_ZVL256B) CCOMMON_OPT += -march=$(RISCV64_OPT)_zvl256b -mabi=lp64d diff --git a/driver/others/dynamic_riscv64.c b/driver/others/dynamic_riscv64.c index aa82845d4b..726f76d790 100644 --- a/driver/others/dynamic_riscv64.c +++ b/driver/others/dynamic_riscv64.c @@ -99,6 +99,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_IMA_V (1 << 2) #define RISCV_HWPROBE_EXT_ZFH (1 << 27) #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1 << 54) #ifndef NR_riscv_hwprobe #ifndef NR_arch_specific_syscall @@ -170,6 +171,8 @@ static gotoblas_t* get_coretype(void) { if (ret == 0) { #if defined(BUILD_HFLOAT16) vector_mask = (RISCV_HWPROBE_IMA_V | RISCV_HWPROBE_EXT_ZFH | RISCV_HWPROBE_EXT_ZVFH); +#elif defined(BUILD_BFLOAT16) + vector_mask = (RISCV_HWPROBE_IMA_V | RISCV_HWPROBE_EXT_ZVFBFWMA); #else vector_mask = RISCV_HWPROBE_IMA_V; #endif @@ -180,6 +183,10 @@ static gotoblas_t* get_coretype(void) { snprintf(coremsg, sizeof(coremsg), "Cpu support for Zfh+Zvfh extensions required due to BUILD_HFLOAT16=1\n"); openblas_warning(1, coremsg); return NULL; +#elif defined(BUILD_BFLOAT16) + snprintf(coremsg, sizeof(coremsg), "Cpu support for Zvfbfwma extensions required due to BUILD_BFLOAT16=1\n"); + openblas_warning(1, coremsg); + return NULL; #else if (!(getauxval(AT_HWCAP) & DETECT_RISCV64_HWCAP_ISA_V)) return NULL;