Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 364e89f

Browse files
ngzhianrossbergchfast
authored
Merge from upstream spec (#407)
* [spec] automate instruction index rebuild (#1259) * [test] Add test for malformed functype (#1254) * [test] Correct tests for missing elements (#1251) Remove the code section in tests for malformed element section. Otherwise the code section id (0x0a) is taken as an element's table index what is a validation error. This is similar to the previously reported issue: WebAssembly/spec#1170. * [test] Add tests for data segment with memidx 1 (#1249) * [test] Correct i32.store alignment in a LEB128 test (#1261) In the binary-leb128.wast, change the alignment of an i32.store instruction from 3 (invalid) to 2 (the intention suggested by the comment). Co-authored-by: Andreas Rossberg <[email protected]> Co-authored-by: Paweł Bylica <[email protected]>
1 parent df999c8 commit 364e89f

File tree

6 files changed

+211
-5
lines changed

6 files changed

+211
-5
lines changed

document/core/Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ bikeshed-keep:
8989
echo Downloaded Bikeshed.
9090

9191

92+
.PHONY: index
93+
index:
94+
(cd appendix; ./gen-index-instructions.py)
95+
9296
.PHONY: pdf
93-
pdf: latexpdf
97+
pdf: index latexpdf
9498
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)
9599
ln -f $(BUILDDIR)/latex/$(NAME).pdf $(BUILDDIR)/html/$(DOWNLOADDIR)/$(NAME).pdf
96100

@@ -101,7 +105,7 @@ clean:
101105
rm -rf $(STATICDIR)
102106

103107
.PHONY: html
104-
html:
108+
html: index
105109
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
106110
for file in `ls $(BUILDDIR)/html/*.html`; \
107111
do \

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

+55
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,61 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
258258
Instruction(r'\I64.\EXTEND\K{8\_s}', r'\hex{C2}', r'[\I64] \to [\I64]', r'valid-unop', r'exec-unop', r'op-iextendn_s'),
259259
Instruction(r'\I64.\EXTEND\K{16\_s}', r'\hex{C3}', r'[\I64] \to [\I64]', r'valid-unop', r'exec-unop', r'op-iextendn_s'),
260260
Instruction(r'\I64.\EXTEND\K{32\_s}', r'\hex{C4}', r'[\I64] \to [\I64]', r'valid-unop', r'exec-unop', r'op-iextendn_s'),
261+
Instruction(None, r'\hex{C5}'),
262+
Instruction(None, r'\hex{C6}'),
263+
Instruction(None, r'\hex{C7}'),
264+
Instruction(None, r'\hex{C8}'),
265+
Instruction(None, r'\hex{C9}'),
266+
Instruction(None, r'\hex{CA}'),
267+
Instruction(None, r'\hex{CB}'),
268+
Instruction(None, r'\hex{CC}'),
269+
Instruction(None, r'\hex{CD}'),
270+
Instruction(None, r'\hex{CE}'),
271+
Instruction(None, r'\hex{CF}'),
272+
Instruction(None, r'\hex{D0}'),
273+
Instruction(None, r'\hex{D1}'),
274+
Instruction(None, r'\hex{D2}'),
275+
Instruction(None, r'\hex{D3}'),
276+
Instruction(None, r'\hex{D4}'),
277+
Instruction(None, r'\hex{D5}'),
278+
Instruction(None, r'\hex{D6}'),
279+
Instruction(None, r'\hex{D7}'),
280+
Instruction(None, r'\hex{D8}'),
281+
Instruction(None, r'\hex{D9}'),
282+
Instruction(None, r'\hex{DA}'),
283+
Instruction(None, r'\hex{DB}'),
284+
Instruction(None, r'\hex{DC}'),
285+
Instruction(None, r'\hex{DD}'),
286+
Instruction(None, r'\hex{DE}'),
287+
Instruction(None, r'\hex{DF}'),
288+
Instruction(None, r'\hex{E0}'),
289+
Instruction(None, r'\hex{E1}'),
290+
Instruction(None, r'\hex{E2}'),
291+
Instruction(None, r'\hex{E3}'),
292+
Instruction(None, r'\hex{E4}'),
293+
Instruction(None, r'\hex{E5}'),
294+
Instruction(None, r'\hex{E6}'),
295+
Instruction(None, r'\hex{E7}'),
296+
Instruction(None, r'\hex{E8}'),
297+
Instruction(None, r'\hex{E9}'),
298+
Instruction(None, r'\hex{EA}'),
299+
Instruction(None, r'\hex{EB}'),
300+
Instruction(None, r'\hex{EC}'),
301+
Instruction(None, r'\hex{ED}'),
302+
Instruction(None, r'\hex{EE}'),
303+
Instruction(None, r'\hex{EF}'),
304+
Instruction(None, r'\hex{F0}'),
305+
Instruction(None, r'\hex{F1}'),
306+
Instruction(None, r'\hex{F2}'),
307+
Instruction(None, r'\hex{F3}'),
308+
Instruction(None, r'\hex{F4}'),
309+
Instruction(None, r'\hex{F5}'),
310+
Instruction(None, r'\hex{F6}'),
311+
Instruction(None, r'\hex{F7}'),
312+
Instruction(None, r'\hex{F8}'),
313+
Instruction(None, r'\hex{F9}'),
314+
Instruction(None, r'\hex{FA}'),
315+
Instruction(None, r'\hex{FB}'),
261316
Instruction(r'\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}', r'\hex{FC}~~0', r'[\F32] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat_s'),
262317
Instruction(r'\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}', r'\hex{FC}~~1', r'[\F32] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat_u'),
263318
Instruction(r'\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}', r'\hex{FC}~~2', r'[\F64] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat_s'),

document/core/appendix/index-instructions.rst

+55
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,61 @@ Instruction Binary Opcode Type
206206
:math:`\I64.\EXTEND\K{8\_s}` :math:`\hex{C2}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
207207
:math:`\I64.\EXTEND\K{16\_s}` :math:`\hex{C3}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
208208
:math:`\I64.\EXTEND\K{32\_s}` :math:`\hex{C4}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
209+
(reserved) :math:`\hex{C5}`
210+
(reserved) :math:`\hex{C6}`
211+
(reserved) :math:`\hex{C7}`
212+
(reserved) :math:`\hex{C8}`
213+
(reserved) :math:`\hex{C9}`
214+
(reserved) :math:`\hex{CA}`
215+
(reserved) :math:`\hex{CB}`
216+
(reserved) :math:`\hex{CC}`
217+
(reserved) :math:`\hex{CD}`
218+
(reserved) :math:`\hex{CE}`
219+
(reserved) :math:`\hex{CF}`
220+
(reserved) :math:`\hex{D0}`
221+
(reserved) :math:`\hex{D1}`
222+
(reserved) :math:`\hex{D2}`
223+
(reserved) :math:`\hex{D3}`
224+
(reserved) :math:`\hex{D4}`
225+
(reserved) :math:`\hex{D5}`
226+
(reserved) :math:`\hex{D6}`
227+
(reserved) :math:`\hex{D7}`
228+
(reserved) :math:`\hex{D8}`
229+
(reserved) :math:`\hex{D9}`
230+
(reserved) :math:`\hex{DA}`
231+
(reserved) :math:`\hex{DB}`
232+
(reserved) :math:`\hex{DC}`
233+
(reserved) :math:`\hex{DD}`
234+
(reserved) :math:`\hex{DE}`
235+
(reserved) :math:`\hex{DF}`
236+
(reserved) :math:`\hex{E0}`
237+
(reserved) :math:`\hex{E1}`
238+
(reserved) :math:`\hex{E2}`
239+
(reserved) :math:`\hex{E3}`
240+
(reserved) :math:`\hex{E4}`
241+
(reserved) :math:`\hex{E5}`
242+
(reserved) :math:`\hex{E6}`
243+
(reserved) :math:`\hex{E7}`
244+
(reserved) :math:`\hex{E8}`
245+
(reserved) :math:`\hex{E9}`
246+
(reserved) :math:`\hex{EA}`
247+
(reserved) :math:`\hex{EB}`
248+
(reserved) :math:`\hex{EC}`
249+
(reserved) :math:`\hex{ED}`
250+
(reserved) :math:`\hex{EE}`
251+
(reserved) :math:`\hex{EF}`
252+
(reserved) :math:`\hex{F0}`
253+
(reserved) :math:`\hex{F1}`
254+
(reserved) :math:`\hex{F2}`
255+
(reserved) :math:`\hex{F3}`
256+
(reserved) :math:`\hex{F4}`
257+
(reserved) :math:`\hex{F5}`
258+
(reserved) :math:`\hex{F6}`
259+
(reserved) :math:`\hex{F7}`
260+
(reserved) :math:`\hex{F8}`
261+
(reserved) :math:`\hex{F9}`
262+
(reserved) :math:`\hex{FA}`
263+
(reserved) :math:`\hex{FB}`
209264
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~~0` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`
210265
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~~1` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_u>`
211266
:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}` :math:`\hex{FC}~~2` :math:`[\F64] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`

test/core/binary-leb128.wast

+1-1
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@
852852
"\41\00" ;; i32.const 0
853853
"\41\03" ;; i32.const 3
854854
"\36" ;; i32.store
855-
"\03" ;; alignment 2
855+
"\02" ;; alignment 2
856856
"\82\80\80\80\10" ;; offset 2 with unused bits set
857857
"\0b" ;; end
858858
)

0 commit comments

Comments
 (0)