Skip to content

Commit 4c02753

Browse files
committed
Merge branch 'upstream'
2 parents a416865 + 724b3e7 commit 4c02753

28 files changed

+266
-210
lines changed

document/core/appendix/index-instructions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def RefWrap(s, kind):
5454

5555
def Instruction(name, opcode, type=None, validation=None, execution=None, operator=None):
5656
if operator:
57-
execution_str = ', '.join([RefWrap(execution, 'execution'),
58-
RefWrap(operator, 'operator')])
57+
execution_str = RefWrap(execution, 'execution') + ' (' + RefWrap(operator, 'operator') + ')'
5958
else:
6059
execution_str = RefWrap(execution, 'execution')
6160

document/core/appendix/properties.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,9 @@ a store state :math:`S'` extends state :math:`S`, written :math:`S \extendsto S'
748748

749749
* For each :ref:`global instance <syntax-globalinst>` :math:`\globalinst_i` in the original :math:`S.\SGLOBALS`, the new global instance must be an :ref:`extension <extend-globalinst>` of the old.
750750

751-
* For each :ref:`element instance <syntax-eleminst>` :math:`\eleminst_i` in the original :math:`S.\SELEMS`, the new global instance must be an :ref:`extension <extend-eleminst>` of the old.
751+
* For each :ref:`element instance <syntax-eleminst>` :math:`\eleminst_i` in the original :math:`S.\SELEMS`, the new element instance must be an :ref:`extension <extend-eleminst>` of the old.
752752

753-
* For each :ref:`data instance <syntax-datainst>` :math:`\datainst_i` in the original :math:`S.\SDATAS`, the new global instance must be an :ref:`extension <extend-datainst>` of the old.
753+
* For each :ref:`data instance <syntax-datainst>` :math:`\datainst_i` in the original :math:`S.\SDATAS`, the new data instance must be an :ref:`extension <extend-datainst>` of the old.
754754

755755
.. math::
756756
\frac{

document/core/exec/instructions.rst

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ The mapping of numeric instructions to their underlying operators is expressed b
2020

2121
.. math::
2222
\begin{array}{lll@{\qquad}l}
23-
\X{op}_{\IN}(i_1,\dots,i_k) &=& \F{i}\X{op}_N(i_1,\dots,i_k) \\
24-
\X{op}_{\FN}(z_1,\dots,z_k) &=& \F{f}\X{op}_N(z_1,\dots,z_k) \\
25-
\X{op}_{\VN}(i_1,\dots,i_k) &=& \F{i}\X{op}_N(i_1,\dots,i_k) \\
23+
\X{op}_{\IN}(i_1,\dots,i_k) &=& \xref{exec/numerics}{int-ops}{\F{i}\X{op}}_N(i_1,\dots,i_k) \\
24+
\X{op}_{\FN}(z_1,\dots,z_k) &=& \xref{exec/numerics}{float-ops}{\F{f}\X{op}}_N(z_1,\dots,z_k) \\
2625
\end{array}
2726
2827
And for :ref:`conversion operators <exec-cvtop>`:
2928

3029
.. math::
3130
\begin{array}{lll@{\qquad}l}
32-
\X{cvtop}^{\sx^?}_{t_1,t_2}(c) &=& \X{cvtop}^{\sx^?}_{|t_1|,|t_2|}(c) \\
31+
\cvtop^{\sx^?}_{t_1,t_2}(c) &=& \xref{exec/numerics}{convert-ops}{\X{cvtop}}^{\sx^?}_{|t_1|,|t_2|}(c) \\
3332
\end{array}
3433
3534
Where the underlying operators are partial, the corresponding instruction will :ref:`trap <trap>` when the result is not defined.
@@ -64,9 +63,9 @@ Where the underlying operators are non-deterministic, because they may return on
6463

6564
2. Pop the value :math:`t.\CONST~c_1` from the stack.
6665

67-
3. If :math:`\unop_t(c_1)` is defined, then:
66+
3. If :math:`\unopF_t(c_1)` is defined, then:
6867

69-
a. Let :math:`c` be a possible result of computing :math:`\unop_t(c_1)`.
68+
a. Let :math:`c` be a possible result of computing :math:`\unopF_t(c_1)`.
7069

7170
b. Push the value :math:`t.\CONST~c` to the stack.
7271

@@ -77,9 +76,9 @@ Where the underlying operators are non-deterministic, because they may return on
7776
.. math::
7877
\begin{array}{lcl@{\qquad}l}
7978
(t\K{.}\CONST~c_1)~t\K{.}\unop &\stepto& (t\K{.}\CONST~c)
80-
& (\iff c \in \unop_t(c_1)) \\
79+
& (\iff c \in \unopF_t(c_1)) \\
8180
(t\K{.}\CONST~c_1)~t\K{.}\unop &\stepto& \TRAP
82-
& (\iff \unop_{t}(c_1) = \{\})
81+
& (\iff \unopF_{t}(c_1) = \{\})
8382
\end{array}
8483
8584
@@ -94,9 +93,9 @@ Where the underlying operators are non-deterministic, because they may return on
9493

9594
3. Pop the value :math:`t.\CONST~c_1` from the stack.
9695

97-
4. If :math:`\binop_t(c_1, c_2)` is defined, then:
96+
4. If :math:`\binopF_t(c_1, c_2)` is defined, then:
9897

99-
a. Let :math:`c` be a possible result of computing :math:`\binop_t(c_1, c_2)`.
98+
a. Let :math:`c` be a possible result of computing :math:`\binopF_t(c_1, c_2)`.
10099

101100
b. Push the value :math:`t.\CONST~c` to the stack.
102101

@@ -107,9 +106,9 @@ Where the underlying operators are non-deterministic, because they may return on
107106
.. math::
108107
\begin{array}{lcl@{\qquad}l}
109108
(t\K{.}\CONST~c_1)~(t\K{.}\CONST~c_2)~t\K{.}\binop &\stepto& (t\K{.}\CONST~c)
110-
& (\iff c \in \binop_t(c_1,c_2)) \\
109+
& (\iff c \in \binopF_t(c_1,c_2)) \\
111110
(t\K{.}\CONST~c_1)~(t\K{.}\CONST~c_2)~t\K{.}\binop &\stepto& \TRAP
112-
& (\iff \binop_{t}(c_1,c_2) = \{\})
111+
& (\iff \binopF_{t}(c_1,c_2) = \{\})
113112
\end{array}
114113
115114
@@ -122,14 +121,14 @@ Where the underlying operators are non-deterministic, because they may return on
122121

123122
2. Pop the value :math:`t.\CONST~c_1` from the stack.
124123

125-
3. Let :math:`c` be the result of computing :math:`\testop_t(c_1)`.
124+
3. Let :math:`c` be the result of computing :math:`\testopF_t(c_1)`.
126125

127126
4. Push the value :math:`\I32.\CONST~c` to the stack.
128127

129128
.. math::
130129
\begin{array}{lcl@{\qquad}l}
131130
(t\K{.}\CONST~c_1)~t\K{.}\testop &\stepto& (\I32\K{.}\CONST~c)
132-
& (\iff c = \testop_t(c_1)) \\
131+
& (\iff c = \testopF_t(c_1)) \\
133132
\end{array}
134133
135134
@@ -144,14 +143,14 @@ Where the underlying operators are non-deterministic, because they may return on
144143

145144
3. Pop the value :math:`t.\CONST~c_1` from the stack.
146145

147-
4. Let :math:`c` be the result of computing :math:`\relop_t(c_1, c_2)`.
146+
4. Let :math:`c` be the result of computing :math:`\relopF_t(c_1, c_2)`.
148147

149148
5. Push the value :math:`\I32.\CONST~c` to the stack.
150149

151150
.. math::
152151
\begin{array}{lcl@{\qquad}l}
153152
(t\K{.}\CONST~c_1)~(t\K{.}\CONST~c_2)~t\K{.}\relop &\stepto& (\I32\K{.}\CONST~c)
154-
& (\iff c = \relop_t(c_1,c_2)) \\
153+
& (\iff c = \relopF_t(c_1,c_2)) \\
155154
\end{array}
156155
157156
@@ -280,20 +279,27 @@ Reference Instructions
280279
Vector Instructions
281280
~~~~~~~~~~~~~~~~~~~
282281

283-
Most vector instructions are defined in terms of generic numeric operators applied lane-wise based on the :ref:`shape <syntax-vec-shape>`.
282+
Vector instructions that operate bitwise are handled as integer operations of respective width.
284283

285284
.. math::
286285
\begin{array}{lll@{\qquad}l}
286+
\X{op}_{\VN}(i_1,\dots,i_k) &=& \xref{exec/numerics}{int-ops}{\F{i}\X{op}}_N(i_1,\dots,i_k) \\
287+
\end{array}
288+
289+
Most other vector instructions are defined in terms of numeric operators that are applied lane-wise according to the given :ref:`shape <syntax-vec-shape>`.
290+
291+
.. math::
292+
\begin{array}{llll}
287293
\X{op}_{t\K{x}N}(n_1,\dots,n_k) &=&
288-
\lanes^{-1}_{t\K{x}N}(op_t(\lanes_{t\K{x}N}(n_1) ~\dots~ \lanes_{t\K{x}N}(n_k))
294+
\lanes^{-1}_{t\K{x}N}(\xref{exec/instructions}{exec-instr-numeric}{\X{op}}_t(i_1,\dots,i_k)^\ast) & \qquad(\iff i_1^\ast = \lanes_{t\K{x}N}(n_1) \land \dots \land i_k^\ast = \lanes_{t\K{x}N}(n_k) \\
289295
\end{array}
290296
291297
.. note::
292-
For example, the result of instruction :math:`\K{i32x4}.\ADD` applied to operands :math:`i_1, i_2`
293-
invokes :math:`\ADD_{\K{i32x4}}(i_1, i_2)`, which maps to
294-
:math:`\lanes^{-1}_{\K{i32x4}}(\ADD_{\I32}(i_1^+, i_2^+))`,
295-
where :math:`i_1^+` and :math:`i_2^+` are sequences resulting from invoking
296-
:math:`\lanes_{\K{i32x4}}(i_1)` and :math:`\lanes_{\K{i32x4}}(i_2)`
298+
For example, the result of instruction :math:`\K{i32x4}.\ADD` applied to operands :math:`v_1, v_2`
299+
invokes :math:`\ADD_{\K{i32x4}}(v_1, v_2)`, which maps to
300+
:math:`\lanes^{-1}_{\K{i32x4}}(\ADD_{\I32}(i_1, i_2)^\ast)`,
301+
where :math:`i_1^\ast` and :math:`i_2^\ast` are sequences resulting from invoking
302+
:math:`\lanes_{\K{i32x4}}(v_1)` and :math:`\lanes_{\K{i32x4}}(v_2)`
297303
respectively.
298304

299305

@@ -531,31 +537,31 @@ Most vector instructions are defined in terms of generic numeric operators appli
531537

532538
1. Assert: due to :ref:`validation <valid-vec-replace_lane>`, :math:`x < \dim(\shape)`.
533539

534-
2. Let :math:`t_1` be the type :math:`\unpacked(\shape)`.
540+
2. Let :math:`t_2` be the type :math:`\unpacked(\shape)`.
535541

536542
3. Assert: due to :ref:`validation <valid-vec-replace_lane>`, a value of :ref:`value type <syntax-valtype>` :math:`t_1` is on the top of the stack.
537543

538-
4. Pop the value :math:`t_1.\CONST~c_1` from the stack.
544+
4. Pop the value :math:`t_2.\CONST~c_2` from the stack.
539545

540546
5. Assert: due to :ref:`validation <valid-vec-replace_lane>`, a value of :ref:`value type <syntax-valtype>` |V128| is on the top of the stack.
541547

542-
6. Pop the value :math:`\V128.\VCONST~c_2` from the stack.
548+
6. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
543549

544-
7. Let :math:`i^\ast` be the result of computing :math:`\lanes_{\shape}(c_2)`.
550+
7. Let :math:`i^\ast` be the result of computing :math:`\lanes_{\shape}(c_1)`.
545551

546-
8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\shape}(i^\ast \with [x] = c_1)`.
552+
8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\shape}(i^\ast \with [x] = c_2)`.
547553

548554
9. Push :math:`\V128.\VCONST~c` on the stack.
549555

550556
.. math::
551557
\begin{array}{l}
552558
\begin{array}{lcl@{\qquad}l}
553-
(t_1\K{.}\CONST~c_1)~(\V128\K{.}\VCONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
559+
(\V128\K{.}\VCONST~c_1)~(t_2\K{.}\CONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
554560
\end{array}
555561
\\ \qquad
556562
\begin{array}[t]{@{}r@{~}l@{}}
557-
(\iff & i^\ast = \lanes_{\shape}(c_2) \\
558-
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_1))
563+
(\iff & i^\ast = \lanes_{\shape}(c_1) \\
564+
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_2))
559565
\end{array}
560566
\end{array}
561567
@@ -687,9 +693,9 @@ Most vector instructions are defined in terms of generic numeric operators appli
687693

688694
1. Assert: due to :ref:`validation <valid-vtestop>`, a value of :ref:`value type <syntax-valtype>` |V128| is on the top of the stack.
689695

690-
2. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
696+
2. Pop the value :math:`\V128.\VCONST~c` from the stack.
691697

692-
3. Let :math:`i_1^\ast` be the result of computing :math:`\lanes_{\shape}(c_1)`.
698+
3. Let :math:`i_1^\ast` be the result of computing :math:`\lanes_{\shape}(c)`.
693699

694700
4. Let :math:`i` be the result of computing :math:`\bool(\bigwedge(i_1 \neq 0)^\ast)`.
695701

@@ -699,7 +705,7 @@ Most vector instructions are defined in terms of generic numeric operators appli
699705
.. math::
700706
\begin{array}{l}
701707
\begin{array}{lcl@{\qquad}l}
702-
(\V128\K{.}\VCONST~c_1)~\shape\K{.}\ALLTRUE &\stepto& (\I32\K{.}\CONST~i)
708+
(\V128\K{.}\VCONST~c)~\shape\K{.}\ALLTRUE &\stepto& (\I32\K{.}\CONST~i)
703709
\end{array}
704710
\\ \qquad
705711
\begin{array}[t]{@{}r@{~}l@{}}
@@ -716,7 +722,7 @@ Most vector instructions are defined in terms of generic numeric operators appli
716722

717723
1. Assert: due to :ref:`validation <valid-vec-bitmask>`, a value of :ref:`value type <syntax-valtype>` |V128| is on the top of the stack.
718724

719-
2. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
725+
2. Pop the value :math:`\V128.\VCONST~c` from the stack.
720726

721727
3. Let :math:`i_1^N` be the result of computing :math:`\lanes_{t\K{x}N}(c)`.
722728

@@ -726,14 +732,14 @@ Most vector instructions are defined in terms of generic numeric operators appli
726732

727733
6. Let :math:`j^\ast` be the concatenation of the two sequences :math:`i_2^N` and :math:`0^{32-N}`.
728734

729-
7. Let :math:`c` be the result of computing :math:`\ibits_{32}^{-1}(j^\ast)`.
735+
7. Let :math:`i` be the result of computing :math:`\ibits_{32}^{-1}(j^\ast)`.
730736

731-
8. Push the value :math:`\I32.\CONST~c` onto the stack.
737+
8. Push the value :math:`\I32.\CONST~i` onto the stack.
732738

733739
.. math::
734740
\begin{array}{lcl@{\qquad}l}
735-
(\V128\K{.}\VCONST~c_1)~t\K{x}N\K{.}\BITMASK &\stepto& (\I32\K{.}\CONST~c)
736-
& (\iff c = \ibits_{32}^{-1}(\ilts_{|t|}(\lanes_{t\K{x}N}(c), 0^N)))
741+
(\V128\K{.}\VCONST~c)~t\K{x}N\K{.}\BITMASK &\stepto& (\I32\K{.}\CONST~i)
742+
& (\iff i = \ibits_{32}^{-1}(\ilts_{|t|}(\lanes_{t\K{x}N}(c), 0^N)))
737743
\\
738744
\end{array}
739745
@@ -855,8 +861,8 @@ where:
855861
\end{array}
856862
857863
858-
:math:`t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx\K{\_zero}`
859-
...............................................................
864+
:math:`t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx^?\K{\_zero}`
865+
.................................................................
860866

861867
1. Assert: due to :ref:`syntax <syntax-instr-vec>`, :math:`N = 2 \cdot M`.
862868

@@ -866,7 +872,7 @@ where:
866872

867873
4. Let :math:`i^\ast` be the result of computing :math:`\lanes_{t_1\K{x}M}(c_1)`.
868874

869-
5. Let :math:`j^\ast` be the result of computing :math:`\vcvtop^{\sx}_{|t_1|,|t_2|}(i^\ast)`.
875+
5. Let :math:`j^\ast` be the result of computing :math:`\vcvtop^{\sx^?}_{|t_1|,|t_2|}(i^\ast)`.
870876

871877
6. Let :math:`k^\ast` be the concatenation of the two sequences :math:`j^\ast` and :math:`0^M`.
872878

@@ -877,11 +883,11 @@ where:
877883
.. math::
878884
\begin{array}{l}
879885
\begin{array}{lcl@{\qquad}l}
880-
(\V128\K{.}\VCONST~c_1)~t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx\K{\_zero} &\stepto& (\V128\K{.}\VCONST~c) \\
886+
(\V128\K{.}\VCONST~c_1)~t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx^?\K{\_zero} &\stepto& (\V128\K{.}\VCONST~c) \\
881887
\end{array}
882888
\\ \qquad
883889
\begin{array}[t]{@{}r@{~}l@{}}
884-
(\iff & c = \lanes^{-1}_{t_2\K{x}N}(\vcvtop^{\sx}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1))~0^M))
890+
(\iff & c = \lanes^{-1}_{t_2\K{x}N}(\vcvtop^{\sx^?}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1))~0^M))
885891
\end{array}
886892
\end{array}
887893
@@ -960,7 +966,7 @@ where:
960966

961967
10. Let :math:`k_2^\ast` be the result of computing :math:`\extend^{\sx}_{|t_1|,|t_2|}(j_2^\ast)`.
962968

963-
11. Let :math:`k^\ast` be the result of computing :math:`\imul_{t_2\K{x}N}(k_1^\ast, k_2^\ast)`.
969+
11. Let :math:`k^\ast` be the result of computing :math:`\imul_{|t_2|}(k_1^\ast, k_2^\ast)`.
964970

965971
12. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(k^\ast)`.
966972

