Support the Ssccptr extension, which allows the main memory to support
page table reads.
gcc/ChangeLog:
* config/riscv/riscv-ext.def: New extension definition.
* config/riscv/riscv-ext.opt: New extension mask.
* doc/riscv-ext.texi: Document the new extension.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/arch-ssccptr.c: New test.
Signed-off-by: Jiawei <[email protected]>
---
gcc/config/riscv/riscv-ext.def | 13 +++++++++++++
gcc/config/riscv/riscv-ext.opt | 2 ++
gcc/doc/riscv-ext.texi | 4 ++++
gcc/testsuite/gcc.target/riscv/arch-ssccptr.c | 5 +++++
4 files changed, 24 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/riscv/arch-ssccptr.c
diff --git a/gcc/config/riscv/riscv-ext.def b/gcc/config/riscv/riscv-ext.def
index 98e7b82c8d1..958e915e9cc 100644
--- a/gcc/config/riscv/riscv-ext.def
+++ b/gcc/config/riscv/riscv-ext.def
@@ -1805,6 +1805,19 @@ DEFINE_RISCV_EXT(
/* BITMASK_BIT_POSITION*/ BITMASK_NOT_YET_ALLOCATED,
/* EXTRA_EXTENSION_FLAGS */ 0)
+DEFINE_RISCV_EXT(
+ /* NAME */ ssccptr,
+ /* UPPERCASE_NAME */ SSCCPTR,
+ /* FULL_NAME */ "Main memory supports page table reads",
+ /* DESC */ "",
+ /* URL */ ,
+ /* DEP_EXTS */ ({""}),
+ /* SUPPORTED_VERSIONS */ ({{1, 0}}),
+ /* FLAG_GROUP */ ss,
+ /* BITMASK_GROUP_ID */ BITMASK_NOT_YET_ALLOCATED,
+ /* BITMASK_BIT_POSITION*/ BITMASK_NOT_YET_ALLOCATED,
+ /* EXTRA_EXTENSION_FLAGS */ 0)
+
DEFINE_RISCV_EXT(
/* NAME */ sscofpmf,
/* UPPERCASE_NAME */ SSCOFPMF,
diff --git a/gcc/config/riscv/riscv-ext.opt b/gcc/config/riscv/riscv-ext.opt
index 73868798db6..f851678236b 100644
--- a/gcc/config/riscv/riscv-ext.opt
+++ b/gcc/config/riscv/riscv-ext.opt
@@ -355,6 +355,8 @@ Mask(SMDBLTRP) Var(riscv_sm_subext)
Mask(SSAIA) Var(riscv_ss_subext)
+Mask(SSCCPTR) Var(riscv_ss_subext)
+
Mask(SSCOFPMF) Var(riscv_ss_subext)
Mask(SSCSRIND) Var(riscv_ss_subext)
diff --git a/gcc/doc/riscv-ext.texi b/gcc/doc/riscv-ext.texi
index 2d2631e726d..83aa436b466 100644
--- a/gcc/doc/riscv-ext.texi
+++ b/gcc/doc/riscv-ext.texi
@@ -534,6 +534,10 @@
@tab 1.0
@tab Advanced interrupt architecture extension for supervisor-mode
+@item ssccptr
+@tab 1.0
+@tab Main memory supports page table reads
+
@item sscofpmf
@tab 1.0
@tab Count overflow & filtering extension
diff --git a/gcc/testsuite/gcc.target/riscv/arch-ssccptr.c
b/gcc/testsuite/gcc.target/riscv/arch-ssccptr.c
new file mode 100644
index 00000000000..902155a0818
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/arch-ssccptr.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64i_ssccptr -mabi=lp64" } */
+int foo()
+{
+}
--
2.43.0