Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TVM Whitepaper: Correct Serialization Instruction for F4A6_ #1336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/tvm.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ \section*{Introduction}
\item {\tt F4A1} --- {\tt DICTUGETJMP} ($i$ $D$ $n$ -- ), similar to {\tt DICTIGETJMP}, but performs {\tt DICTUGET} instead of {\tt DICTIGET}.
\item {\tt F4A2} --- {\tt DICTIGETEXEC} ($i$ $D$ $n$ -- ), similar to {\tt DICTIGETJMP}, but with {\tt EXECUTE} instead of {\tt JMPX}.
\item {\tt F4A3} --- {\tt DICTUGETEXEC} ($i$ $D$ $n$ -- ), similar to {\tt DICTUGETJMP}, but with {\tt EXECUTE} instead of {\tt JMPX}.
\item {\tt F4A6\_$n$} --- {\tt DICTPUSHCONST $n$} ( -- $D$ $n$), pushes a non-empty constant dictionary $D$ (as a $\textit{Cell\/}^?$) along with its key length $0\leq n\leq 1023$, stored as a part of the instruction. The dictionary itself is created from the first of remaining references of the current continuation. In this way, the complete {\tt DICTPUSHCONST} instruction can be obtained by first serializing {\tt xF4A8\_}, then the non-empty dictionary itself (one {\tt 1} bit and a cell reference), and then the unsigned 10-bit integer $n$ (as if by a {\tt STU 10} instruction). An empty dictionary can be pushed by a {\tt NEWDICT} primitive (cf.~\ptref{sp:prim.dict.create}) instead.
\item {\tt F4A6\_$n$} --- {\tt DICTPUSHCONST $n$} ( -- $D$ $n$), pushes a non-empty constant dictionary $D$ (as a $\textit{Cell\/}^?$) along with its key length $0\leq n\leq 1023$, stored as a part of the instruction. The dictionary itself is created from the first of remaining references of the current continuation. In this way, the complete {\tt DICTPUSHCONST} instruction can be obtained by first serializing {\tt xF4A4\_}, then the non-empty dictionary itself (one {\tt 1} bit and a cell reference), and then the unsigned 10-bit integer $n$ (as if by a {\tt STU 10} instruction). An empty dictionary can be pushed by a {\tt NEWDICT} primitive (cf.~\ptref{sp:prim.dict.create}) instead.
\item {\tt F4A8} --- {\tt PFXDICTGETQ} ($s$ $D$ $n$ -- $s'$ $x$ $s''$ $-1$ or $s$ $0$), looks up the unique prefix of {\em Slice} $s$ present in the prefix code dictionary (cf.~\ptref{sp:pfx.dict.tlb}) represented by $\textit{Cell\/}^?$ $D$ and $0\leq n\leq 1023$. If found, the prefix of $s$ is returned as $s'$, and the corresponding value (also a {\em Slice}) as $x$. The remainder of $s$ is returned as a {\em Slice\/} $s''$. If no prefix of $s$ is a key in prefix code dictionary $D$, returns the unchanged $s$ and a zero flag to indicate failure.
\item {\tt F4A9} --- {\tt PFXDICTGET} ($s$ $D$ $n$ -- $s'$ $x$ $s''$), similar to {\tt PFXDICTGET}, but throws a cell deserialization failure exception on failure.
\item {\tt F4AA} --- {\tt PFXDICTGETJMP} ($s$ $D$ $n$ -- $s'$ $s''$ or $s$), similar to {\tt PFXDICTGETQ}, but on success {\tt BLESS}es the value $x$ into a {\em Continuation\/} and transfers control to it as if by a {\tt JMPX}. On failure, returns $s$ unchanged and continues execution.
Expand Down