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
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Two degrees of polymorphism can be distinguished:
30
30
That is the case for all :ref:`parametric instructions <valid-instr-parametric>` like |DROP| and |SELECT|.
31
31
32
32
* *stack-polymorphic*:
33
-
the entire (or most of the) :ref:`instruction type <syntax-instrtype>` :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]` of the instruction is unconstrained.
33
+
the entire (or most of the) :ref:`instruction type <syntax-instrtype>` :math:`[t_1^\ast] \to [t_2^\ast]` of the instruction is unconstrained.
34
34
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|.
35
35
36
36
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.
@@ -49,7 +49,7 @@ In both cases, the unconstrained types or type sequences can be chosen arbitrari
49
49
are valid, with :math:`t` in the typing of |SELECT| being instantiated to |I32| or |F64|, respectively.
50
50
51
51
The |UNREACHABLE| instruction is stack-polymorphic,
52
-
and hence valid with type :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]` for any possible sequences of value types :math:`t_1^\ast` and :math:`t_2^\ast` and sequence of locals :math:`x^\ast`.
52
+
and hence 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`.
53
53
Consequently,
54
54
55
55
.. math::
@@ -1257,13 +1257,13 @@ Control Instructions
1257
1257
:math:`\UNREACHABLE`
1258
1258
....................
1259
1259
1260
-
* The instruction is valid with any :ref:`valid <valid-instrtype>` type :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]`.
1260
+
* The instruction is valid with any :ref:`valid <valid-instrtype>` type of the form :math:`[t_1^\ast] \to [t_2^\ast]`.
1261
1261
1262
1262
.. math::
1263
1263
\frac{
1264
-
C \vdashinstrtype [t_1^\ast] \to_{x^\ast} [t_2^\ast] \ok
1264
+
C \vdashinstrtype [t_1^\ast] \to [t_2^\ast] \ok
1265
1265
}{
1266
-
C \vdashinstr\UNREACHABLE : [t_1^\ast] \to_{x^\ast} [t_2^\ast]
1266
+
C \vdashinstr\UNREACHABLE : [t_1^\ast] \to [t_2^\ast]
1267
1267
}
1268
1268
1269
1269
.. note::
@@ -1365,15 +1365,15 @@ Control Instructions
1365
1365
1366
1366
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` :math:`C.\CLABELS[l]`.
1367
1367
1368
-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to_{x^\ast} [t_2^\ast]`, for any :ref:`valid <valid-instrtype>` type :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]`.
1368
+
* Then the instruction is valid with any :ref:`valid <valid-instrtype>` type of the form :math:`[t_1^\ast~t^\ast] \to [t_2^\ast]`.
1369
1369
1370
1370
.. math::
1371
1371
\frac{
1372
1372
C.\CLABELS[l] = [t^\ast]
1373
1373
\qquad
1374
-
C \vdashinstrtype [t_1^\ast] \to_{x^\ast} [t_2^\ast] \ok
1374
+
C \vdashinstrtype [t_1^\ast~t^\ast] \to [t_2^\ast] \ok
1375
1375
}{
1376
-
C \vdashinstr\BR~l : [t_1^\ast~t^\ast] \to_{x^\ast} [t_2^\ast]
1376
+
C \vdashinstr\BR~l : [t_1^\ast~t^\ast] \to [t_2^\ast]
1377
1377
}
1378
1378
1379
1379
.. note::
@@ -1422,17 +1422,17 @@ Control Instructions
1422
1422
* For all :math:`l_i` in :math:`l^\ast`,
1423
1423
the result type :math:`[t^\ast]` :ref:`matches <match-resulttype>` :math:`C.\CLABELS[l_i]`.
1424
1424
1425
-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast~\I32] \to_{x^\ast} [t_2^\ast]`, for any :ref:`valid <valid-instrtype>` type :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]`.
1425
+
* Then the instruction is valid with any :ref:`valid <valid-instrtype>` type of the form :math:`[t_1^\ast~t^\ast~\I32] \to [t_2^\ast]`.
C \vdashresulttypematch [t^\ast] \matchesresulttype C.\CLABELS[l_N]
1432
1432
\qquad
1433
-
C \vdashinstrtype [t_1^\ast] \to_{x^\ast} [t_2^\ast] \ok
1433
+
C \vdashinstrtype [t_1^\ast~t^\ast~\I32] \to [t_2^\ast] \ok
1434
1434
}{
1435
-
C \vdashinstr\BRTABLE~l^\ast~l_N : [t_1^\ast~t^\ast~\I32] \to_{x^\ast} [t_2^\ast]
1435
+
C \vdashinstr\BRTABLE~l^\ast~l_N : [t_1^\ast~t^\ast~\I32] \to [t_2^\ast]
1436
1436
}
1437
1437
1438
1438
.. note::
@@ -1500,15 +1500,15 @@ Control Instructions
1500
1500
1501
1501
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` of :math:`C.\CRETURN`.
1502
1502
1503
-
* Then the instruction is valid with type :math:`[t_1^\ast~t^\ast] \to_{x^\ast} [t_2^\ast]`, for any :ref:`valid <valid-instrtype>` type :math:`[t_1^\ast] \to_{x^\ast} [t_2^\ast]`.
1503
+
* Then the instruction is valid with any :ref:`valid <valid-instrtype>` type of the form :math:`[t_1^\ast] \to [t_2^\ast]`.
1504
1504
1505
1505
.. math::
1506
1506
\frac{
1507
1507
C.\CRETURN = [t^\ast]
1508
1508
\qquad
1509
-
C \vdashinstrtype [t_1^\ast] \to_{x^\ast} [t_2^\ast] \ok
1509
+
C \vdashinstrtype [t_1^\ast~t^\ast] \to [t_2^\ast] \ok
1510
1510
}{
1511
-
C \vdashinstr\RETURN : [t_1^\ast~t^\ast] \to_{x^\ast} [t_2^\ast]
1511
+
C \vdashinstr\RETURN : [t_1^\ast~t^\ast] \to [t_2^\ast]
0 commit comments