aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2022-08-24 22:21:50 -0700
committerAndrew Waterman <andrew@sifive.com>2022-08-24 22:21:50 -0700
commitbda19b952253e4b47828b6129cf1a6746781d0f5 (patch)
tree5c2219142b21ce90b404143385c70059e6f96b7b
parent69c1f73d73c2cd3f369eae6b1ab2061509b3e2c7 (diff)
downloadriscv-isa-manual-bda19b952253e4b47828b6129cf1a6746781d0f5.zip
riscv-isa-manual-bda19b952253e4b47828b6129cf1a6746781d0f5.tar.gz
riscv-isa-manual-bda19b952253e4b47828b6129cf1a6746781d0f5.tar.bz2
Zfb also contains FCVT.JS.W.D
-rw-r--r--src/zfb.tex22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/zfb.tex b/src/zfb.tex
index 2d152ed..9c801a0 100644
--- a/src/zfb.tex
+++ b/src/zfb.tex
@@ -69,6 +69,28 @@ implement the other operations in the roundToIntegral family.
\end{commentary}
+\section{JavaScript Convert-to-Integer Instruction}
+
+The FCVT.JS.W.D instruction is defined similarly to the FCVT.W.D
+instruction, with the following differences.
+FCVT.JS.W.D always rounds towards zero.
+Rounded results outside the range $\left[-2^{31}, 2^{31}-1\right]$
+are taken modulo $2^{32}$, retaining the original sign.
+$\pm\infty$ and NaN are converted to zero.
+
+Floating-point exception flags are raised in the same manner as for FCVT.W.D.
+
+This instruction is only provided if the D extension is implemented.
+It is encoded like FCVT.W.D, but with the {\rm rs2} field set to 8
+and the {\em rm} field set to 1 (RTZ).
+Other {\em rm} values are {\em reserved}.
+
+\begin{commentary}
+The FCVT.JS.W.D instruction accelerates processing of JavaScript
+{\tt Number}s. {\tt Number}s are double-precision values, but some
+operators implicitly truncate them to signed integers mod $2^{32}$.
+\end{commentary}
+
\section{Comparison Instructions}
The FLEQ.S and FLTQ.S instructions are defined like the FLE.S and FLT.S