Skip to content

Commit 65eebf6

Browse files
committed
Merge branch 'upstream'
2 parents 1f02322 + 2558d66 commit 65eebf6

File tree

18 files changed

+140
-85
lines changed

18 files changed

+140
-85
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919
with:
2020
ocaml-compiler: 4.12.x
2121
- run: opam install --yes ocamlbuild.0.14.0
22-
- run: cd interpreter && opam exec make all
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: 19.x
26+
- run: cd interpreter && opam exec make JS=node all
2327

2428
ref-interpreter-js-library:
2529
runs-on: ubuntu-latest
@@ -60,6 +64,9 @@ jobs:
6064
- uses: actions/checkout@v2
6165
with:
6266
submodules: "recursive"
67+
- uses: actions/setup-node@v3
68+
with:
69+
node-version: 16
6370
- run: pip install bikeshed && bikeshed update
6471
- run: pip install six
6572
- run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

document/core/appendix/gen-index-instructions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,10 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
427427
Instruction(r'\V128.\LOAD\K{16\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{55}', r'[\I32~\V128] \to [\V128]', r'valid-load-lane', r'exec-load-lane'),
428428
Instruction(r'\V128.\LOAD\K{32\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{56}', r'[\I32~\V128] \to [\V128]', r'valid-load-lane', r'exec-load-lane'),
429429
Instruction(r'\V128.\LOAD\K{64\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{57}', r'[\I32~\V128] \to [\V128]', r'valid-load-lane', r'exec-load-lane'),
430-
Instruction(r'\V128.\STORE\K{8\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{58}', r'[\I32~\V128] \to [\V128]', r'valid-store-lane', r'exec-store-lane'),
431-
Instruction(r'\V128.\STORE\K{16\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{59}', r'[\I32~\V128] \to [\V128]', r'valid-store-lane', r'exec-store-lane'),
432-
Instruction(r'\V128.\STORE\K{32\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5A}', r'[\I32~\V128] \to [\V128]', r'valid-store-lane', r'exec-store-lane'),
433-
Instruction(r'\V128.\STORE\K{64\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5B}', r'[\I32~\V128] \to [\V128]', r'valid-store-lane', r'exec-store-lane'),
430+
Instruction(r'\V128.\STORE\K{8\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{58}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
431+
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'),
432+
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'),
433+
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'),
434434
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'),
435435
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'),
436436
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'),

document/core/appendix/index-instructions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ Instruction Binary Opcode
367367
:math:`\V128.\LOAD\K{16\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{55}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-load-lane>` :ref:`execution <exec-load-lane>`
368368
:math:`\V128.\LOAD\K{32\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{56}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-load-lane>` :ref:`execution <exec-load-lane>`
369369
:math:`\V128.\LOAD\K{64\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{57}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-load-lane>` :ref:`execution <exec-load-lane>`
370-
:math:`\V128.\STORE\K{8\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{58}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
371-
:math:`\V128.\STORE\K{16\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{59}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
372-
:math:`\V128.\STORE\K{32\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5A}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
373-
:math:`\V128.\STORE\K{64\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5B}` :math:`[\I32~\V128] \to [\V128]` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
370+
:math:`\V128.\STORE\K{8\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{58}` :math:`[\I32~\V128] \to []` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
371+
:math:`\V128.\STORE\K{16\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{59}` :math:`[\I32~\V128] \to []` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
372+
:math:`\V128.\STORE\K{32\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5A}` :math:`[\I32~\V128] \to []` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
373+
:math:`\V128.\STORE\K{64\_lane}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5B}` :math:`[\I32~\V128] \to []` :ref:`validation <valid-store-lane>` :ref:`execution <exec-store-lane>`
374374
:math:`\V128.\LOAD\K{32\_zero}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5C}` :math:`[\I32] \to [\V128]` :ref:`validation <valid-load-zero>` :ref:`execution <exec-load-zero>`
375375
:math:`\V128.\LOAD\K{64\_zero}~\memarg~\laneidx` :math:`\hex{FD}~~\hex{5D}` :math:`[\I32] \to [\V128]` :ref:`validation <valid-load-zero>` :ref:`execution <exec-load-zero>`
376376
:math:`\F32X4.\VDEMOTE\K{\_f64x2\_zero}` :math:`\hex{FD}~~\hex{5E}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-demote>`

document/core/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@
297297
'pointsize': '10pt',
298298

299299
# Additional stuff for the LaTeX preamble.
300-
'preamble': '',
300+
# Don't type-set cross references with emphasis.
301+
'preamble': '\\renewcommand\\sphinxcrossref[1]{#1}\n',
301302

302303
# Latex figure (float) alignment
303304
'figure_align': 'htbp',

document/core/exec/instructions.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ Table Instructions
13121312
\end{array}
13131313
\\[1ex]
13141314
\begin{array}{lcl@{\qquad}l}
1315-
S; F; (\I32.\CONST~n)~(\TABLEGROW~x) &\stepto& S; F; (\I32.\CONST~\signed_{32}^{-1}(-1))
1315+
S; F; \val~(\I32.\CONST~n)~(\TABLEGROW~x) &\stepto& S; F; (\I32.\CONST~\signed_{32}^{-1}(-1))
13161316
\end{array}
13171317
\end{array}
13181318
@@ -2244,7 +2244,7 @@ Memory Instructions
22442244
S; F; (\I32.\CONST~d)~\val~(\I32.\CONST~n)~\MEMORYFILL
22452245
\quad\stepto\quad S; F; \TRAP
22462246
\\ \qquad
2247-
(\iff d + n > |S.\SMEMS[F.\AMODULE.\MIMEMS[x]].\MIDATA|)
2247+
(\iff d + n > |S.\SMEMS[F.\AMODULE.\MIMEMS[0]].\MIDATA|)
22482248
\\[1ex]
22492249
S; F; (\I32.\CONST~d)~\val~(\I32.\CONST~0)~\MEMORYFILL
22502250
\quad\stepto\quad S; F; \epsilon
@@ -2451,7 +2451,7 @@ Memory Instructions
24512451
\\ \qquad
24522452
\begin{array}[t]{@{}r@{~}l@{}}
24532453
(\iff & s + n > |S.\SDATAS[F.\AMODULE.\MIDATAS[x]].\DIDATA| \\
2454-
\vee & d + n > |S.\SMEMS[F.\AMODULE.\MIMEMS[x]].\MIDATA|) \\[1ex]
2454+
\vee & d + n > |S.\SMEMS[F.\AMODULE.\MIMEMS[0]].\MIDATA|) \\[1ex]
24552455
\end{array}
24562456
\\[1ex]
24572457
S; F; (\I32.\CONST~d)~(\I32.\CONST~s)~(\I32.\CONST~0)~(\MEMORYINIT~x)
@@ -2938,22 +2938,20 @@ Exiting :math:`\instr^\ast` with label :math:`L`
29382938

29392939
When the end of a block is reached without a jump or trap aborting it, then the following steps are performed.
29402940

2941-
1. Let :math:`n` be the number of values on the top of the stack.
2942-
2943-
2. Pop the values :math:`\val^n` from the stack.
2941+
1. Pop all values :math:`\val^\ast` from the top of the stack.
29442942

2945-
3. Assert: due to :ref:`validation <valid-instr-seq>`, the label :math:`L` is now on the top of the stack and has arity :math:`n`.
2943+
2. Assert: due to :ref:`validation <valid-instr-seq>`, the label :math:`L` is now on the top of the stack.
29462944

2947-
4. Pop the label from the stack.
2945+
3. Pop the label from the stack.
29482946

2949-
5. Push :math:`\val^n` back to the stack.
2947+
4. Push :math:`\val^\ast` back to the stack.
29502948

2951-
6. Jump to the position after the |END| of the :ref:`structured control instruction <syntax-instr-control>` associated with the label :math:`L`.
2949+
5. Jump to the position after the |END| of the :ref:`structured control instruction <syntax-instr-control>` associated with the label :math:`L`.
29522950

29532951
.. math::
29542952
~\\[-1ex]
29552953
\begin{array}{lcl@{\qquad}l}
2956-
\LABEL_n\{\instr^\ast\}~\val^n~\END &\stepto& \val^n
2954+
\LABEL_n\{\instr^\ast\}~\val^\ast~\END &\stepto& \val^\ast
29572955
\end{array}
29582956
29592957
.. note::

document/core/exec/modules.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ and list of :ref:`reference <syntax-ref>` vectors for the module's :ref:`element
449449

450450
a. Let :math:`\limits_i~t_i` be the :ref:`table type <syntax-tabletype>` :math:`\table_i.\TTYPE`.
451451

452-
b. Let :math:`\tableaddr_i` be the :ref:`table address <syntax-tableaddr>` resulting from :ref:`allocating <alloc-table>` :math:`\table_i.\TTYPE`
453-
with initialization value :math:`\REFNULL~t_i`.
452+
b. Let :math:`\tableaddr_i` be the :ref:`table address <syntax-tableaddr>` resulting from :ref:`allocating <alloc-table>` :math:`\table_i.\TTYPE` with initialization value :math:`\REFNULL~t_i`.
454453

455454
4. For each :ref:`memory <syntax-mem>` :math:`\mem_i` in :math:`\module.\MMEMS`, do:
456455

document/core/static/custom.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ div.admonition p.admonition-title {
4444
div.math {
4545
background-color: #F0F0F0;
4646
padding: 3px 0 3px 0;
47+
overflow-x: auto;
48+
overflow-y: hidden;
4749
}
4850

4951
div.relations {

document/core/syntax/conventions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Grammar Notation
2020

2121
The following conventions are adopted in defining grammar rules for abstract syntax.
2222

23-
* Terminal symbols (atoms) are written in sans-serif font: :math:`\K{i32}, \K{end}`.
23+
* Terminal symbols (atoms) are written in sans-serif font or in symbolic form: :math:`\K{i32}, \K{end}, {\to}, [, ]`.
2424

2525
* Nonterminal symbols are written in italic font: :math:`\X{valtype}, \X{instr}`.
2626

document/core/syntax/values.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ An *arithmetic NaN* is a floating-point value :math:`\pm\NAN(n)` with :math:`n
140140
.. note::
141141
In the abstract syntax, subnormals are distinguished by the leading 0 of the significand. The exponent of subnormals has the same value as the smallest possible exponent of a normal number. Only in the :ref:`binary representation <binary-float>` the exponent of a subnormal is encoded differently than the exponent of any normal number.
142142

143+
The notion of canonical NaN defined here is unrelated to the notion of canonical NaN that the |IEEE754|_ standard (Section 3.5.2) defines for decimal interchange formats.
144+
143145
Conventions
144146
...........
145147

document/core/text/instructions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Reference Instructions
173173
\production{instruction} & \Tplaininstr_I &::=& \dots \\ &&|&
174174
\text{ref.null}~~t{:}\Theaptype &\Rightarrow& \REFNULL~t \\ &&|&
175175
\text{ref.is\_null} &\Rightarrow& \REFISNULL \\ &&|&
176-
\text{ref.func}~~x{:}\Tfuncidx &\Rightarrow& \REFFUNC~x \\ &&|&
176+
\text{ref.func}~~x{:}\Tfuncidx &\Rightarrow& \REFFUNC~x \\
177177
\end{array}
178178
179179
@@ -899,7 +899,7 @@ Vector constant instructions have a mandatory :ref:`shape <syntax-vec-shape>` de
899899
\text{f64x2.convert\_low\_i32x4\_s} &\Rightarrow& \F64X2.\VCONVERT\K{\_low\_i32x4\_s}\\ &&|&
900900
\text{f64x2.convert\_low\_i32x4\_u} &\Rightarrow& \F64X2.\VCONVERT\K{\_low\_i32x4\_u}\\ &&|&
901901
\text{f32x4.demote\_f64x2\_zero} &\Rightarrow& \F32X4.\VDEMOTE\K{\_f64x2\_zero}\\ &&|&
902-
\text{f64x2.promote\_low\_f32x4} &\Rightarrow& \F64X2.\VPROMOTE\K{\_low\_f32x4}\\ &&|&
902+
\text{f64x2.promote\_low\_f32x4} &\Rightarrow& \F64X2.\VPROMOTE\K{\_low\_f32x4}\\
903903
\end{array}
904904
905905

0 commit comments

Comments
 (0)