[PATCH] RISC-V: Add Svukte 1.0 extension support
Jiawei
jiawei@iscas.ac.cn
Sun Nov 22 04:49:31 GMT 2026
Add the Svukte extension for address-independent fault latency [1].
Register version 1.0, imply Zicsr and reject RV32, since the extension
requires Sv39.
Test the RV64 architecture attribute, RV32 rejection and -march help.
[1] https://github.com/riscv/riscv-isa-manual/pull/1564
bfd/ChangeLog:
* elfxx-riscv.c (riscv_implicit_subsets): Add Svukte.
(riscv_supported_std_s_ext): Likewise.
(riscv_parse_check_conflicts): Reject Svukte on RV32.
gas/ChangeLog:
* NEWS: Mention Svukte.
* testsuite/gas/riscv/attribute-svukte-rv64.d: New test.
* testsuite/gas/riscv/march-fail-rv32-svukte.d: Likewise.
* testsuite/gas/riscv/march-fail-rv32-svukte.l: New expected errors.
* testsuite/gas/riscv/march-help.l: Add Svukte.
---
bfd/elfxx-riscv.c | 8 ++++++++
gas/NEWS | 4 ++--
gas/testsuite/gas/riscv/attribute-svukte-rv64.d | 6 ++++++
gas/testsuite/gas/riscv/march-fail-rv32-svukte.d | 3 +++
gas/testsuite/gas/riscv/march-fail-rv32-svukte.l | 2 ++
gas/testsuite/gas/riscv/march-help.l | 1 +
6 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 gas/testsuite/gas/riscv/attribute-svukte-rv64.d
create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32-svukte.d
create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32-svukte.l
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 6a02d80bcd3..054319a7afb 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1433,6 +1433,7 @@ static const struct riscv_implicit_subset riscv_implicit_subsets[] =
{"svade", "+zicsr", check_implicit_always},
{"svadu", "+zicsr", check_implicit_always},
{"svbare", "+zicsr", check_implicit_always},
+ {"svukte", "+zicsr", check_implicit_always},
{NULL, NULL, NULL}
};
@@ -1712,6 +1713,7 @@ static const struct riscv_supported_ext riscv_supported_std_s_ext[] =
{"svnapot", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"svpbmt", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"svrsw60t59b", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"svukte", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"svvptc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"ssqosid", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"sspmp", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
@@ -2390,6 +2392,12 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
(_("`zclsd' conflicts with the `c+f'/`zcf' extension"));
no_conflict = false;
}
+ if (riscv_lookup_subset (rps->subset_list, "svukte", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `svukte' extension"),
+ xlen);
+ no_conflict = false;
+ }
if (riscv_lookup_subset (rps->subset_list, "ssnpm", &subset) && xlen != 64)
{
rps->error_handler (_ ("rv%d does not support the `ssnpm' extension"),
diff --git a/gas/NEWS b/gas/NEWS
index 58bbd8bfe1d..09583a3a32a 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -18,8 +18,8 @@
* Add support for new variants and encodings of RISC-V Zvabd extension v0.9.
* Add support for RISC-V standard extensions:
- ziccamoc 1.0, zama16b v1.0, sspmp v1.0, sspmpen v1.0, smpmpdeleg v1.0
- and shlcofideleg v1.0.
+ ziccamoc 1.0, zama16b v1.0, sspmp v1.0, sspmpen v1.0, smpmpdeleg v1.0,
+ shlcofideleg v1.0 and svukte v1.0.
* The RISC-V option -mpriv-spec, the configure option --with-priv-spec and
the privileged elf attributes set by .attribute are deprecated and have no
diff --git a/gas/testsuite/gas/riscv/attribute-svukte-rv64.d b/gas/testsuite/gas/riscv/attribute-svukte-rv64.d
new file mode 100644
index 00000000000..2914ebc1084
--- /dev/null
+++ b/gas/testsuite/gas/riscv/attribute-svukte-rv64.d
@@ -0,0 +1,6 @@
+#as: -march=rv64i_svukte
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+ Tag_RISCV_arch: "rv64i2p1_zicsr2p0_svukte1p0"
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32-svukte.d b/gas/testsuite/gas/riscv/march-fail-rv32-svukte.d
new file mode 100644
index 00000000000..fe3ddbfdff7
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-fail-rv32-svukte.d
@@ -0,0 +1,3 @@
+#as: -march=rv32i_svukte
+#source: empty.s
+#error_output: march-fail-rv32-svukte.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32-svukte.l b/gas/testsuite/gas/riscv/march-fail-rv32-svukte.l
new file mode 100644
index 00000000000..b3a3e51b9d6
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-fail-rv32-svukte.l
@@ -0,0 +1,2 @@
+.*Assembler messages:
+.*Error: rv32 does not support the `svukte' extension
diff --git a/gas/testsuite/gas/riscv/march-help.l b/gas/testsuite/gas/riscv/march-help.l
index d7bb5aa13a4..154338f5eb2 100644
--- a/gas/testsuite/gas/riscv/march-help.l
+++ b/gas/testsuite/gas/riscv/march-help.l
@@ -167,6 +167,7 @@ All available -march extensions for RISC-V:
svnapot 1.0
svpbmt 1.0
svrsw60t59b 1.0
+ svukte 1.0
svvptc 1.0
ssqosid 1.0
sspmp 1.0
base-commit: ab4dbb9838795fe09a82d41d86b47de29fbf80f3
--
2.43.0
More information about the Binutils
mailing list