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: document/core/valid/instructions.rst
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ This is extended to stack types in a point-wise manner.
48
48
consuming two |I32| values and producing one.
49
49
50
50
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`.
52
52
53
53
.. _polymorphism:
54
54
@@ -63,7 +63,7 @@ Two degrees of polymorphism can be distinguished:
63
63
64
64
65
65
* *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.
67
67
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|.
68
68
69
69
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
81
81
82
82
are valid, with :math:`t` in the typing of |SELECT| being instantiated to |I32| or |F64|, respectively.
83
83
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`.
85
85
Consequently,
86
86
87
87
.. math::
@@ -258,7 +258,7 @@ Reference Instructions
258
258
Vector Instructions
259
259
~~~~~~~~~~~~~~~~~~~
260
260
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:
262
262
263
263
.. math::
264
264
\begin{array}{lll@{\qquad}l}
@@ -598,7 +598,7 @@ Parametric Instructions
598
598
:math:`\DROP`
599
599
.............
600
600
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`.
602
602
603
603
.. math::
604
604
\frac{
@@ -1262,7 +1262,7 @@ Control Instructions
1262
1262
:math:`\UNREACHABLE`
1263
1263
....................
1264
1264
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`.
1266
1266
1267
1267
.. math::
1268
1268
\frac{
@@ -1369,7 +1369,7 @@ Control Instructions
1369
1369
1370
1370
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` :math:`C.\CLABELS[l]`.
1371
1371
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`.
1373
1373
1374
1374
.. math::
1375
1375
\frac{
@@ -1417,14 +1417,14 @@ Control Instructions
1417
1417
* For all :math:`l_i` in :math:`l^\ast`,
1418
1418
the label :math:`C.\CLABELS[l_i]` must be defined in the context.
1419
1419
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:
1421
1421
1422
1422
* 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}`.
1423
1423
1424
1424
* For all :math:`l_i` in :math:`l^\ast`,
1425
1425
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}`.
1426
1426
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`.
1428
1428
1429
1429
.. math::
1430
1430
\frac{
@@ -1450,7 +1450,7 @@ Control Instructions
1450
1450
1451
1451
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` of :math:`C.\CRETURN`.
1452
1452
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`.
* 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`.
1541
1541
1542
1542
* 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`.
1544
1544
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`,
1546
1546
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`.
1547
1547
1548
1548
* 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