This is a new RISC-V extension that will be ratified soon.  The svukte
extension provides address-independent latency of user-mode faults to
supervisor addresses.

My plan is this patch will defer until the extension is ratified and
GCC 17 is open.

Ref: https://github.com/riscv/riscv-isa-manual/pull/1564

gcc/ChangeLog:

        * config/riscv/riscv-ext.def (svukte): New extension.
        * doc/riscv-ext.texi: Document svukte extension.
---
 gcc/config/riscv/riscv-ext.def | 13 +++++++++++++
 gcc/doc/riscv-ext.texi         |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/gcc/config/riscv/riscv-ext.def b/gcc/config/riscv/riscv-ext.def
index 80f534c6461..8ba42c1fca4 100644
--- a/gcc/config/riscv/riscv-ext.def
+++ b/gcc/config/riscv/riscv-ext.def
@@ -2078,6 +2078,19 @@ DEFINE_RISCV_EXT(
   /* BITMASK_BIT_POSITION*/ BITMASK_NOT_YET_ALLOCATED,
   /* EXTRA_EXTENSION_FLAGS */ 0)
 
+DEFINE_RISCV_EXT(
+  /* NAME */ svukte,
+  /* UPPERCASE_NAME */ SVUKTE,
+  /* FULL_NAME */ "Address-Independent Latency of User-Mode Faults to 
Supervisor Addresses",
+  /* DESC */ "",
+  /* URL */ ,
+  /* DEP_EXTS */ ({"zicsr"}),
+  /* SUPPORTED_VERSIONS */ ({{0, 4}}),
+  /* FLAG_GROUP */ sv,
+  /* BITMASK_GROUP_ID */ BITMASK_NOT_YET_ALLOCATED,
+  /* BITMASK_BIT_POSITION*/ BITMASK_NOT_YET_ALLOCATED,
+  /* EXTRA_EXTENSION_FLAGS */ 0)
+
 #include "riscv-ext-corev.def"
 #include "riscv-ext-sifive.def"
 #include "riscv-ext-thead.def"
diff --git a/gcc/doc/riscv-ext.texi b/gcc/doc/riscv-ext.texi
index 13056e73bad..e41c74932e7 100644
--- a/gcc/doc/riscv-ext.texi
+++ b/gcc/doc/riscv-ext.texi
@@ -618,6 +618,10 @@
 @tab 1.0
 @tab Satp mode bare is supported
 
+@item svukte
+@tab 0.4
+@tab Address-Independent Latency of User-Mode Faults to Supervisor Addresses
+
 @item xcvalu
 @tab 1.0
 @tab Core-V miscellaneous ALU extension
-- 
2.34.1

Reply via email to