You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/tvm.tex
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1584,10 +1584,12 @@ \section*{Introduction}
1584
1584
\begin{itemize}
1585
1585
\item {\tt B7xx} --- {\tt QUIET} prefix, transforming any arithmetic operation into its ``quiet'' variant, indicated by prefixing a {\tt Q} to its mnemonic. Such operations return {\tt NaN}s instead of throwing integer overflow exceptions if the results do not fit in {\it Integer\/}s, or if one of their arguments is a {\tt NaN}. Notice that this does not extend to shift amounts and other parameters that must be within a small range (e.g., 0--1023). Also notice that this does not disable type-checking exceptions if a value of a type other than {\it Integer\/} is supplied.
1586
1586
\item {\tt B7A0} --- {\tt QADD} ($x$$y$ -- $x+y$), always works if $x$ and $y$ are {\it Integer\/}s, but returns a {\tt NaN} if the addition cannot be performed.
1587
+
\item {\tt B7A8} --- {\tt QMUL} ($x$$y$ -- $xy$), returns the product of $x$ and $y$ if $-2^{256}\leq xy<2^{256}$. Otherwise returns a {\tt NaN}, even if $x=0$ and $y$ is a {\tt NaN}.
1587
1588
\item {\tt B7A904} --- {\tt QDIV} ($x$$y$ -- $\lfloor x/y\rfloor$), returns a {\tt NaN} if $y=0$, or if $y=-1$ and $x=-2^{256}$, or if either of $x$ or $y$ is a {\tt NaN}.
1589
+
\item {\tt B7A98C} --- {\tt QMULDIVMOD} ($x$$y$$z$ -- $q$$r$), where $q:=\lfloor x\cdot y/z\rfloor$, $r:=x\cdot y\bmod z$. If $z=0$, or if at least one of $x$, $y$, or $z$ is a {\tt NaN}, both $q$ and $r$ are set to {\tt NaN}. Otherwise the correct value of $r$ is always returned, but $q$ is replaced with {\tt NaN} if $q<-2^{256}$ or $q\geq2^{256}$.
1588
1590
\item {\tt B7B0} --- {\tt QAND} ($x$$y$ -- $x\&y$), bitwise ``and'' (similar to {\tt AND}), but returns a {\tt NaN} if either $x$ or $y$ is a {\tt NaN} instead of throwing an integer overflow exception. However, if one of the arguments is zero, and the other is a {\tt NaN}, the result is zero.
1589
1591
\item {\tt B7B1} --- {\tt QOR} ($x$$y$ -- $x\vee y$), bitwise ``or''. If $x=-1$ or $y=-1$, the result is always $-1$, even if the other argument is a {\tt NaN}.
1590
-
\item {\tt B7B507} --- {\tt QUFITS 8} ($x$ -- $x'$), checks whether $x$ is an unsigned byte (i.e., whether $0\leq x<2^8$), and replaces $x$ with a {\tt NaN} if this is not the case; leaves $x$ intact otherwise (i.e., if $x$ is an unsigned byte).
1592
+
\item {\tt B7B507} --- {\tt QUFITS 8} ($x$ -- $x'$), checks whether $x$ is an unsigned byte (i.e., whether $0\leq x<2^8$), and replaces $x$ with a {\tt NaN} if this is not the case; leaves $x$ intact otherwise (i.e., if $x$ is an unsigned byte or a {\tt NaN}).
1591
1593
\end{itemize}
1592
1594
1593
1595
\mysubsection{Comparison primitives}
@@ -1991,7 +1993,6 @@ \section*{Introduction}
1991
1993
\begin{itemize}
1992
1994
\item {\tt F2FF} --- {\tt TRY} ($c$$c'$ -- ), sets {\tt c2} to $c'$, first saving the old value of {\tt c2} both into the savelist of $c'$ and into the savelist of the current continuation, which is stored into $c.{\tt c0}$ and $c'.{\tt c0}$. Then runs $c$ similarly to {\tt EXECUTE}. If $c$ does not throw any exceptions, the original value of {\tt c2} is automatically restored on return from $c$. If an exception occurs, the execution is transferred to $c'$, but the original value of {\tt c2} is restored in the process, so that $c'$ can re-throw the exception by {\tt THROWANY} if it cannot handle it by itself.
1993
1995
\item {\tt F3$pr$} --- {\tt TRYARGS $p$,$r$} ($c$$c'$ -- ), similar to {\tt TRY}, but with {\tt CALLARGS $p$,$r$} internally used instead of {\tt EXECUTE}. In this way, all but the top $0\leq p\leq15$ stack elements will be saved into current continuation's stack, and then restored upon return from either $c$ or $c'$, with the top $0\leq r\leq15$ values of the resulting stack of $c$ or $c'$ copied as return values.
1994
-
\item {\tt F2FE} --- {\tt TRYKEEP} ($c$$c'$ -- ), similar to {\tt TRY}, but when an exception occurs, $c'$ receives all the stack slots populated upon entering $c$ with two exception arguments on top. All changes made by $c$ in those slots are kept and become visible to $c'$; all extra slots created by $c$ on top of the kept ones get discarded upon entering $c'$.
The message and address manipulation primitives listed below serialize and deserialize values according to the following TL-B scheme (cf.~\ptref{sp:tlb.brief}):
0 commit comments