diff options
author | Dongyan Chen <chendongyan@isrc.iscas.ac.cn> | 2025-03-17 22:23:18 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2025-05-12 21:30:37 +0800 |
commit | d42f7244289ad8be1d3f7320528240bb849979e4 (patch) | |
tree | 5fa96951420db6a625d470fa9ceead96745a72dc /gcc/common | |
parent | 91bc8169edd9038d78f38bd813287d72e6345c26 (diff) | |
download | gcc-d42f7244289ad8be1d3f7320528240bb849979e4.zip gcc-d42f7244289ad8be1d3f7320528240bb849979e4.tar.gz gcc-d42f7244289ad8be1d3f7320528240bb849979e4.tar.bz2 |
RISC-V: Support for zilsd and zclsd extensions.
This patch support zilsd and zclsd[1] extensions.
To enable GCC to recognize and process zilsd and zclsd extension correctly at compile time.
[1] https://github.com/riscv/riscv-zilsd
Changes for v2:
- Remove the addition of zilsd extension in gcc/common/config/riscv/riscv-ext-bitmask.def
- Fix a bug with zilsd and zclsd extension dependency in gcc/common/config/riscv/riscv-common.cc
gcc/ChangeLog:
* common/config/riscv/riscv-common.cc
(riscv_subset_list::check_conflict_ext): New extension.
* config/riscv/riscv.opt: Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/arch-zilsd-1.c: New.
* gcc.target/riscv/arch-zilsd-2.c: New.
* gcc.target/riscv/arch-zilsd-3.c: New.
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/riscv/riscv-common.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index e06cd5f..c89931aa 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -115,6 +115,9 @@ static const riscv_implied_info_t riscv_implied_info[] = {"zicfiss", "zimop"}, {"zicfilp", "zicsr"}, + {"zclsd", "zilsd"}, + {"zclsd", "zca"}, + {"zk", "zkn"}, {"zk", "zkr"}, {"zk", "zkt"}, @@ -377,6 +380,9 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"zicntr", ISA_SPEC_CLASS_NONE, 2, 0}, {"zihpm", ISA_SPEC_CLASS_NONE, 2, 0}, + {"zilsd", ISA_SPEC_CLASS_NONE, 1, 0}, + {"zclsd", ISA_SPEC_CLASS_NONE, 1, 0}, + {"zk", ISA_SPEC_CLASS_NONE, 1, 0}, {"zkn", ISA_SPEC_CLASS_NONE, 1, 0}, {"zks", ISA_SPEC_CLASS_NONE, 1, 0}, @@ -1439,6 +1445,14 @@ riscv_subset_list::check_conflict_ext () if (lookup ("zcf") && m_xlen == 64) error_at (m_loc, "%<-march=%s%>: zcf extension supports in rv32 only", m_arch); + + if (lookup ("zilsd") && m_xlen == 64) + error_at (m_loc, "%<-march=%s%>: zilsd extension supports in rv32 only", + m_arch); + + if (lookup ("zclsd") && m_xlen == 64) + error_at (m_loc, "%<-march=%s%>: zclsd extension supports in rv32 only", + m_arch); if (lookup ("zfinx") && lookup ("f")) error_at (m_loc, @@ -1782,6 +1796,7 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = RISCV_EXT_FLAG_ENTRY ("ziccif", x_riscv_zi_subext, MASK_ZICCIF), RISCV_EXT_FLAG_ENTRY ("zicclsm", x_riscv_zi_subext, MASK_ZICCLSM), RISCV_EXT_FLAG_ENTRY ("ziccrse", x_riscv_zi_subext, MASK_ZICCRSE), + RISCV_EXT_FLAG_ENTRY ("zilsd", x_riscv_zi_subext, MASK_ZILSD), RISCV_EXT_FLAG_ENTRY ("zicboz", x_riscv_zicmo_subext, MASK_ZICBOZ), RISCV_EXT_FLAG_ENTRY ("zicbom", x_riscv_zicmo_subext, MASK_ZICBOM), @@ -1865,6 +1880,7 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = RISCV_EXT_FLAG_ENTRY ("zcd", x_riscv_zc_subext, MASK_ZCD), RISCV_EXT_FLAG_ENTRY ("zcmp", x_riscv_zc_subext, MASK_ZCMP), RISCV_EXT_FLAG_ENTRY ("zcmt", x_riscv_zc_subext, MASK_ZCMT), + RISCV_EXT_FLAG_ENTRY ("zclsd", x_riscv_zc_subext, MASK_ZCLSD), RISCV_EXT_FLAG_ENTRY ("svade", x_riscv_sv_subext, MASK_SVADE), RISCV_EXT_FLAG_ENTRY ("svadu", x_riscv_sv_subext, MASK_SVADU), |