Skip to content

Commit be820b2

Browse files
authored
[spec] Add missing access to current frame in prose (#1624)
* [spec] Append missing periods * [spec] Fix execution of control instructions regarding current frame
1 parent c3e62e2 commit be820b2

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

document/core/exec/instructions.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ where:
846846

847847
3. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
848848

849-
4. Let :math:`(i_1~i_2)^\ast` be the result of computing :math:`\imul_{32}(\extends_{16,32}(\lanes_{\I16X8}(c_1)), \extends_{16,32}(\lanes_{\I16X8}(c_2)))`
849+
4. Let :math:`(i_1~i_2)^\ast` be the result of computing :math:`\imul_{32}(\extends_{16,32}(\lanes_{\I16X8}(c_1)), \extends_{16,32}(\lanes_{\I16X8}(c_2)))`.
850850

851851
5. Let :math:`j^\ast` be the result of computing :math:`\iadd_{32}(i_1, i_2)^\ast`.
852852

@@ -891,7 +891,7 @@ where:
891891

892892
b. Let :math:`j^\ast` be the sequence :math:`\lanes_{t_1\K{x}M}(c_2)[N \slice N]`.
893893

894-
6. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(\imul_{t_2\K{x}N}(\extend^{\sx}_{|t_1|,|t_2|}(i^\ast), \extend^{\sx}_{|t_1|,|t_2|}(j^\ast)))`
894+
6. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(\imul_{t_2\K{x}N}(\extend^{\sx}_{|t_1|,|t_2|}(i^\ast), \extend^{\sx}_{|t_1|,|t_2|}(j^\ast)))`.
895895

896896
7. Push the value :math:`\V128.\VCONST~c` onto the stack.
897897

@@ -2537,17 +2537,19 @@ Control Instructions
25372537
:math:`\BLOCK~\blocktype~\instr^\ast~\END`
25382538
..........................................
25392539

2540-
1. Assert: due to :ref:`validation <valid-blocktype>`, :math:`\expand_F(\blocktype)` is defined.
2540+
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
2541+
2542+
2. Assert: due to :ref:`validation <valid-blocktype>`, :math:`\expand_F(\blocktype)` is defined.
25412543

2542-
2. Let :math:`[t_1^m] \to [t_2^n]` be the :ref:`function type <syntax-functype>` :math:`\expand_F(\blocktype)`.
2544+
3. Let :math:`[t_1^m] \to [t_2^n]` be the :ref:`function type <syntax-functype>` :math:`\expand_F(\blocktype)`.
25432545

2544-
3. Let :math:`L` be the label whose arity is :math:`n` and whose continuation is the end of the block.
2546+
4. Let :math:`L` be the label whose arity is :math:`n` and whose continuation is the end of the block.
25452547

2546-
4. Assert: due to :ref:`validation <valid-block>`, there are at least :math:`m` values on the top of the stack.
2548+
5. Assert: due to :ref:`validation <valid-block>`, there are at least :math:`m` values on the top of the stack.
25472549

2548-
5. Pop the values :math:`\val^m` from the stack.
2550+
6. Pop the values :math:`\val^m` from the stack.
25492551

2550-
6. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
2552+
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
25512553

25522554
.. math::
25532555
~\\[-1ex]
@@ -2563,17 +2565,19 @@ Control Instructions
25632565
:math:`\LOOP~\blocktype~\instr^\ast~\END`
25642566
.........................................
25652567

2566-
1. Assert: due to :ref:`validation <valid-blocktype>`, :math:`\expand_F(\blocktype)` is defined.
2568+
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
2569+
2570+
2. Assert: due to :ref:`validation <valid-blocktype>`, :math:`\expand_F(\blocktype)` is defined.
25672571

2568-
2. Let :math:`[t_1^m] \to [t_2^n]` be the :ref:`function type <syntax-functype>` :math:`\expand_F(\blocktype)`.
2572+
3. Let :math:`[t_1^m] \to [t_2^n]` be the :ref:`function type <syntax-functype>` :math:`\expand_F(\blocktype)`.
25692573

2570-
3. Let :math:`L` be the label whose arity is :math:`m` and whose continuation is the start of the loop.
2574+
4. Let :math:`L` be the label whose arity is :math:`m` and whose continuation is the start of the loop.
25712575

2572-
4. Assert: due to :ref:`validation <valid-loop>`, there are at least :math:`m` values on the top of the stack.
2576+
5. Assert: due to :ref:`validation <valid-loop>`, there are at least :math:`m` values on the top of the stack.
25732577

2574-
5. Pop the values :math:`\val^m` from the stack.
2578+
6. Pop the values :math:`\val^m` from the stack.
25752579

2576-
6. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
2580+
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
25772581

25782582
.. math::
25792583
~\\[-1ex]
@@ -2604,11 +2608,11 @@ Control Instructions
26042608
.. math::
26052609
~\\[-1ex]
26062610
\begin{array}{lcl}
2607-
F; (\I32.\CONST~c)~\IF~\X{bt}~\instr_1^\ast~\ELSE~\instr_2^\ast~\END &\stepto&
2608-
F; \BLOCK~\X{bt}~\instr_1^\ast~\END
2611+
(\I32.\CONST~c)~\IF~\X{bt}~\instr_1^\ast~\ELSE~\instr_2^\ast~\END &\stepto&
2612+
\BLOCK~\X{bt}~\instr_1^\ast~\END
26092613
\\&&\quad (\iff c \neq 0) \\
2610-
F; (\I32.\CONST~c)~\IF~\X{bt}~\instr_1^\ast~\ELSE~\instr_2^\ast~\END &\stepto&
2611-
F; \BLOCK~\X{bt}~\instr_2^\ast~\END
2614+
(\I32.\CONST~c)~\IF~\X{bt}~\instr_1^\ast~\ELSE~\instr_2^\ast~\END &\stepto&
2615+
\BLOCK~\X{bt}~\instr_2^\ast~\END
26122616
\\&&\quad (\iff c = 0) \\
26132617
\end{array}
26142618

0 commit comments

Comments
 (0)