Skip to content

Commit ab750ea

Browse files
masz-nordicdkalowsk
authored andcommitted
cmake: compiler: gcc: riscv: remove spurious Zmmul
Zmmul is a subset of M extension. No need to enable Zmmul redundantly if M is already present. Reference: https://github.com/riscv/riscv-isa-manual/blob/449cd0c79ae91cc6f547726b8a6270f975be676e/src/m.tex#L173 riscv/riscv-isa-manual#869 Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
1 parent c481fed commit ab750ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/compiler/gcc/target_riscv.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ if(CONFIG_RISCV_ISA_EXT_ZBS)
8181
string(CONCAT riscv_march ${riscv_march} "_zbs")
8282
endif()
8383

84-
if(CONFIG_RISCV_ISA_EXT_ZMMUL AND
84+
# Check whether we already imply Zmmul by selecting the M extension; if not - enable it
85+
if(NOT CONFIG_RISCV_ISA_EXT_M AND
86+
CONFIG_RISCV_ISA_EXT_ZMMUL AND
8587
"${GCC_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13.0.0)
8688
string(CONCAT riscv_march ${riscv_march} "_zmmul")
8789
endif()

0 commit comments

Comments
 (0)