Skip to content

Commit 91e770c

Browse files
authored
[spec] Fix operand order in reduction of shape.replace_lane (WebAssembly#1721)
1 parent 52e3cb0 commit 91e770c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

document/core/exec/instructions.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,31 +513,31 @@ Most other vector instructions are defined in terms of numeric operators that ar
513513

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

516-
2. Let :math:`t_1` be the type :math:`\unpacked(\shape)`.
516+
2. Let :math:`t_2` be the type :math:`\unpacked(\shape)`.
517517

518518
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.
519519

520-
4. Pop the value :math:`t_1.\CONST~c_1` from the stack.
520+
4. Pop the value :math:`t_2.\CONST~c_2` from the stack.
521521

522522
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.
523523

524-
6. Pop the value :math:`\V128.\VCONST~c_2` from the stack.
524+
6. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
525525

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

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

530530
9. Push :math:`\V128.\VCONST~c` on the stack.
531531

532532
.. math::
533533
\begin{array}{l}
534534
\begin{array}{lcl@{\qquad}l}
535-
(t_1\K{.}\CONST~c_1)~(\V128\K{.}\VCONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
535+
(\V128\K{.}\VCONST~c_1)~(t_2\K{.}\CONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
536536
\end{array}
537537
\\ \qquad
538538
\begin{array}[t]{@{}r@{~}l@{}}
539-
(\iff & i^\ast = \lanes_{\shape}(c_2) \\
540-
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_1))
539+
(\iff & i^\ast = \lanes_{\shape}(c_1) \\
540+
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_2))
541541
\end{array}
542542
\end{array}
543543

0 commit comments

Comments
 (0)