Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit 0a57f0f

Browse files
committed
WIP - memory.fill spec text
1 parent 0533c62 commit 0a57f0f

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

document/core/exec/instructions.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -689,24 +689,21 @@ Memory Instructions
689689
S; F; (\I32.\CONST~i)~\val~(\I32.\CONST~0)~(\MEMORYFILL) &\stepto& S; F; \epsilon
690690
\end{array} \\
691691
\begin{array}{lcl@{\qquad}l}
692-
S; F; (\I32.\CONST~i)~\val~(\I32.\CONST~1)~(\MEMORYFILL) &\stepto& S; F;
693-
(\I32.\CONST~i)~\val~(\I32\K{.}\STORE\K{8}~\{ \OFFSET~0, \ALIGN~0 \}) \\
694-
\end{array} \\
692+
S; F; (\I32.\CONST~i)~\val~(\I32.\CONST~n)~(\MEMORYFILL) &\stepto& S; F; \TRAP \\
693+
\end{array}
694+
\\ \qquad
695+
\begin{array}[t]{@{}r@{~}l@{}}
696+
(\iff & \X{i} + \X{n} \gt |S.\SMEMS[F.\AMODULE.\MIMEMS[0]].\MIDATA|) \\
697+
\end{array} \\
695698
\begin{array}{lcl@{\qquad}l}
696699
S; F; (\I32.\CONST~i)~\val~(\I32.\CONST~n)~(\MEMORYFILL) &\stepto& S; F;
697700
\begin{array}[t]{@{}l@{}}
698-
(\I32.\CONST~i)~\val~(\I32.\CONST~1)~(\MEMORYFILL) \\
699-
(\vconst_{\I32}(i+1))~\val~(\I32.\CONST~(n-1))~(\MEMORYFILL) \\
701+
(\I32.\CONST~i)~\val~(\I32\K{.}\STORE\K{8}~\{ \OFFSET~0, \ALIGN~0 \}) \\
702+
(\I32.\CONST~(i+1))~\val~(\I32.\CONST~(n-1))~(\MEMORYFILL) \\
700703
\end{array} \\
701704
\end{array}
702-
\\ \qquad
703-
(\iff n > 1) \\
704705
\end{array}
705706
706-
.. note::
707-
The use of the :math:`\vconst_t` meta function in the rules for this and the following instructions ensures that an overflowing index turns into a :ref:`trap <syntax-trap>`.
708-
709-
710707
.. _exec-memory.init:
711708

712709
:math:`\MEMORYINIT~x`

document/core/exec/runtime.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@ It is convenient to reuse the same notation as for the |CONST| :ref:`instruction
2929
\F64.\CONST~\f64
3030
\end{array}
3131
32-
Conventions
33-
...........
34-
35-
The following auxiliary notation is defined for constant values, to ensure they are well-formed for the given :ref:`value type <syntax-valtype>`.
36-
37-
.. math::
38-
\begin{array}{lcl@{\qquad}l}
39-
\vconst_t(x) &=& (t\K{.}\CONST~x)
40-
& (\iff x~\mbox{is well-formed for}~t) \\
41-
\vconst_t(x) &=& \TRAP
42-
& (\otherwise) \\
43-
\end{array}
44-
4532
4633
.. index:: ! result, value, trap
4734
pair: abstract syntax; result

0 commit comments

Comments
 (0)