@@ -95,6 +95,7 @@ let encode m =
95
95
| I64Type -> vs7 (- 0x02 )
96
96
| F32Type -> vs7 (- 0x03 )
97
97
| F64Type -> vs7 (- 0x04 )
98
+ | V128Type -> failwith " TODO v128"
98
99
99
100
let elem_type = function
100
101
| FuncRefType -> vs7 (- 0x10 )
@@ -195,6 +196,10 @@ let encode m =
195
196
op 0x35 ; memop mo
196
197
| Load {ty = F32Type | F64Type ; sz = Some _ ; _} ->
197
198
assert false
199
+ | Load {ty = V128Type ; sz = None ; _} ->
200
+ failwith " TODO v128"
201
+ | Load {ty = V128Type ; sz = Some _ ; _} ->
202
+ failwith " TODO v128"
198
203
199
204
| Store ({ty = I32Type ; sz = None ; _} as mo ) -> op 0x36 ; memop mo
200
205
| Store ({ty = I64Type ; sz = None ; _} as mo ) -> op 0x37 ; memop mo
@@ -207,6 +212,10 @@ let encode m =
207
212
| Store ({ty = I64Type ; sz = Some Pack16 ; _} as mo ) -> op 0x3d ; memop mo
208
213
| Store ({ty = I64Type ; sz = Some Pack32 ; _} as mo ) -> op 0x3e ; memop mo
209
214
| Store {ty = F32Type | F64Type ; sz = Some _ ; _} -> assert false
215
+ | Store {ty = V128Type ; sz = None ; _} ->
216
+ failwith " TODO v128"
217
+ | Store {ty = V128Type ; sz = Some _ ; _} ->
218
+ failwith " TODO v128"
210
219
211
220
| MemorySize -> op 0x3f ; u8 0x00
212
221
| MemoryGrow -> op 0x40 ; u8 0x00
@@ -215,11 +224,14 @@ let encode m =
215
224
| Const {it = I64 c ; _} -> op 0x42 ; vs64 c
216
225
| Const {it = F32 c ; _} -> op 0x43 ; f32 c
217
226
| Const {it = F64 c ; _} -> op 0x44 ; f64 c
227
+ | Const {it = V128 c ; _} ->
228
+ failwith " TODO v128"
218
229
219
230
| Test (I32 I32Op. Eqz) -> op 0x45
220
231
| Test (I64 I64Op. Eqz) -> op 0x50
221
232
| Test (F32 _ ) -> assert false
222
233
| Test (F64 _ ) -> assert false
234
+ | Test (V128 _ ) -> assert false
223
235
224
236
| Compare (I32 I32Op. Eq) -> op 0x46
225
237
| Compare (I32 I32Op. Ne) -> op 0x47
@@ -256,6 +268,7 @@ let encode m =
256
268
| Compare (F64 F64Op. Gt) -> op 0x64
257
269
| Compare (F64 F64Op. Le) -> op 0x65
258
270
| Compare (F64 F64Op. Ge) -> op 0x66
271
+ | Compare (V128 _ ) -> failwith " TODO v128"
259
272
260
273
| Unary (I32 I32Op. Clz) -> op 0x67
261
274
| Unary (I32 I32Op. Ctz) -> op 0x68
@@ -280,6 +293,7 @@ let encode m =
280
293
| Unary (F64 F64Op. Trunc) -> op 0x9d
281
294
| Unary (F64 F64Op. Nearest) -> op 0x9e
282
295
| Unary (F64 F64Op. Sqrt) -> op 0x9f
296
+ | Unary (V128 _ ) -> failwith " TODO v128"
283
297
284
298
| Binary (I32 I32Op. Add) -> op 0x6a
285
299
| Binary (I32 I32Op. Sub) -> op 0x6b
@@ -328,6 +342,7 @@ let encode m =
328
342
| Binary (F64 F64Op. Min) -> op 0xa4
329
343
| Binary (F64 F64Op. Max) -> op 0xa5
330
344
| Binary (F64 F64Op. CopySign) -> op 0xa6
345
+ | Binary (V128 _ ) -> failwith " TODO v128"
331
346
332
347
| Convert (I32 I32Op. ExtendSI32) -> assert false
333
348
| Convert (I32 I32Op. ExtendUI32) -> assert false
@@ -362,6 +377,7 @@ let encode m =
362
377
| Convert (F64 F64Op. PromoteF32) -> op 0xbb
363
378
| Convert (F64 F64Op. DemoteF64) -> assert false
364
379
| Convert (F64 F64Op. ReinterpretInt) -> op 0xbf
380
+ | Convert (V128 _ ) -> failwith " TODO v128"
365
381
366
382
let const c =
367
383
list instr c.it; end_ ()
0 commit comments