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:
449cd0c79a/src/m.tex (L173)
https://github.com/riscv/riscv-isa-manual/issues/869

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
This commit is contained in:
Marcin Szymczyk 2025-06-11 16:41:57 +02:00 committed by Dan Kalowsky
commit ab750eab5f

View file

@ -81,7 +81,9 @@ if(CONFIG_RISCV_ISA_EXT_ZBS)
string(CONCAT riscv_march ${riscv_march} "_zbs")
endif()
if(CONFIG_RISCV_ISA_EXT_ZMMUL AND
# Check whether we already imply Zmmul by selecting the M extension; if not - enable it
if(NOT CONFIG_RISCV_ISA_EXT_M AND
CONFIG_RISCV_ISA_EXT_ZMMUL AND
"${GCC_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13.0.0)
string(CONCAT riscv_march ${riscv_march} "_zmmul")
endif()