aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKrste Asanovic <krste@eecs.berkeley.edu>2020-09-18 02:31:17 -0700
committerKrste Asanovic <krste@eecs.berkeley.edu>2020-09-18 02:31:17 -0700
commit6bff27cb63c6ac4c0574f308a6cce82b329b5895 (patch)
tree5dc83020791f707c7984740add3667e23e9f999d /src
parentbfe4256bc1b8f469c139dceae10d208490bfee8d (diff)
downloadriscv-isa-manual-6bff27cb63c6ac4c0574f308a6cce82b329b5895.zip
riscv-isa-manual-6bff27cb63c6ac4c0574f308a6cce82b329b5895.tar.gz
riscv-isa-manual-6bff27cb63c6ac4c0574f308a6cce82b329b5895.tar.bz2
Removed mandate that reserved dynamic rounding modes raise an illegal instruction exception.
Diffstat (limited to 'src')
-rw-r--r--src/f.tex54
1 files changed, 31 insertions, 23 deletions
diff --git a/src/f.tex b/src/f.tex
index 372a4eb..9f61c88 100644
--- a/src/f.tex
+++ b/src/f.tex
@@ -153,27 +153,18 @@ these extensions are not present, implementations shall ignore writes to
these bits and supply a zero value when read. Standard software should
preserve the contents of these bits.
-Floating-point operations use either a static rounding mode encoded in the
-instruction, or a dynamic rounding mode held in {\tt frm}. Rounding modes are
-encoded as shown in Table~\ref{rm}. A value of 111 in the instruction's {\em
-rm} field selects the dynamic rounding mode held in {\tt frm}. If {\tt frm}
-is set to an invalid value (101--111), any subsequent attempt to execute
-a floating-point operation with a dynamic rounding mode will raise an illegal
-instruction exception. Some instructions, including widening conversions,
-have the {\em rm} field but are nevertheless unaffected by the rounding mode;
-software should set their {\em rm} field to RNE (000).
+Floating-point operations use either a static rounding mode encoded in
+the instruction, or a dynamic rounding mode held in {\tt frm}.
+Rounding modes are encoded as shown in Table~\ref{rm}. A value of 111
+in the instruction's {\em rm} field selects the dynamic rounding mode
+held in {\tt frm}. The behavior of floating-point instructions that
+depend on rounding mode when executed with a reserved rounding mode is
+{\em reserved}, including both static reserved rounding modes (101--110) and
+dynamic reserved rounding modes (101--111). Some instructions, including
+widening conversions, have the {\em rm} field but are nevertheless
+unaffected by the rounding mode; software should set their {\em rm}
+field to RNE (000).
-\begin{commentary}
-The C99 language standard effectively mandates the provision of a
-dynamic rounding mode register. In typical implementations, writes to
-the dynamic rounding mode CSR state will serialize the pipeline.
-
-Static rounding modes are used to implement specialized arithmetic
-operations that often have to switch frequently between different
-rounding modes.
-\end{commentary}
-\newpage
-
\begin{table}[htp]
\begin{small}
\begin{center}
@@ -205,18 +196,18 @@ rounding modes.
\hline
\multicolumn{1}{|c|}{101} &
\multicolumn{1}{l|}{} &
-\multicolumn{1}{l|}{\em Invalid. Reserved for future use.}\\
+\multicolumn{1}{l|}{\em Reserved for future use.}\\
\hline
\multicolumn{1}{|c|}{110} &
\multicolumn{1}{l|}{} &
-\multicolumn{1}{l|}{\em Invalid. Reserved for future use.}\\
+\multicolumn{1}{l|}{\em Reserved for future use.}\\
\hline
\multicolumn{1}{|c|}{111} &
\multicolumn{1}{l|}{DYN} &
\multicolumn{1}{l|}{In instruction's {\em rm} field, selects dynamic rounding mode;}\\
\multicolumn{1}{|c|}{} &
\multicolumn{1}{l|}{} &
-\multicolumn{1}{l|}{In Rounding Mode register, {\em Invalid}.}\\
+\multicolumn{1}{l|}{In Rounding Mode register, {\em reserved}.}\\
\hline
\end{tabular}
\end{center}
@@ -225,6 +216,23 @@ rounding modes.
\label{rm}
\end{table}
+\begin{commentary}
+The C99 language standard effectively mandates the provision of a
+dynamic rounding mode register. In typical implementations, writes to
+the dynamic rounding mode CSR state will serialize the pipeline.
+Static rounding modes are used to implement specialized arithmetic
+operations that often have to switch frequently between different
+rounding modes.
+
+The ratified version of the F spec mandated that an illegal
+instruction exception was raised when an instruction was executed with
+a reserved dynamic rounding mode. This has been weakened to reserved,
+which matches the behavior of static rounding-mode instructions.
+Raising an illegal instruction exception is still valid behavior when
+encountering a reserved encoding, so implementations compatible with
+the ratified spec are compatible with the weakened spec.
+\end{commentary}
+
The accrued exception flags indicate the exception conditions that
have arisen on any floating-point arithmetic instruction since the
field was last reset by software, as shown in Table~\ref{bitdef}.