diff options
author | Patrick O'Neill <patrick@rivosinc.com> | 2024-06-17 09:46:05 -0700 |
---|---|---|
committer | Patrick O'Neill <patrick@rivosinc.com> | 2024-06-17 09:49:47 -0700 |
commit | 4f18f75c5648d0b46a72f18e321bec279a6964be (patch) | |
tree | d7819caa9a858c8be7307fed75ed3263c81bea33 /gcc/common | |
parent | dae93785c9ebdaf6a0a4eeef51d399e2530679cd (diff) | |
download | gcc-4f18f75c5648d0b46a72f18e321bec279a6964be.zip gcc-4f18f75c5648d0b46a72f18e321bec279a6964be.tar.gz gcc-4f18f75c5648d0b46a72f18e321bec279a6964be.tar.bz2 |
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 <patrick@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/riscv/riscv-common.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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 && |