From 4f18f75c5648d0b46a72f18e321bec279a6964be Mon Sep 17 00:00:00 2001 From: Patrick O'Neill Date: Mon, 17 Jun 2024 09:46:05 -0700 Subject: RISC-V: Add configure check for Zaamo/Zalrsc assembler support Binutils 2.42 and before don't support Zaamo/Zalrsc. Add a configure check to prevent emitting Zaamo/Zalrsc in the arch string when the assember does not support it. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_subset_list::to_string): Skip zaamo/zalrsc when not supported by the assembler. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Add zaamo/zalrsc assmeber check. Signed-off-by: Patrick O'Neill Acked-by: Palmer Dabbelt # RISC-V Reviewed-by: Palmer Dabbelt # RISC-V --- gcc/common/config/riscv/riscv-common.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/common') diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 78dfd6b..1dc1d99 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -916,6 +916,7 @@ riscv_subset_list::to_string (bool version_p) const riscv_subset_t *subset; bool skip_zifencei = false; + bool skip_zaamo_zalrsc = false; bool skip_zicsr = false; bool i2p0 = false; @@ -943,6 +944,10 @@ riscv_subset_list::to_string (bool version_p) const a mistake in that binutils 2.35 supports zicsr but not zifencei. */ skip_zifencei = true; #endif +#ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC + /* Skip since binutils 2.42 and earlier don't recognize zaamo/zalrsc. */ + skip_zaamo_zalrsc = true; +#endif for (subset = m_head; subset != NULL; subset = subset->next) { @@ -954,6 +959,12 @@ riscv_subset_list::to_string (bool version_p) const subset->name == "zicsr") continue; + if (skip_zaamo_zalrsc && subset->name == "zaamo") + continue; + + if (skip_zaamo_zalrsc && subset->name == "zalrsc") + continue; + /* For !version_p, we only separate extension with underline for multi-letter extension. */ if (!first && -- cgit v1.1