@@ -974,7 +980,7 @@ where:
974980
\begin{array}[t]{@{}r@{~}l@{}}
975981
(\iff & i^\ast = \lanes_{t_1\K{x}M}(c_1)[\half(0, N) \slice N] \\
976982
\wedge & j^\ast = \lanes_{t_1\K{x}M}(c_2)[\half(0, N) \slice N] \\
977-
\wedge & c = \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))))
983+
\wedge & c = \lanes^{-1}_{t_2\K{x}N}(\imul_{|t_2|}(\extend^{\sx}_{|t_1|,|t_2|}(i^\ast), \extend^{\sx}_{|t_1|,|t_2|}(j^\ast))))
978984
\end{array}
979985
980986
where:
@@ -1001,7 +1007,7 @@ where:
10011007

10021008
5. Let :math:`(j_1~j_2)^\ast` be the result of computing :math:`\extend^{\sx}_{|t_1|,|t_2|}(i^\ast)`.
10031009

1004-
6. Let :math:`k^\ast` be the result of computing :math:`\iadd_{N}(j_1, j_2)^\ast`.
1010+
6. Let :math:`k^\ast` be the result of computing :math:`\iadd_{|t_2|}(j_1, j_2)^\ast`.
10051011

10061012
7. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(k^\ast)`.
10071013

@@ -1015,7 +1021,7 @@ where:
10151021
\\ \qquad
10161022
\begin{array}[t]{@{}r@{~}l@{}}
10171023
(\iff & (i_1~i_2)^\ast = \extend^{\sx}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1)) \\
1018-
\wedge & j^\ast = \iadd_{N}(i_1, i_2)^\ast \\
1024+
\wedge & j^\ast = \iadd_{|t_2|}(i_1, i_2)^\ast \\
10191025
\wedge & c = \lanes^{-1}_{t_2\K{x}N}(j^\ast))
10201026
\end{array}
10211027
\end{array}

document/core/exec/modules.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,10 @@ Once the function has returned, the following steps are executed:
689689

690690
2. Pop :math:`\val_{\F{res}}^m` from the stack.
691691

692+
3. Assert: due to :ref:`validation <valid-module>`, the frame :math:`F` is now on the top of the stack.
693+
694+
4. Pop the frame :math:`F` from the stack.
695+
692696
The values :math:`\val_{\F{res}}^m` are returned as the results of the invocation.
693697

694698
.. math::

document/core/exec/numerics.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,25 @@ where :math:`M = \significand(N)` and :math:`E = \exponent(N)`.
169169
Vectors
170170
.......
171171

172-
Numeric vectors have the same underlying representation as an |i128|.
173-
They can also be interpreted as a sequence of numeric values packed into a |V128| with a particular |shape|.
172+
Numeric vectors of type |VN| have the same underlying representation as an |IN|.
173+
They can also be interpreted as a sequence of numeric values packed into a |VN| with a particular |shape| :math:`t\K{x}M`,
174+
provided that :math:`N = |t|\cdot M`.
174175

175176
.. math::
176177
\begin{array}{l}
177178
\begin{array}{lll@{\qquad}l}
178-
\lanes_{t\K{x}N}(c) &=&
179-
c_0~\dots~c_{N-1} \\
179+
\lanes_{t\K{x}M}(c) &=&
180+
c_0~\dots~c_{M-1} \\
180181
\end{array}
181182
\\ \qquad
182183
\begin{array}[t]{@{}r@{~}l@{}l@{~}l@{~}l}
183-
(\where & B &=& |t| / 8 \\
184-
\wedge & b^{16} &=& \bytes_{\i128}(c) \\
185-
\wedge & c_i &=& \bytes_{t}^{-1}(b^{16}[i \cdot B \slice B]))
184+
(\where & w &=& |t| / 8 \\
185+
\wedge & b^\ast &=& \bytes_{\IN}(c) \\
186+
\wedge & c_i &=& \bytes_{t}^{-1}(b^\ast[i \cdot w \slice w]))
186187
\end{array}
187188
\end{array}
188189
189-
These functions are bijections, so they are invertible.
190+
This function is a bijection on |IN|, hence it is invertible.
190191

191192

192193
.. index:: byte, little endian, memory
@@ -715,11 +716,13 @@ The integer result of predicates -- i.e., :ref:`tests <syntax-testop>` and :ref:
715716
:math:`\iextendMs_N(i)`
716717
.......................
717718

718-
* Return :math:`\extends_{M,N}(i)`.
719+
* Let :math:`j` be the result of computing :math:`\wrap_{N,M}(i)`.
720+
721+
* Return :math:`\extends_{M,N}(j)`.
719722

720723
.. math::
721724
\begin{array}{lll@{\qquad}l}
722-
\iextendMs_{N}(i) &=& \extends_{M,N}(i) \\
725+
\iextendMs_{N}(i) &=& \extends_{M,N}(\wrap_{N,M}(i)) \\
723726
\end{array}
724727
725728

0 commit comments

Comments
 (0)