Skip to content

Commit 429b2e3

Browse files
authored
[spec] Correct use of opdtype and stacktype (#1524)
1 parent 3996773 commit 429b2e3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

document/core/valid/instructions.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This is extended to stack types in a point-wise manner.
4848
consuming two |I32| values and producing one.
4949

5050
Typing extends to :ref:`instruction sequences <valid-instr-seq>` :math:`\instr^\ast`.
51-
Such a sequence has a :ref:`function type <syntax-functype>` :math:`[t_1^\ast] \to [t_2^\ast]` if the accumulative effect of executing the instructions is consuming values of types :math:`t_1^\ast` off the operand stack and pushing new values of types :math:`t_2^\ast`.
51+
Such a sequence has a :ref:`stack type <syntax-stacktype>` :math:`[t_1^\ast] \to [t_2^\ast]` if the accumulative effect of executing the instructions is consuming values of types :math:`t_1^\ast` off the operand stack and pushing new values of types :math:`t_2^\ast`.
5252

5353
.. _polymorphism:
5454

@@ -63,7 +63,7 @@ Two degrees of polymorphism can be distinguished:
6363

6464

6565
* *stack-polymorphic*:
66-
the entire (or most of the) :ref:`function type <syntax-functype>` :math:`[t_1^\ast] \to [t_2^\ast]` of the instruction is unconstrained.
66+
the entire (or most of the) :ref:`stack type <syntax-stacktype>` :math:`[t_1^\ast] \to [t_2^\ast]` of the instruction is unconstrained.
6767
That is the case for all :ref:`control instructions <valid-instr-control>` that perform an *unconditional control transfer*, such as |UNREACHABLE|, |BR|, |BRTABLE|, and |RETURN|.
6868

6969
In both cases, the unconstrained types or type sequences can be chosen arbitrarily, as long as they meet the constraints imposed for the surrounding parts of the program.
@@ -81,7 +81,7 @@ In both cases, the unconstrained types or type sequences can be chosen arbitrari
8181
8282
are valid, with :math:`t` in the typing of |SELECT| being instantiated to |I32| or |F64|, respectively.
8383

84-
The |UNREACHABLE| instruction is valid with type :math:`[t_1^\ast] \to [t_2^\ast]` for any possible sequences of value types :math:`t_1^\ast` and :math:`t_2^\ast`.
84+
The |UNREACHABLE| instruction is valid with type :math:`[t_1^\ast] \to [t_2^\ast]` for any possible sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
8585
Consequently,
8686

8787
.. math::
@@ -258,7 +258,7 @@ Reference Instructions
258258
Vector Instructions
259259
~~~~~~~~~~~~~~~~~~~
260260

261-
Vector instructions can have a prefix to describe the :ref:`shape <syntax-vec-shape>` of the operand. Packed numeric types, |I8| and |I16|, are not :ref:`value type <syntax-valtype>`, we define an auxiliary function to map such packed types into value types:
261+
Vector instructions can have a prefix to describe the :ref:`shape <syntax-vec-shape>` of the operand. Packed numeric types, |I8| and |I16|, are not :ref:`value types <syntax-valtype>`. An auxiliary function maps such packed types to value types:
262262

263263
.. math::
264264
\begin{array}{lll@{\qquad}l}
@@ -598,7 +598,7 @@ Parametric Instructions
598598
:math:`\DROP`
599599
.............
600600

601-
* The instruction is valid with type :math:`[t] \to []`, for any :ref:`value type <syntax-valtype>` :math:`t`.
601+
* The instruction is valid with type :math:`[t] \to []`, for any :ref:`operand type <syntax-opdtype>` :math:`t`.
602602

603603
.. math::
604604
\frac{
@@ -1262,7 +1262,7 @@ Control Instructions
12621262
:math:`\UNREACHABLE`
12631263
....................
12641264

1265-
* The instruction is valid with type :math:`[t_1^\ast] \to [t_2^\ast]`, for any sequences of :ref:`value types <syntax-valtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
1265+
* The instruction is valid with type :math:`[t_1^\ast] \to [t_2^\ast]`, for any sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
12661266

12671267
.. math::
12681268
\frac{
@@ -1369,7 +1369,7 @@ Control Instructions
13691369

13701370
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` :math:`C.\CLABELS[l]`.
13711371

1372-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to [t_2^\ast]`, for any sequences of :ref:`value types <syntax-valtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
1372+
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to [t_2^\ast]`, for any sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
13731373

13741374
.. math::
13751375
\frac{
@@ -1417,14 +1417,14 @@ Control Instructions
14171417
* For all :math:`l_i` in :math:`l^\ast`,
14181418
the label :math:`C.\CLABELS[l_i]` must be defined in the context.
14191419

1420-
* There must be a :ref:`result type <syntax-resulttype>` :math:`[t^\ast]`, such that:
1420+
* There must be a sequence :math:`t^\ast` of :ref:`operand types <syntax-opdtype>`, such that:
14211421

14221422
* For each :ref:`operand type <syntax-opdtype>` :math:`t_j` in :math:`t^\ast` and corresponding type :math:`t'_{Nj}` in :math:`C.\CLABELS[l_N]`, :math:`t_j` :ref:`matches <match-opdtype>` :math:`t'_{Nj}`.
14231423

14241424
* For all :math:`l_i` in :math:`l^\ast`,
14251425
and for each :ref:`operand type <syntax-opdtype>` :math:`t_j` in :math:`t^\ast` and corresponding type :math:`t'_{ij}` in :math:`C.\CLABELS[l_i]`, :math:`t_j` :ref:`matches <match-opdtype>` :math:`t'_{ij}`.
14261426

1427-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast~\I32] \to [t_2^\ast]`, for any sequences of :ref:`value types <syntax-valtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
1427+
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast~\I32] \to [t_2^\ast]`, for any sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
14281428

14291429
.. math::
14301430
\frac{
@@ -1450,7 +1450,7 @@ Control Instructions
14501450

14511451
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` of :math:`C.\CRETURN`.
14521452

1453-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to [t_2^\ast]`, for any sequences of :ref:`value types <syntax-valtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
1453+
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to [t_2^\ast]`, for any sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
14541454

14551455
.. math::
14561456
\frac{
@@ -1537,12 +1537,12 @@ Non-empty Instruction Sequence: :math:`\instr^\ast~\instr_N`
15371537
............................................................
15381538

15391539
* The instruction sequence :math:`\instr^\ast` must be valid with type :math:`[t_1^\ast] \to [t_2^\ast]`,
1540-
for some sequences of :ref:`value types <syntax-valtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
1540+
for some sequences of :ref:`operand types <syntax-opdtype>` :math:`t_1^\ast` and :math:`t_2^\ast`.
15411541

15421542
* The instruction :math:`\instr_N` must be valid with type :math:`[t^\ast] \to [t_3^\ast]`,
1543-
for some sequences of :ref:`value types <syntax-valtype>` :math:`t^\ast` and :math:`t_3^\ast`.
1543+
for some sequences of :ref:`operand types <syntax-opdtype>` :math:`t^\ast` and :math:`t_3^\ast`.
15441544

1545-
* There must be a sequence of :ref:`value types <syntax-valtype>` :math:`t_0^\ast`,
1545+
* There must be a sequence of :ref:`operand types <syntax-opdtype>` :math:`t_0^\ast`,
15461546
such that :math:`t_2^\ast = t_0^\ast~{t'}^\ast` where the type sequence :math:`{t'}^\ast` is as long as :math:`t^\ast`.
15471547

15481548
* For each :ref:`operand type <syntax-opdtype>` :math:`t'_i` in :math:`{t'}^\ast` and corresponding type :math:`t_i` in :math:`t^\ast`, :math:`t'_i` :ref:`matches <match-opdtype>` :math:`t_i`.

0 commit comments

Comments
 (0)