aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElisa Sawyer <78001874+elisa-riscv@users.noreply.github.com>2021-09-30 08:21:21 -0700
committerGitHub <noreply@github.com>2021-09-30 08:21:21 -0700
commitd9210c0fae66b214d926f5a50e214db33aba0f63 (patch)
treec2158959a28cc038bf569a44728ba5b7917e4d3f
parente104c198c4532e54c441156f1c893cd1715387e1 (diff)
parent8006631f74d6cf5b75c8cb86cc54e4f8db3954b7 (diff)
downloadriscv-isa-manual-d9210c0fae66b214d926f5a50e214db33aba0f63.zip
riscv-isa-manual-d9210c0fae66b214d926f5a50e214db33aba0f63.tar.gz
riscv-isa-manual-d9210c0fae66b214d926f5a50e214db33aba0f63.tar.bz2
Merge pull request #746 from adurbin-rivos/check_manual
zihintpause: Annotate notes and correct instruction encoding
-rw-r--r--src/images/wavedrom/zihintpause-hint.adoc4
-rw-r--r--src/zihintpause.adoc16
2 files changed, 13 insertions, 7 deletions
diff --git a/src/images/wavedrom/zihintpause-hint.adoc b/src/images/wavedrom/zihintpause-hint.adoc
index 86d966a..298e46d 100644
--- a/src/images/wavedrom/zihintpause-hint.adoc
+++ b/src/images/wavedrom/zihintpause-hint.adoc
@@ -7,11 +7,11 @@
{bits: 5, name: 'rd', attr: 0},
{bits: 3, name: 'func3', attr: 'PAUSE', type: 8},
{bits: 5, name: 'rs1', attr: 0},
- {bits: 1, name: 'SW', attr: 1},
+ {bits: 1, name: 'SW', attr: 0},
{bits: 1, name: 'SR', attr: 0},
{bits: 1, name: 'SO', attr: 0},
{bits: 1, name: 'SI', attr: 0},
- {bits: 1, name: 'PW', attr: 0},
+ {bits: 1, name: 'PW', attr: 1},
{bits: 1, name: 'PR', attr: 0},
{bits: 1, name: 'PO', attr: 0},
{bits: 1, name: 'PI', attr: 0},
diff --git a/src/zihintpause.adoc b/src/zihintpause.adoc
index 9b30a61..49dad7e 100644
--- a/src/zihintpause.adoc
+++ b/src/zihintpause.adoc
@@ -8,6 +8,8 @@ state is changed.
(((PAUSE, HINT)))
(((HINT, PAUSE)))
+[NOTE]
+====
Software can use the PAUSE instruction to reduce energy consumption
while executing spin-wait code sequences. Multithreaded cores might
temporarily relinquish execution resources to other harts when PAUSE is
@@ -35,10 +37,18 @@ loops in portable code, however, only one PAUSE instruction should be
used before re-evaluating loop conditions, else the hart might stall
longer than optimal on some implementations, degrading system
performance.
+====
PAUSE is encoded as a FENCE instruction with _pred_=W, _succ_=0, _fm_=0,
_rd_=`x0`, and _rs1_=`x0`.
+include::images/wavedrom/zihintpause-hint.adoc[]
+[zihintpause-hint]
+.Zihintpause fence instructions
+image::image_placeholder.png[]
+
+[NOTE]
+====
PAUSE is encoded as a hint within the FENCE opcode because some
implementations are expected to deliberately stall the PAUSE instruction
until outstanding memory transactions have completed. Because the
@@ -46,11 +56,6 @@ successor set is null, however, PAUSE does not _mandate_ any particular
memory ordering—hence, it truly is a HINT.
(((PAUSE, encoding)))
-include::images/wavedrom/zihintpause-hint.adoc[]
-[zihintpause-hint]
-.Zihintpause fence instructions
-image::image_placeholder.png[]
-
Like other FENCE instructions, PAUSE cannot be used within LR/SC
sequences without voiding the forward-progress guarantee.
(((PAUSE, LR/RC sequences)))
@@ -58,4 +63,5 @@ sequences without voiding the forward-progress guarantee.
The choice of a predecessor set of W is arbitrary, since the successor
set is null. Other HINTs similar to PAUSE might be encoded with other
predecessor sets.
+====