aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2024-07-02 19:21:23 -0700
committerAndrew Waterman <andrew@sifive.com>2024-07-02 19:21:44 -0700
commitb832c5bb7915064167a0fe9697433c7c66b42c0e (patch)
tree462a4ffe15abfdae647c98dd967c78e88ca5ba10 /src
parent5ba4a13a5a8316d0ab06d781d337f0955563e770 (diff)
downloadriscv-isa-manual-b832c5bb7915064167a0fe9697433c7c66b42c0e.zip
riscv-isa-manual-b832c5bb7915064167a0fe9697433c7c66b42c0e.tar.gz
riscv-isa-manual-b832c5bb7915064167a0fe9697433c7c66b42c0e.tar.bz2
Relax behavior of some HINTs when MXLEN > XLEN
Diffstat (limited to 'src')
-rw-r--r--src/machine.adoc15
-rw-r--r--src/priv-preface.adoc1
-rw-r--r--src/supervisor.adoc14
3 files changed, 30 insertions, 0 deletions
diff --git a/src/machine.adoc b/src/machine.adoc
index a797687..c009a95 100644
--- a/src/machine.adoc
+++ b/src/machine.adoc
@@ -581,6 +581,21 @@ always be a software bug, but machine operation is well-defined even in
this case.
====
+Some HINT instructions are encoded as integer computational instructions that
+overwrite their destination register with its current value, e.g.,
+`c.addi x8, 0`.
+When such a HINT is executed with XLEN < MXLEN and bits MXLEN..XLEN of the
+destination register not all equal to bit XLEN-1, it is implementation-defined
+whether bits MXLEN..XLEN of the destination register are unchanged or are
+overwritten with copies of bit XLEN-1.
+
+NOTE: This definition allows implementations to elide register writeback for
+some HINTs, while allowing them to execute other HINTs in the same manner as
+other integer computational instructions.
+The implementation choice is observable only by privilege modes with an XLEN
+setting greater than the current XLEN; it is invisible to the current
+privilege mode.
+
===== Memory Privilege in `mstatus` Register
The MPRV (Modify PRiVilege) bit modifies the _effective privilege mode_,
diff --git a/src/priv-preface.adoc b/src/priv-preface.adoc
index 25712c5..d3c277e 100644
--- a/src/priv-preface.adoc
+++ b/src/priv-preface.adoc
@@ -93,6 +93,7 @@ implemented.
* Specified synchronization requirements when changing the PBMTE fields
in `menvcfg` and `henvcfg`.
* Exposed count-overflow interrups to VS-mode via the Shlcofideleg extension.
+* Relaxed behavior of some HINTs when MXLEN > XLEN.
Finally, the following clarifications and document improvments have been made
since the last document release:
diff --git a/src/supervisor.adoc b/src/supervisor.adoc
index daecbc2..0a098be 100644
--- a/src/supervisor.adoc
+++ b/src/supervisor.adoc
@@ -149,6 +149,20 @@ and load and store effective addresses are taken modulo
latexmath:[$2^{\text{UXLEN}}$]. For example, when UXLEN=32 and SXLEN=64,
user-mode memory accesses reference the lowest 4 GiB of the address space.
+Some HINT instructions are encoded as integer computational instructions that
+overwrite their destination register with its current value, e.g.,
+`c.addi x8, 0`.
+When such a HINT is executed with XLEN < SXLEN and bits SXLEN..XLEN of the
+destination register not all equal to bit XLEN-1, it is implementation-defined
+whether bits SXLEN..XLEN of the destination register are unchanged or are
+overwritten with copies of bit XLEN-1.
+
+NOTE: This definition allows implementations to elide register writeback for
+some HINTs, while allowing them to execute other HINTs in the same manner as
+other integer computational instructions.
+The implementation choice is observable only by S-mode with SXLEN > UXLEN; it
+is invisible to U-mode.
+
[[sum]]
===== Memory Privilege in `sstatus` Register