[binutils-gdb] RISC-V: Add Ziccid extension

Kito Cheng kito@sourceware.org
Fri Nov 20 13:40:12 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9caf79667b214062cc9c3f5c4a58c5ac8567b0ae

commit 9caf79667b214062cc9c3f5c4a58c5ac8567b0ae
Author: Monk Chiang <monk.chiang@sifive.com>
Date:   Fri Nov 20 21:12:40 2026 +0800

    RISC-V: Add Ziccid extension
    
    Ziccid adds no instructions or CSRs, so only the extension name and
    the implied Ziccif are needed.  The spec has no version of its own, so
    use 1.0.
    
    https://github.com/riscv/riscv-isa-manual/pull/2598

Diff:
---
 bfd/elfxx-riscv.c                          | 2 ++
 gas/testsuite/gas/riscv/attribute-ziccid.d | 6 ++++++
 gas/testsuite/gas/riscv/march-help.l       | 1 +
 3 files changed, 9 insertions(+)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index c03198c64a8..b0ef1b61bf7 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1270,6 +1270,7 @@ static const struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"g", "+i,+m,+a,+f,+d,+zicsr,+zifencei", check_implicit_always},
   {"e", "+i", check_implicit_always},
   {"i", "+zicsr,+zifencei", check_implicit_for_i},
+  {"ziccid", "+ziccif", check_implicit_always},
   {"zicntr", "+zicsr", check_implicit_always},
   {"zihpm", "+zicsr", check_implicit_always},
 
@@ -1547,6 +1548,7 @@ static const struct riscv_supported_ext riscv_supported_std_z_ext[] =
   {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ziccamoc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ziccid",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
diff --git a/gas/testsuite/gas/riscv/attribute-ziccid.d b/gas/testsuite/gas/riscv/attribute-ziccid.d
new file mode 100644
index 00000000000..1f24bfb1915
--- /dev/null
+++ b/gas/testsuite/gas/riscv/attribute-ziccid.d
@@ -0,0 +1,6 @@
+#as: -march=rv64i_ziccid -misa-spec=20191213
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+  Tag_RISCV_arch: "rv64i2p1_ziccid1p0_ziccif1p0"
diff --git a/gas/testsuite/gas/riscv/march-help.l b/gas/testsuite/gas/riscv/march-help.l
index 726b52f9c2f..d7bb5aa13a4 100644
--- a/gas/testsuite/gas/riscv/march-help.l
+++ b/gas/testsuite/gas/riscv/march-help.l
@@ -13,6 +13,7 @@ All available -march extensions for RISC-V:
 	zic64b                                  1.0
 	ziccamoa                                1.0
 	ziccamoc                                1.0
+	ziccid                                  1.0
 	ziccif                                  1.0
 	zicclsm                                 1.0
 	ziccrse                                 1.0


More information about the Binutils-cvs mailing list