Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add algorithmic backend #53

Merged
merged 959 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
959 commits
Select commit Hold shift + click to select a range
c8d4480
Impl al_of_ref
ShinWonho Nov 1, 2023
698089e
Update cvtop
ShinWonho Nov 1, 2023
53387bd
Fix bug in al_of_func
ShinWonho Nov 1, 2023
0f9fe70
Add MatchC
ShinWonho Nov 1, 2023
c1a5f84
Handle null
ShinWonho Nov 1, 2023
4826a25
Fix bug related to type index
ShinWonho Nov 1, 2023
e86454a
Delete underscores in manual numerics, with change in signature of wrap_
jaehyun1ee Nov 2, 2023
4fe5828
Promote test results
jaehyun1ee Nov 2, 2023
99206ec
Fix constructor name in builtin module of tester.ml
f52985 Nov 2, 2023
678d4aa
Add gc test + Construct new wasm instrs
f52985 Nov 2, 2023
4ecb5ee
Fix bug in packsize
ShinWonho Nov 2, 2023
3c96c2d
Add tail-call, function-references tests
f52985 Nov 2, 2023
9466fbe
More modeling for HasTypeC
ShinWonho Nov 2, 2023
84b3072
Fix bug in ref.cast
ShinWonho Nov 2, 2023
da446dc
More modeling for MatchesC
ShinWonho Nov 2, 2023
01569d9
Fix typo in I31.GET
ShinWonho Nov 2, 2023
007f7d9
Remodel the AssertReturn
ShinWonho Nov 2, 2023
e2696b8
Add eq.ml
ShinWonho Nov 2, 2023
85d8465
Translate tail calls correctly
f52985 Nov 2, 2023
844614e
Introduce RETURN_CALL_ADDR
f52985 Nov 2, 2023
f0ee90e
Fix bug in spec
ShinWonho Nov 3, 2023
8d91585
Update TEST.md
ShinWonho Nov 3, 2023
e38fd18
Add fields for store
ShinWonho Nov 3, 2023
6567279
Typing for wasm ref
ShinWonho Nov 3, 2023
f07f076
Fix typo
ShinWonho Nov 3, 2023
a7b68cb
More modeling for MatchesC
ShinWonho Nov 3, 2023
e8d37d7
Impl subtype of deftype
ShinWonho Nov 3, 2023
52f4362
Fix bug in eq.ml
ShinWonho Nov 3, 2023
2deace7
More modeling for subtyping deftype
ShinWonho Nov 3, 2023
6a126b3
Fix param ordering of ARRAY.GET in construct
jaehyun1ee Nov 3, 2023
d30ce53
Fix bug in construct
Nov 3, 2023
ca53006
Fix typo in array.copy
ShinWonho Nov 3, 2023
32b3057
Add missing stack value in reduction of ARRAY.SET
jaehyun1ee Nov 3, 2023
a6f8483
Add trap case of array.get/set
Nov 3, 2023
ec947c0
Fix NopI bug
f52985 Nov 3, 2023
73577f2
Add assertion for push value
Nov 3, 2023
d4aa794
Add premise in array.copy rule
Nov 3, 2023
e957cee
Update TEST.md
Nov 3, 2023
4437762
Fix type indices in array.copy
rossberg Nov 3, 2023
beab667
Fix bug in wrap
f52985 Nov 3, 2023
c3e9f4a
Test promote
f52985 Nov 3, 2023
0c5be03
Add OOB cases for array.get/set (#43)
rossberg Nov 3, 2023
893b402
Update TEST.md
Nov 3, 2023
88ef041
Fix bug in MatchesC
Nov 3, 2023
30c260f
Revert removed testcase
Nov 3, 2023
fa8cd4a
Fix bug in spectest
Nov 3, 2023
ee938c0
More modeling matching nullable absheaptype
Nov 3, 2023
0c6867a
Fix ARRAY.INIT_DATA
f52985 Nov 3, 2023
982d41d
Fix REF.NULL semantics
Nov 3, 2023
0518e9f
Count invoke success as assertion success
f52985 Nov 3, 2023
da8b1f2
Fix minor bug
ShinWonho Nov 4, 2023
14abc9a
Fix minor bug
ShinWonho Nov 4, 2023
80a3330
Match with rf
ShinWonho Nov 4, 2023
e276b54
Enhance readability enhancer
f52985 Nov 6, 2023
0ab7ef4
Enhance readability enhancer
f52985 Nov 6, 2023
297b6aa
Splice missing syntax into test-prose/doc
jaehyun1ee Nov 6, 2023
53f0413
Merge branch 'wasm3' into al3-gc
f52985 Nov 8, 2023
eaaa5d5
Make skeleton spec for wasm3
jaehyun1ee Nov 8, 2023
eeb6b5f
Splice missing anchors
jaehyun1ee Nov 9, 2023
46005f8
Discard unused section headers
jaehyun1ee Nov 9, 2023
df02749
Splice all modulo numerics and grammar
jaehyun1ee Nov 9, 2023
e2bac29
Refine splices in skeleton spec
jaehyun1ee Nov 13, 2023
79aa1c3
Stylize skeleton spec cover
jaehyun1ee Nov 13, 2023
d7eb070
Add intro to skeleton document
jaehyun1ee Nov 16, 2023
5cf08fb
Revise comment in Intro
jaehyun1ee Nov 17, 2023
67d0385
Set limit on al_context size
f52985 Nov 21, 2023
737ecc9
Merge branch 'al' into al3
f52985 Nov 21, 2023
5a29e4c
Merge branch 'main' into al3
f52985 Nov 22, 2023
79d56b5
Fix instantiate of wasm 1 and 2
f52985 Nov 23, 2023
6c58ea5
Add nid
ShinWonho Nov 23, 2023
b662230
Print uncovered node
ShinWonho Nov 23, 2023
26203f6
Refactor store init
ShinWonho Nov 23, 2023
cca9b82
Restore works from branch 'al-vector'
702fbtngus Nov 26, 2023
1e025a1
Refactor Construct.ml & impl deconstruct
Nov 28, 2023
369271c
More refactoring on Construct.ml
Nov 28, 2023
816d462
Refactor Construct.ml
Nov 28, 2023
e15772d
Minor Refactoring on Construct.ml
Nov 28, 2023
baa10f2
Minor Refactoring on Construct.ml
Nov 28, 2023
40545ac
More refactoring on Construct.ml
Nov 28, 2023
ffa5976
Extend TupE
Nov 29, 2023
7705fbb
More refactor & impl Construct.ml
Nov 29, 2023
77540fb
Fix minor bug
Nov 29, 2023
edc1b97
Refactor & impl Construct.ml
Nov 29, 2023
65e33a0
Minor change
Nov 29, 2023
fc101ad
Fix minor bug
Nov 29, 2023
5ef6eeb
Do not make macros.def by default
jaehyun1ee Nov 29, 2023
c6105b5
Make Wasm 2 interpretable
f52985 Nov 28, 2023
180cf08
Make Wasm 1 interpretable
f52985 Nov 29, 2023
1118549
Merge branch 'main' into al3
f52985 Nov 30, 2023
629bd4d
Refactor hide_state
Nov 30, 2023
b527c27
Some refactoring on transpile
Nov 30, 2023
d9072ae
Minor change
Nov 30, 2023
266639f
Refactor tester
f52985 Nov 30, 2023
2c4d51d
Minor change
Nov 30, 2023
f9600be
Minor change
Nov 30, 2023
bfd361a
Change s' into s_1
f52985 Nov 30, 2023
bd0c931
Make Wasm 1 interpretable
f52985 Nov 30, 2023
cf909fa
Merge branch 'main' into al
f52985 Nov 30, 2023
049d8b3
Refactor TEST.md
f52985 Nov 30, 2023
4fdbeb9
Refactor
f52985 Nov 30, 2023
1dbd1d3
Fix conflicts in skeleton spec doc
jaehyun1ee Dec 4, 2023
633c3f9
Fix rendering of logical binary operators
jaehyun1ee Dec 4, 2023
0dc85f8
Add note_phrase to AL instr
jaehyun1ee Dec 4, 2023
db9fc96
Add phrase to AL expr
jaehyun1ee Dec 6, 2023
ea60894
Add phrase to AL path
jaehyun1ee Dec 6, 2023
8ce0eea
Add phrase to AL cond
jaehyun1ee Dec 6, 2023
fa8a74e
Merge branch 'main' into al3-vector
HoseongLee Dec 15, 2023
15db111
Merge branch 'main' into al
f52985 Dec 15, 2023
2908858
Fix infinite loop
f52985 Dec 15, 2023
34818ca
Rename, SIMD instructions (16/22)
702fbtngus Dec 15, 2023
d48e3f4
Add SIMD instruction shuffle, all_true, bitmask, narrow
HoseongLee Dec 17, 2023
00fa454
Add vector memory instructions
HoseongLee Dec 18, 2023
8628de4
Minor refactoring
HoseongLee Dec 19, 2023
2a3c15f
Implemented dot, extadd_pairwise
702fbtngus Dec 19, 2023
d16f28d
Minor renaming (veccount, vecunit)
702fbtngus Dec 19, 2023
dda2570
Minor renaming (lanecount -> lanesize)
702fbtngus Dec 19, 2023
8cb8513
Minor renaming
702fbtngus Dec 19, 2023
be629db
Remove unnecessary funtions & change unit x count to shape
HoseongLee Dec 19, 2023
9ab8f38
Add laneidx
HoseongLee Dec 19, 2023
0bc218d
Change function def of vishiftop and vcvtop
702fbtngus Dec 19, 2023
62ba266
Vector instruction validation
702fbtngus Jan 2, 2024
97ea741
Validation for vector memory instructions
HoseongLee Jan 2, 2024
d35561a
Handle IterPr for valid
ShinWonho Jan 2, 2024
3c9438c
Generalized shuffle and swizzle instructions
HoseongLee Jan 2, 2024
3c9634c
Validation almost done
702fbtngus Jan 2, 2024
d1efa1a
Merge branch 'al' into al3-vector
HoseongLee Jan 3, 2024
9d49f6e
Modified instructions-in.rst (execution)
702fbtngus Jan 3, 2024
cc98fc3
Added instructions to validation-in.rst
HoseongLee Jan 3, 2024
0ee8a15
Fix animation where |free(arg)| > 2, Sort tests
f52985 Jan 3, 2024
dd7bba7
Modular translation for premise
ShinWonho Jan 3, 2024
2bc13df
Handle IfI with IterPr
ShinWonho Jan 4, 2024
5e94d53
Added simd test cases for interpreter
HoseongLee Jan 5, 2024
6c47a93
Minor refactoring
ShinWonho Jan 5, 2024
ed2aaf2
Minor refactoring
ShinWonho Jan 5, 2024
a118561
Move hardcoded instructions to manual.ml
ShinWonho Jan 8, 2024
53d6aec
Add missing mli files under al
presenthee Jan 8, 2024
cc62033
Basics for Vector support in interpreter
HoseongLee Jan 8, 2024
1145bf3
Some refactoring
ShinWonho Jan 8, 2024
7d3fc56
Change signature of stringifier
ShinWonho Jan 8, 2024
2630563
Merge remote branch 'origin/al' into al
presenthee Jan 8, 2024
f9e3afa
Minor refactoring to AL
presenthee Jan 8, 2024
46db966
Temporary hack for iter cond
ShinWonho Jan 9, 2024
4c866da
Fix bug in stringifier
ShinWonho Jan 9, 2024
6a93ca7
Temporarily add IterC
ShinWonho Jan 9, 2024
f6217a6
Merge branch 'main' into al
f52985 Jan 10, 2024
50a5001
Fix bug in stringifier
ShinWonho Jan 10, 2024
903655a
Remove cond
ShinWonho Jan 10, 2024
74fe9ff
Refactor and prepare to merge into main
f52985 Jan 10, 2024
a245df9
al_of_instr and al_to_instr for SIMD instructions
702fbtngus Jan 11, 2024
f7dd5ee
Merge branch 'al' of https://github.com/Wasm-DSL/spectec into al
702fbtngus Jan 11, 2024
d2d7d11
Bug fix
702fbtngus Jan 11, 2024
07cb23f
Minor refactoring
ShinWonho Jan 11, 2024
12f89a4
Fix bug in render
ShinWonho Jan 11, 2024
493a283
Added numerics for vunop, vvunop and vvbinop
HoseongLee Jan 11, 2024
6e84974
numerics for vcvtop
702fbtngus Jan 11, 2024
eddfaab
Error fixed (swizzle in instructions-in.rst)
702fbtngus Jan 11, 2024
9d03125
Error fixed again (swizzle in instructions-in.rst)
702fbtngus Jan 11, 2024
d8ed9fc
Tail call optimization for AL interpreter
ShinWonho Jan 11, 2024
310d634
make testpromote
ShinWonho Jan 11, 2024
44c1663
Minor refactor
ShinWonho Jan 11, 2024
bda4a3d
Remove unnecesary env arguments
ShinWonho Jan 11, 2024
15242d5
Minor refactor
ShinWonho Jan 11, 2024
aae7364
Minor refactor
ShinWonho Jan 12, 2024
5ad5b7b
Minor refactor
ShinWonho Jan 12, 2024
39b2a03
Minor refactor
ShinWonho Jan 12, 2024
0475097
Fix typo
ShinWonho Jan 12, 2024
3ec803a
Revert "Minor refactor"
ShinWonho Jan 12, 2024
6cc10ae
Minor refactor
ShinWonho Jan 12, 2024
84fb87d
Remove case_v in construct
presenthee Jan 12, 2024
6920982
Fix test and typo
presenthee Jan 12, 2024
78350f9
Combined VLOAD intructions
HoseongLee Jan 12, 2024
3f9599c
Remove duplicated matches
presenthee Jan 12, 2024
76d756a
Add translation, construction, rendering for AL BoolE
jaehyun1ee Jan 15, 2024
51ec0e3
Add source as optional argument to constructor shorthands
jaehyun1ee Jan 15, 2024
80246a1
Translate source from IL to AL, except for expr2let
jaehyun1ee Jan 15, 2024
a690f4e
Fix constructor shorthand for AL BoolE
jaehyun1ee Jan 15, 2024
e8c2d67
Print source on interpreter failure
jaehyun1ee Jan 15, 2024
f058ce5
Implement eq-modulo-source for AL instr, expr, and path
jaehyun1ee Jan 15, 2024
5dfa7a5
Transpile source from AL to AL
jaehyun1ee Jan 15, 2024
b22d086
More translation of source from IL to AL
jaehyun1ee Jan 15, 2024
6aeff32
Added VLOAD & VSTORE to backend-interpreter / Added nan check for tes…
HoseongLee Jan 15, 2024
b944a09
Prevent i in `i^(i<N)` from being considered free
f52985 Jan 15, 2024
e64062b
Remove index from lhs
f52985 Jan 15, 2024
27a680a
Infer proper name for unified variables
f52985 Jan 16, 2024
564213b
Collect El syntax variant, function disply hints in renderer
jaehyun1ee Jan 16, 2024
27d705d
Added VCVTOP to backend-interpreter
702fbtngus Jan 16, 2024
f91ae69
Basic lookup for hints
jaehyun1ee Jan 16, 2024
222d7af
Add symbol as a copy of macro
jaehyun1ee Jan 16, 2024
f011a4a
Fixed bugs in numerics
HoseongLee Jan 16, 2024
61d0501
Better (recursive) lookup for hints
jaehyun1ee Jan 16, 2024
131d0f9
Infer case assertion
f52985 Jan 16, 2024
0930916
Added ExtendMul construct
HoseongLee Jan 17, 2024
35eeaab
Apply hint on Al renderer, leveraging the El renderer
jaehyun1ee Jan 17, 2024
6477860
Merge branch 'al-hint' into al
jaehyun1ee Jan 17, 2024
c2af493
Added dot
702fbtngus Jan 17, 2024
c92267f
Change `Shape(t, n)` into `t X n`, Remove ArrowE
f52985 Jan 17, 2024
be13447
Better rendering of plaintext inside inline math blocks
jaehyun1ee Jan 17, 2024
91ea8a2
Add wast runner
ShinWonho Jan 17, 2024
ac0dcef
Infer more case assertions
f52985 Jan 17, 2024
965f3a4
Fix bug when extracting keywords from EL in AL renderer
jaehyun1ee Jan 17, 2024
2342597
Reduce depth of manual algorithm for CALL_REF
f52985 Jan 17, 2024
bbfba55
Add Il2al directory
presenthee Jan 17, 2024
23fdded
Remove original files of Il2al
presenthee Jan 17, 2024
1c55371
Edit a comment
presenthee Jan 17, 2024
9bc80ec
Regard module instantiation as a target
ShinWonho Jan 17, 2024
6688cf2
Minor refactor
ShinWonho Jan 17, 2024
7c628d3
Changed vbinop and vcvtop for special cases
702fbtngus Jan 18, 2024
8e7a4e9
Minor refactor
ShinWonho Jan 18, 2024
94d0bd3
Minor refactor
ShinWonho Jan 18, 2024
bde6739
Add al_util.ml
ShinWonho Jan 18, 2024
687c825
Fix minor bugs
ShinWonho Jan 18, 2024
34a78b4
Minor changes
ShinWonho Jan 18, 2024
3c12898
Add builtin.ml
ShinWonho Jan 19, 2024
5b1036e
Add wat runner
ShinWonho Jan 19, 2024
692125f
Add minor comments
ShinWonho Jan 19, 2024
de8231d
Minor refacoring to algo_maps
presenthee Jan 19, 2024
40a3661
Remove unnecessary wrapper
ShinWonho Jan 19, 2024
128cae9
Address reviews
f52985 Jan 19, 2024
e08501d
Add wasm runner
ShinWonho Jan 19, 2024
e11b6d4
Add test for wasm/wat
ShinWonho Jan 19, 2024
90402e0
Fix c_vectype
f52985 Jan 19, 2024
260d29d
Refactor and add mli file for ds
presenthee Jan 21, 2024
d9910e8
Minor refactoring
presenthee Jan 21, 2024
a7f9fb6
Add mli files for numerics and manual
presenthee Jan 21, 2024
29adbbe
Change function name and indentation
presenthee Jan 21, 2024
e253969
Remove get_nth_context
presenthee Jan 22, 2024
e5dc29f
Minor change
ShinWonho Jan 22, 2024
b8e72d3
SIMD hints added, minor refactoring
702fbtngus Jan 22, 2024
7295436
Revert "Prevent i in `i^(i<N)` from being considered free"
f52985 Jan 22, 2024
2547c05
Always regard index in IterE as 1-d array
f52985 Jan 22, 2024
63a859d
Minor refactoring
presenthee Jan 22, 2024
e523afe
added 'V' prefix for vector instructions
702fbtngus Jan 22, 2024
1784741
Merge branch 'main' into al
f52985 Jan 22, 2024
23af89f
Remove space at EOL
f52985 Jan 22, 2024
fd922c4
Merge remote-tracking branch 'origin/al' into al
f52985 Jan 22, 2024
0fcac68
Use map instead of record
f52985 Jan 22, 2024
7b96f04
Fix premise to IterPr
f52985 Jan 22, 2024
bca74f4
Restore memop
f52985 Jan 22, 2024
68d428c
Add -i option for in-place splicing
f52985 Jan 23, 2024
3dc053d
Refactor packshape
f52985 Jan 23, 2024
55692ca
Remove structured_string
f52985 Jan 23, 2024
8522c70
Clean unnecessary calls from prose to splice and latex
jaehyun1ee Jan 24, 2024
8af6ac8
Minor change to render.mli
jaehyun1ee Jan 24, 2024
f9a0dbb
Address more comments
f52985 Jan 24, 2024
02c0584
Fix readme
f52985 Jan 24, 2024
f92b2b5
Fix compile error
f52985 Jan 24, 2024
66f0d16
Implement SIMD instructions for wasm-2.0
f52985 Jan 24, 2024
7ee64cf
Clone gc proposal's interpreter
f52985 Jan 24, 2024
bd3c800
Merge branch 'main' into al
f52985 Jan 24, 2024
e377312
Change validation error message for LetPr
f52985 Jan 24, 2024
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
95 changes: 45 additions & 50 deletions spectec/spec/wasm-3.0/1-syntax.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -253,30 +253,10 @@ var testop : testop_numtype
var relop : relop_numtype


syntax memarg hint(desc "memory argument") = {ALIGN u32, OFFSET u32}
syntax memop hint(desc "memory operator") = {ALIGN u32, OFFSET u32}

var marg : memarg
var mo : memop

syntax lanetype hint(desc "lane type") =
| packedtype | numtype
syntax lanesize hint(desc "lane size") = nat

var lnt : lanetype
var lns : lanesize
syntax shape hint(desc "shape") = lanetype X lanesize

var psl : nat
var psr : nat

syntax packshape =
| PACKSHAPE nat nat

var psh : packshape

syntax half = | LOW | HIGH
var hf : half

var sh : shape

syntax unopVVXX = | NOT
syntax binopVVXX = | AND | ANDNOT | OR | XOR
Expand Down Expand Up @@ -370,30 +350,41 @@ syntax instr/numeric hint(desc "numeric instruction") = ...
| CVTOP numtype cvtop numtype sx? hint(show %.%#_#%#_#%)
| ...

syntax lanetype hint(desc "lane type") = | packedtype | numtype
syntax lanesize hint(desc "lane size") = nat
syntax shape hint(desc "shape") = lanetype X lanesize
syntax half = | LOW | HIGH

var lnt : lanetype
var lns : lanesize
var sh : shape
var hf : half

syntax instr/vector hint(desc "vector instruction") = ...
702fbtngus marked this conversation as resolved.
Show resolved Hide resolved
| VVCONST vectype c_vectype hint(show %.CONST %)
| VVUNOP vectype unop_vvectype hint(show %.%)
| VVBINOP vectype binop_vvectype hint(show %.%)
| VVTERNOP vectype ternop_vvectype hint(show %.%)
| VVTESTOP vectype testop_vvectype hint(show %.%)
| SWIZZLE shape
| SHUFFLE shape laneidx*
| SPLAT shape hint(show %.SPLAT)
| EXTRACT_LANE shape sx? laneidx hint(show %.EXTRACT#_#LANE#_#% %)
| REPLACE_LANE shape laneidx hint(show %.REPLACE#_#LANE %)
| VUNOP shape unop_vectype
| VBINOP shape binop_vectype
| VRELOP shape relop_vectype
| VISHIFTOP shape shiftop_vectype
| ALL_TRUE shape hint(show %.ALL_TRUE)
| BITMASK shape
| NARROW shape shape sx
| VCVTOP shape cvtop_vectype half? shape sx? zero
| EXTMUL_HALF shape half shape sx
| DOT shape shape sx
| EXTADD_PAIRWISE shape shape sx
| VVCONST vectype c_vectype hint(show %.CONST %)
| VVUNOP vectype unop_vvectype hint(show %.%)
| VVBINOP vectype binop_vvectype hint(show %.%)
| VVTERNOP vectype ternop_vvectype hint(show %.%)
| VVTESTOP vectype testop_vvectype hint(show %.%)
| VSWIZZLE shape hint(show %.VSWIZZLE)
| VSHUFFLE shape laneidx* hint(show %.VSHUFFLE %)
| VSPLAT shape hint(show %.VSPLAT)
| VEXTRACT_LANE shape sx? laneidx hint(show %.VEXTRACT#_#LANE#_#% %)
| VREPLACE_LANE shape laneidx hint(show %.VREPLACE#_#LANE %)
| VUNOP shape unop_vectype hint(show %.%)
| VBINOP shape binop_vectype hint(show %.%)
| VRELOP shape relop_vectype hint(show %.%)
| VISHIFTOP shape shiftop_vectype hint(show %.%)
| VALL_TRUE shape hint(show %.VALL_TRUE)
| VBITMASK shape hint(show %.VBITMASK)
| VNARROW shape shape sx hint(show %.VNARROW#_#%#_#%)
| VCVTOP shape cvtop_vectype half? shape sx? zero hint(show %.%#_#%#_#%#_#%) hint(show %.%#_#%#_#%#_#%) hint(show %.%#_#%#_#%#_#%#_#%)
| VEXTMUL shape half shape sx hint(show %.VEXTMUL#_#%#_#%#_#%)
| VDOT shape shape sx hint(show %.VDOT#_#%#_#%)
| VEXTADD_PAIRWISE shape shape sx hint(show %.VEXTADD_PAIRWISE#_#%#_#%)
| ...


syntax instr/reference hint(desc "reference instruction") = ...
| REF.NULL heaptype
| REF.I31
Expand Down Expand Up @@ -449,8 +440,12 @@ syntax instr/table hint(desc "table instruction") = ...
| ELEM.DROP elemidx
| ...


syntax packshape = nat X nat
syntax vloadop =
| LOAD memarg | SHAPE packshape sx memarg | SPLAT nat memarg | ZERO nat memarg
| SHAPE packshape sx hint(show %#_#%)
| SPLAT nat hint(show %#_#SPLAT)
| ZERO nat hint(show %#_#ZERO)

syntax instr/memory hint(desc "memory instruction") = ...
| MEMORY.SIZE memidx
Expand All @@ -459,12 +454,12 @@ syntax instr/memory hint(desc "memory instruction") = ...
| MEMORY.COPY memidx memidx
| MEMORY.INIT memidx dataidx
| DATA.DROP dataidx
| LOAD numtype (n _ sx)? memidx memarg hint(show %.LOAD % %) hint(show %.LOAD#% % %)
| STORE numtype n? memidx memarg hint(show %.STORE % %) hint(show %.STORE#% % %)
| VLOAD vloadop memidx
| VLOAD_LANE n memidx memarg laneidx
| VSTORE memidx memarg
| VSTORE_LANE n memidx memarg laneidx
| LOAD numtype (n _ sx)? memidx memop hint(show %.LOAD % %) hint(show %.LOAD#% % %)
| STORE numtype n? memidx memop hint(show %.STORE % %) hint(show %.STORE#% % %)
| VLOAD vloadop? memidx memop hint(show V128.LOAD % %) hint(show V128.LOAD#% % %)
| VLOAD_LANE n memidx memop laneidx hint(show V128.LOAD#%#_#LANE % % %)
| VSTORE memidx memop hint(show V128.STORE % %)
| VSTORE_LANE n memidx memop laneidx hint(show V128.STORE#%#_#LANE % % %)

syntax expr hint(desc "expression") =
instr*
Expand Down
4 changes: 2 additions & 2 deletions spectec/spec/wasm-3.0/2-syntax-aux.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,5 @@ def $memsxt(externtype et*) = $memsxt(et*) -- otherwise

;; Shorthands for Instructions

def $memarg0 : memarg hint(show )
def $memarg0 = {ALIGN 0, OFFSET 0}
def $memop0 : memop hint(show )
def $memop0 = {ALIGN 0, OFFSET 0}
50 changes: 25 additions & 25 deletions spectec/spec/wasm-3.0/6-typing.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -772,22 +772,22 @@ rule Instr_ok/vvternop:
rule Instr_ok/vvtestop:
C |- VVTESTOP vt vvtestop : V128 -> I32

rule Instr_ok/swizzle:
C |- SWIZZLE sh : V128 V128 -> V128
rule Instr_ok/vswizzle:
C |- VSWIZZLE sh : V128 V128 -> V128

rule Instr_ok/shuffle:
C |- SHUFFLE sh laneidx* : V128 V128 -> V128
rule Instr_ok/vshuffle:
C |- VSHUFFLE sh laneidx* : V128 V128 -> V128
-- (if $(laneidx<$dim(sh) * 2))*

rule Instr_ok/splat:
C |- SPLAT sh : $unpacked(sh) -> V128
rule Instr_ok/vsplat:
C |- VSPLAT sh : $unpacked(sh) -> V128

rule Instr_ok/extract_lane:
C |- EXTRACT_LANE sh sx? laneidx : V128 -> $unpacked(sh)
rule Instr_ok/vextract_lane:
C |- VEXTRACT_LANE sh sx? laneidx : V128 -> $unpacked(sh)
-- if laneidx < $dim(sh)

rule Instr_ok/replace_lane:
C |- REPLACE_LANE sh laneidx : V128 $unpacked(sh) -> V128
rule Instr_ok/vreplace_lane:
C |- VREPLACE_LANE sh laneidx : V128 $unpacked(sh) -> V128
-- if laneidx < $dim(sh)

rule Instr_ok/vunop:
Expand All @@ -803,25 +803,25 @@ rule Instr_ok/vishiftop:
C |- VISHIFTOP sh vishiftop : V128 V128 -> V128

rule Instr_ok/vtestop:
C |- ALL_TRUE sh : V128 -> I32
C |- VALL_TRUE sh : V128 -> I32

rule Instr_ok/vcvtop:
C |- VCVTOP sh vcvtop hf? sh sx? zero : V128 -> V128

rule Instr_ok/narrow:
C |- NARROW sh sh sx : V128 V128 -> V128
rule Instr_ok/vnarrow:
C |- VNARROW sh sh sx : V128 V128 -> V128

rule Instr_ok/bitmask:
C |- BITMASK sh : V128 -> I32
rule Instr_ok/vbitmask:
C |- VBITMASK sh : V128 -> I32

rule Instr_ok/dot:
C |- DOT sh sh sx : V128 V128 -> V128
rule Instr_ok/vdot:
C |- VDOT sh sh sx : V128 V128 -> V128

rule Instr_ok/extmul_half:
C |- EXTMUL_HALF sh half sh sx : V128 V128 -> V128
rule Instr_ok/vextmul:
C |- VEXTMUL sh half sh sx : V128 V128 -> V128

rule Instr_ok/extadd_pairwise:
C |- EXTADD_PAIRWISE sh sh sx : V128 -> V128
rule Instr_ok/vextadd_pairwise:
C |- VEXTADD_PAIRWISE sh sh sx : V128 -> V128


;; Structure instructions
Expand Down Expand Up @@ -1025,17 +1025,17 @@ rule Instr_ok/store:
-- if n? = eps \/ nt = inn

rule Instr_ok/vload:
C |- VLOAD (SHAPE (PACKSHAPE psl psr) sx {ALIGN n_A, OFFSET n_O}) x : I32 -> V128
C |- VLOAD (SHAPE (M X N) sx) x {ALIGN n_A, OFFSET n_O} : I32 -> V128
-- if C.MEM[x] = mt
-- if $(2^(n_A) <= psl/8 * psr)
-- if $(2^(n_A) <= M/8 * N)

rule Instr_ok/vload-splat:
C |- VLOAD (SPLAT n {ALIGN n_A, OFFSET n_O}) x : I32 -> V128
C |- VLOAD (SPLAT n) x {ALIGN n_A, OFFSET n_O} : I32 -> V128
-- if C.MEM[x] = mt
-- if $(2^(n_A) <= n/8)

rule Instr_ok/vload-zero:
C |- VLOAD (ZERO n {ALIGN n_A, OFFSET n_O}) x : I32 -> V128
C |- VLOAD (ZERO n) x {ALIGN n_A, OFFSET n_O} : I32 -> V128
-- if C.MEM[x] = mt
-- if $(2^(n_A) < n/8)

Expand Down
Loading
Loading