https://gcc.gnu.org/g:71b176096c00f0f77b1734294ec30f209209cc46
commit 71b176096c00f0f77b1734294ec30f209209cc46 Author: Dongyan Chen <chendong...@isrc.iscas.ac.cn> Date: Tue May 6 17:09:54 2025 -0600 [PATCH] RISC-V: Minimal support for sdtrig and ssstrict extensions. This patch support sdtrig and ssstrict extensions[1]. To enable GCC to recognize and process sdtrig and ssstrict extensions correctly at compile time. [1] https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc gcc/ChangeLog: * common/config/riscv/riscv-common.cc: New extension. gcc/testsuite/ChangeLog: * gcc.target/riscv/arch-47.c: New test. (cherry picked from commit 82126b26d17ed2c5ee48ca51e3fed69e898c9a20) Diff: --- gcc/common/config/riscv/riscv-common.cc | 3 +++ gcc/testsuite/gcc.target/riscv/arch-47.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 58c7d205b336..0233e1a108be 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -432,6 +432,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"zcmp", ISA_SPEC_CLASS_NONE, 1, 0}, {"zcmt", ISA_SPEC_CLASS_NONE, 1, 0}, + {"sdtrig", ISA_SPEC_CLASS_NONE, 1, 0}, + {"smaia", ISA_SPEC_CLASS_NONE, 1, 0}, {"smepmp", ISA_SPEC_CLASS_NONE, 1, 0}, {"smstateen", ISA_SPEC_CLASS_NONE, 1, 0}, @@ -440,6 +442,7 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"sscofpmf", ISA_SPEC_CLASS_NONE, 1, 0}, {"ssstateen", ISA_SPEC_CLASS_NONE, 1, 0}, {"sstc", ISA_SPEC_CLASS_NONE, 1, 0}, + {"ssstrict", ISA_SPEC_CLASS_NONE, 1, 0}, {"svade", ISA_SPEC_CLASS_NONE, 1, 0}, {"svadu", ISA_SPEC_CLASS_NONE, 1, 0}, diff --git a/gcc/testsuite/gcc.target/riscv/arch-47.c b/gcc/testsuite/gcc.target/riscv/arch-47.c new file mode 100644 index 000000000000..06bc80fe7800 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/arch-47.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc_sdtrig_ssstrict -mabi=lp64" } */ +int foo() +{ +}