Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
49e87dc
[test] Add test for init expr with missing end marker (#1645)
keithw Apr 27, 2023
dec2738
Add test for the module size limit (#1642)
gahaas May 2, 2023
b72a1aa
[test] Disable tests that become valid with memory64 (#1648)
backes May 10, 2023
0a190c9
Remove duplicated binary tests (#1649)
backes May 10, 2023
86b6a18
Make binary-leb128 test memory64-ready (#1650)
backes May 10, 2023
fe35511
Move more LEB128 tests to binary-leb128 (#1651)
backes May 10, 2023
2e8912e
Allow test for module size limit to fail (#1653)
backes May 12, 2023
083f24c
[spec] Fix table_alloc signature (#1658)
May 30, 2023
933d2dd
[interpreter] Tweak parser
rossberg May 30, 2023
b55d740
[spec] Include reftype in inline element segment abbreviations (#1657)
tomstuart May 30, 2023
e19508a
[spec] Fix copypaste error for V128.Load*_Zero instructions in index …
rdunnington Jun 6, 2023
f2ab415
[interpreter] Use explicit bounds checks instead Invalid_argument (#1…
redianthus Jun 13, 2023
905f42d
[interpreter] Makefile tweak
rossberg Jun 14, 2023
c674a0b
[spec] Tweak math layout
rossberg Jun 27, 2023
6315e12
[spec] Some tweaks to layout and SIMD ops (#1667)
rossberg Jun 27, 2023
5b18d52
[spec] Add missing type to elem.drop and store soundness (#1668)
bvisness Jul 3, 2023
2b00952
[test] Add tests for out-of-range NaN payloads (#1670)
sunfishcode Jul 11, 2023
539d521
[spec] Fix typo (#1671)
pdubroy Jul 12, 2023
f3a57d9
[spec] Remark about the convention of using a pattern for attribute v…
rossberg Jul 24, 2023
3abc587
[interpreter] Bump version to 2.0.1
rossberg Jul 24, 2023
797cb5e
[interpreter] Makefile support for opam releases
rossberg Jul 24, 2023
8a0080a
[interpreter] Makefile tweaks
rossberg Jul 24, 2023
0bd3aeb
[interpreter] Makefile tweaks
rossberg Jul 24, 2023
cfc9343
[interpreter] Tune opam file to fix opam repo CI
rossberg Jul 24, 2023
653938a
[interpreter] Use dune instead of ocamlbuild (#1665)
redianthus Jul 26, 2023
01ddc50
Merge remote-tracking branch 'WebAssembly/spec/main' into add-RAB-sup…
ioannad Aug 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion document/core/appendix/embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Tables

.. _embed-table-alloc:

:math:`\F{table\_alloc}(\store, \tabletype) : (\store, \tableaddr, \reff)`
:math:`\F{table\_alloc}(\store, \tabletype, \reff) : (\store, \tableaddr)`
..........................................................................

1. Pre-condition: :math:`\tabletype` is :ref:`valid <valid-tabletype>`.
Expand Down
4 changes: 2 additions & 2 deletions document/core/appendix/index-instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
Instruction(r'\V128.\STORE\K{16\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{59}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
Instruction(r'\V128.\STORE\K{32\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5A}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
Instruction(r'\V128.\STORE\K{64\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5B}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
Instruction(r'\V128.\LOAD\K{32\_zero}~\memarg~\laneidx', r'\hex{FD}~~\hex{5C}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
Instruction(r'\V128.\LOAD\K{64\_zero}~\memarg~\laneidx', r'\hex{FD}~~\hex{5D}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
Instruction(r'\V128.\LOAD\K{32\_zero}~\memarg', r'\hex{FD}~~\hex{5C}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
Instruction(r'\V128.\LOAD\K{64\_zero}~\memarg', r'\hex{FD}~~\hex{5D}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
Instruction(r'\F32X4.\VDEMOTE\K{\_f64x2\_zero}', r'\hex{FD}~~\hex{5E}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-demote'),
Instruction(r'\F64X2.\VPROMOTE\K{\_low\_f32x4}', r'\hex{FD}~~\hex{5F}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-promote'),
Instruction(r'\I8X16.\VABS', r'\hex{FD}~~\hex{60}', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-iabs'),
Expand Down
4 changes: 2 additions & 2 deletions document/core/appendix/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
.. index:: element instance, reference
.. _valid-eleminst:

:ref:`Element Instances <syntax-eleminst>` :math:`\{ \EIELEM~\X{fa}^\ast \}`
............................................................................
:ref:`Element Instances <syntax-eleminst>` :math:`\{ \EITYPE~t, \EIELEM~\reff^\ast \}`
......................................................................................

* For each :ref:`reference <syntax-ref>` :math:`\reff_i` in the elements :math:`\reff^n`:

Expand Down
1 change: 1 addition & 0 deletions document/core/binary/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ In order to distinguish symbols of the binary syntax from symbols of the abstrac
(This is a shorthand for :math:`B^n` where :math:`n \leq 1`.)

* :math:`x{:}B` denotes the same language as the nonterminal :math:`B`, but also binds the variable :math:`x` to the attribute synthesized for :math:`B`.
A pattern may also be used instead of a variable, e.g., :math:`7{:}B`.

* Productions are written :math:`\B{sym} ::= B_1 \Rightarrow A_1 ~|~ \dots ~|~ B_n \Rightarrow A_n`, where each :math:`A_i` is the attribute that is synthesized for :math:`\B{sym}` in the given case, usually from attribute variables bound in :math:`B_i`.

Expand Down
2 changes: 1 addition & 1 deletion document/core/binary/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Each section consists of

* a one-byte section *id*,
* the |U32| *size* of the contents, in bytes,
* the actual *contents*, whose structure is depended on the section id.
* the actual *contents*, whose structure is dependent on the section id.

Every section is optional; an omitted section is equivalent to the section being present with empty contents.

Expand Down
69 changes: 35 additions & 34 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ The mapping of numeric instructions to their underlying operators is expressed b

.. math::
\begin{array}{lll@{\qquad}l}
\X{op}_{\K{i}N}(n_1,\dots,n_k) &=& \F{i}\X{op}_N(n_1,\dots,n_k) \\
\X{op}_{\K{f}N}(z_1,\dots,z_k) &=& \F{f}\X{op}_N(z_1,\dots,z_k) \\
\X{op}_{\IN}(i_1,\dots,i_k) &=& \F{i}\X{op}_N(i_1,\dots,i_k) \\
\X{op}_{\FN}(z_1,\dots,z_k) &=& \F{f}\X{op}_N(z_1,\dots,z_k) \\
\X{op}_{\VN}(i_1,\dots,i_k) &=& \F{i}\X{op}_N(i_1,\dots,i_k) \\
\end{array}

And for :ref:`conversion operators <exec-cvtop>`:
Expand Down Expand Up @@ -292,14 +293,14 @@ Most vector instructions are defined in terms of generic numeric operators appli

2. Pop the value :math:`\V128.\VCONST~c_1` from the stack.

3. Let :math:`c` be the result of computing :math:`\vvunop_{\I128}(c_1)`.
3. Let :math:`c` be the result of computing :math:`\vvunop_{\V128}(c_1)`.

4. Push the value :math:`\V128.\VCONST~c` to the stack.

.. math::
\begin{array}{lcl@{\qquad}l}
(\V128\K{.}\VCONST~c_1)~\V128\K{.}\vvunop &\stepto& (\V128\K{.}\VCONST~c)
& (\iff c = \vvunop_{\I128}(c_1)) \\
& (\iff c = \vvunop_{\V128}(c_1)) \\
\end{array}


Expand All @@ -314,14 +315,14 @@ Most vector instructions are defined in terms of generic numeric operators appli

3. Pop the value :math:`\V128.\VCONST~c_1` from the stack.

4. Let :math:`c` be the result of computing :math:`\vvbinop_{\I128}(c_1, c_2)`.
4. Let :math:`c` be the result of computing :math:`\vvbinop_{\V128}(c_1, c_2)`.

5. Push the value :math:`\V128.\VCONST~c` to the stack.

.. math::
\begin{array}{lcl@{\qquad}l}
(\V128\K{.}\VCONST~c_1)~(\V128\K{.}\VCONST~c_2)~\V128\K{.}\vvbinop &\stepto& (\V128\K{.}\VCONST~c)
& (\iff c = \vvbinop_{\I128}(c_1, c_2)) \\
& (\iff c = \vvbinop_{\V128}(c_1, c_2)) \\
\end{array}


Expand All @@ -338,14 +339,14 @@ Most vector instructions are defined in terms of generic numeric operators appli

4. Pop the value :math:`\V128.\VCONST~c_1` from the stack.

5. Let :math:`c` be the result of computing :math:`\vvternop_{\I128}(c_1, c_2, c_3)`.
5. Let :math:`c` be the result of computing :math:`\vvternop_{\V128}(c_1, c_2, c_3)`.

6. Push the value :math:`\V128.\VCONST~c` to the stack.

.. math::
\begin{array}{lcl@{\qquad}l}
(\V128\K{.}\VCONST~c_1)~(\V128\K{.}\VCONST~c_2)~(\V128\K{.}\VCONST~c_3)~\V128\K{.}\vvternop &\stepto& (\V128\K{.}\VCONST~c)
& (\iff c = \vvternop_{\I128}(c_1, c_2, c_3)) \\
& (\iff c = \vvternop_{\V128}(c_1, c_2, c_3)) \\
\end{array}


Expand Down Expand Up @@ -379,15 +380,15 @@ Most vector instructions are defined in terms of generic numeric operators appli

2. Pop the value :math:`\V128.\VCONST~c_2` from the stack.

3. Let :math:`i^\ast` be the result of computing :math:`\lanes_{i8x16}(c_2)`.
3. Let :math:`i^\ast` be the result of computing :math:`\lanes_{\I8X16}(c_2)`.

4. Pop the value :math:`\V128.\VCONST~c_1` from the stack.

5. Let :math:`j^\ast` be the result of computing :math:`\lanes_{i8x16}(c_1)`.
5. Let :math:`j^\ast` be the result of computing :math:`\lanes_{\I8X16}(c_1)`.

6. Let :math:`c^\ast` be the concatenation of the two sequences :math:`j^\ast` and :math:`0^{240}`.

7. Let :math:`c'` be the result of computing :math:`\lanes^{-1}_{i8x16}(c^\ast[ i^\ast[0] ] \dots c^\ast[ i^\ast[15] ])`.
7. Let :math:`c'` be the result of computing :math:`\lanes^{-1}_{\I8X16}(c^\ast[ i^\ast[0] ] \dots c^\ast[ i^\ast[15] ])`.

8. Push the value :math:`\V128.\VCONST~c'` onto the stack.

Expand All @@ -398,9 +399,9 @@ Most vector instructions are defined in terms of generic numeric operators appli
\end{array}
\\ \qquad
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & i^\ast = \lanes_{i8x16}(c_2) \\
\wedge & c^\ast = \lanes_{i8x16}(c_1)~0^{240} \\
\wedge & c' = \lanes^{-1}_{i8x16}(c^\ast[ i^\ast[0] ] \dots c^\ast[ i^\ast[15] ]))
(\iff & i^\ast = \lanes_{\I8X16}(c_2) \\
\wedge & c^\ast = \lanes_{\I8X16}(c_1)~0^{240} \\
\wedge & c' = \lanes^{-1}_{\I8X16}(c^\ast[ i^\ast[0] ] \dots c^\ast[ i^\ast[15] ]))
\end{array}
\end{array}

Expand All @@ -416,15 +417,15 @@ Most vector instructions are defined in terms of generic numeric operators appli

3. Pop the value :math:`\V128.\VCONST~c_2` from the stack.

4. Let :math:`i_2^\ast` be the result of computing :math:`\lanes_{i8x16}(c_2)`.
4. Let :math:`i_2^\ast` be the result of computing :math:`\lanes_{\I8X16}(c_2)`.

5. Pop the value :math:`\V128.\VCONST~c_1` from the stack.

6. Let :math:`i_1^\ast` be the result of computing :math:`\lanes_{i8x16}(c_1)`.
6. Let :math:`i_1^\ast` be the result of computing :math:`\lanes_{\I8X16}(c_1)`.

7. Let :math:`i^\ast` be the concatenation of the two sequences :math:`i_1^\ast` and :math:`i_2^\ast`.

8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{i8x16}(i^\ast[x^\ast[0]] \dots i^\ast[x^\ast[15]])`.
8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\I8X16}(i^\ast[x^\ast[0]] \dots i^\ast[x^\ast[15]])`.

9. Push the value :math:`\V128.\VCONST~c` onto the stack.

Expand All @@ -435,8 +436,8 @@ Most vector instructions are defined in terms of generic numeric operators appli
\end{array}
\\ \qquad
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & i^\ast = \lanes_{i8x16}(c_1)~\lanes_{i8x16}(c_2) \\
\wedge & c = \lanes^{-1}_{i8x16}(i^\ast[x^\ast[0]] \dots i^\ast[x^\ast[15]]))
(\iff & i^\ast = \lanes_{\I8X16}(c_1)~\lanes_{\I8X16}(c_2) \\
\wedge & c = \lanes^{-1}_{\I8X16}(i^\ast[x^\ast[0]] \dots i^\ast[x^\ast[15]]))
\end{array}
\end{array}

Expand Down Expand Up @@ -1681,7 +1682,7 @@ Table Instructions

4. Assert: due to :ref:`validation <valid-elem.drop>`, :math:`S.\SELEMS[a]` exists.

5. Replace :math:`S.\SELEMS[a]` with the :ref:`element instance <syntax-eleminst>` :math:`\{\EIELEM~\epsilon\}`.
5. Replace :math:`S.\SELEMS[a].\EIELEM` with :math:`\epsilon`.

.. math::
~\\[-1ex]
Expand All @@ -1690,7 +1691,7 @@ Table Instructions
S; F; (\ELEMDROP~x) &\stepto& S'; F; \epsilon
\end{array}
\\ \qquad
(\iff S' = S \with \SELEMS[F.\AMODULE.\MIELEMS[x]] = \{ \EIELEM~\epsilon \}) \\
(\iff S' = S \with \SELEMS[F.\AMODULE.\MIELEMS[x]].\EIELEM = \epsilon) \\
\end{array}


Expand Down Expand Up @@ -1875,7 +1876,7 @@ Memory Instructions

14. Let :math:`n_k` be the result of computing :math:`\extend^{\sx}_{M,W}(m_k)`.

15. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\X{i}W\K{x}N}(n_0 \dots n_{N-1})`.
15. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\K{i}W\K{x}N}(n_0 \dots n_{N-1})`.

16. Push the value :math:`\V128.\CONST~c` to the stack.

Expand All @@ -1891,7 +1892,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\UNSHARED \\
\wedge & \X{ea} + M \cdot N / 8 \leq |\X{mem}.\MIDATA| \\
\wedge & \bytes_{\iM}(m_k) = \X{mem}.\MIDATA[\X{ea} + k \cdot M/8 \slice M/8] \\
\wedge & c = \lanes^{-1}_{\X{i}W\K{x}N}(\extend^{\sx}_{M,W}(m_0) \dots \extend^{\sx}_{M,W}(m_{N-1}))) \\[1ex]
\wedge & c = \lanes^{-1}_{\K{i}W\K{x}N}(\extend^{\sx}_{M,W}(m_0) \dots \extend^{\sx}_{M,W}(m_{N-1}))) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand All @@ -1910,7 +1911,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\SHARED \\
\wedge & \X{ea} + M \cdot N / 8 \leq n \\
\wedge & \bytes_{\iM}(m_k) = b^\ast[k \cdot M/8 \slice M/8] \\
\wedge & c = \lanes^{-1}_{\X{i}W\K{x}N}(\extend^{\sx}_{M,W}(m_0) \dots \extend^{\sx}_{M,W}(m_{N-1}))) \\[1ex]
\wedge & c = \lanes^{-1}_{\K{i}W\K{x}N}(\extend^{\sx}_{M,W}(m_0) \dots \extend^{\sx}_{M,W}(m_{N-1}))) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand Down Expand Up @@ -1980,7 +1981,7 @@ Memory Instructions

13. Let :math:`L` be the integer :math:`128 / N`.

14. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\iN\K{x}L}(n^L)`.
14. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\IN\K{x}L}(n^L)`.

15. Push the value :math:`\V128.\CONST~c` to the stack.

Expand All @@ -1995,7 +1996,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\UNSHARED \\
\wedge & \X{ea} + N/8 \leq |\X{mem}.\MIDATA| \\
\wedge & \bytes_{\iN}(n) = \X{mem}.\MIDATA[\X{ea} \slice N/8] \\
\wedge & c = \lanes^{-1}_{\iN\K{x}L}(n^L)) \\[1ex]
\wedge & c = \lanes^{-1}_{\IN\K{x}L}(n^L)) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand All @@ -2015,7 +2016,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\SHARED \\
\wedge & \X{ea} + N/8 \leq n \\
\wedge & \bytes_{\iN}(n) = b^\ast \\
\wedge & c = \lanes^{-1}_{\iN\K{x}L}(n^L)) \\[1ex]
\wedge & c = \lanes^{-1}_{\IN\K{x}L}(n^L)) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand Down Expand Up @@ -2193,9 +2194,9 @@ Memory Instructions

15. Let :math:`L` be :math:`128 / N`.

16. Let :math:`j^\ast` be the result of computing :math:`\lanes_{\K{i}N\K{x}L}(v)`.
16. Let :math:`j^\ast` be the result of computing :math:`\lanes_{\IN\K{x}L}(v)`.

17. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\K{i}N\K{x}L}(j^\ast \with [x] = r)`.
17. Let :math:`c` be the result of computing :math:`\lanes_{\IN\K{x}L}(j^\ast \with [x] = r)`.

18. Push the value :math:`\V128.\CONST~c` to the stack.

Expand All @@ -2210,7 +2211,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\UNSHARED \\
\wedge & \X{ea} + N/8 \leq |\X{mem}.\MIDATA| \\
\wedge & \bytes_{\iN}(n) = \X{mem}.\MIDATA[\X{ea} \slice N/8] \\
\wedge & c = \lanes^{-1}_{\K{i}N\K{x}L}(\lanes_{\K{i}N\K{x}L}(v) \with [x] = r)) \\[1ex]
\wedge & c = \lanes^{-1}_{\IN\K{x}L}(\lanes_{\IN\K{x}L}(v) \with [x] = r)) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand All @@ -2230,7 +2231,7 @@ Memory Instructions
(\iff & \X{mem}.\MITYPE = \limits~\SHARED \\
\wedge & \X{ea} + N/8 \leq n \\
\wedge & \bytes_{\iN}(n) = b^\ast \\
\wedge & c = \lanes^{-1}_{\K{i}N\K{x}L}(\lanes_{\K{i}N\K{x}L}(v) \with [x] = r)) \\[1ex]
\wedge & c = \lanes^{-1}_{\IN\K{x}L}(\lanes_{\IN\K{x}L}(v) \with [x] = r)) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand Down Expand Up @@ -2402,7 +2403,7 @@ Memory Instructions

12. Let :math:`L` be :math:`128/N`.

13. Let :math:`j^\ast` be the result of computing :math:`\lanes_{\K{i}N\K{x}L}(c)`.
13. Let :math:`j^\ast` be the result of computing :math:`\lanes_{\IN\K{x}L}(c)`.

14. Let :math:`b^\ast` be the result of computing :math:`\bytes_{\iN}(j^\ast[x])`.

Expand Down Expand Up @@ -2434,7 +2435,7 @@ Memory Instructions
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & \X{mem}.\MITYPE = \limits~\UNSHARED \\
\wedge & \X{ea} + N/8 \leq |\X{mem}.\MIDATA| \\
\wedge & S' = S \with \SMEMS[F.\AMODULE.\MIMEMS[0]].\MIDATA[\X{ea} \slice N/8] = \bytes_{\iN}(\lanes_{\K{i}N\K{x}L}(c)[x])) \\[1ex]
\wedge & S' = S \with \SMEMS[F.\AMODULE.\MIMEMS[0]].\MIDATA[\X{ea} \slice N/8] = \bytes_{\iN}(\lanes_{\IN\K{x}L}(c)[x])) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand All @@ -2453,7 +2454,7 @@ Memory Instructions
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & \X{mem}.\MITYPE = \limits~\SHARED \\
\wedge & \X{ea} + N/8 \leq n \\
\wedge & b^\ast = \bytes_{\iN}(\lanes_{\K{i}N\K{x}L}(c)[x])) \\[1ex]
\wedge & b^\ast = \bytes_{\iN}(\lanes_{\IN\K{x}L}(c)[x])) \\[1ex]
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
Expand Down
Loading