Skip to content

Commit 844973c

Browse files
committed
Fix merge bullshit again
1 parent b0d907c commit 844973c

File tree

8 files changed

+112
-111
lines changed

8 files changed

+112
-111
lines changed

interpreter/binary/encode.ml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ struct
246246
op 0x3a; memop x mo
247247
| Store (x, ({ty = I32Type; pack = Some Pack16; _} as mo)) ->
248248
op 0x3b; memop x mo
249-
| Store (x, {ty = I32Type; pack = Some (Pack32 | Pack64); _}) ->
249+
| Store (x, {ty = I32Type; pack = Some Pack32; _}) ->
250250
error e.at "illegal instruction i32.store32"
251251
| Store (x, ({ty = I64Type; pack = Some Pack8; _} as mo)) ->
252252
op 0x3c; memop x mo
@@ -285,35 +285,36 @@ struct
285285
vecop 0x5cl; memop x mo
286286
| VecLoad (x, ({ty = V128Type; pack = Some (Pack64, ExtZero); _} as mo)) ->
287287
vecop 0x5dl; memop x mo
288-
error e.at "illegal instruction v128.loadNxM_<ext>"
288+
| VecLoad _ ->
289+
error e.at "illegal instruction v128.loadNxM_x"
289290

290291
| VecLoadLane (x, ({ty = V128Type; pack = Pack8; _} as mo), i) ->
291-
vecop 0x54l; memop x mo; u8 i;
292+
vecop 0x54l; memop x mo; byte i;
292293
| VecLoadLane (x, ({ty = V128Type; pack = Pack16; _} as mo), i) ->
293-
vecop 0x55l; memop x mo; u8 i;
294+
vecop 0x55l; memop x mo; byte i;
294295
| VecLoadLane (x, ({ty = V128Type; pack = Pack32; _} as mo), i) ->
295-
vecop 0x56l; memop x mo; u8 i;
296+
vecop 0x56l; memop x mo; byte i;
296297
| VecLoadLane (x, ({ty = V128Type; pack = Pack64; _} as mo), i) ->
297-
vecop 0x57l; memop x mo; u8 i;
298+
vecop 0x57l; memop x mo; byte i;
298299

299300
| VecStore (x, ({ty = V128Type; _} as mo)) ->
300301
vecop 0x0bl; memop x mo
301302

302303
| VecStoreLane (x, ({ty = V128Type; pack = Pack8; _} as mo), i) ->
303-
vecop 0x58l; memop x mo; u8 i;
304+
vecop 0x58l; memop x mo; byte i;
304305
| VecStoreLane (x, ({ty = V128Type; pack = Pack16; _} as mo), i) ->
305-
vecop 0x59l; memop x mo; u8 i;
306+
vecop 0x59l; memop x mo; byte i;
306307
| VecStoreLane (x, ({ty = V128Type; pack = Pack32; _} as mo), i) ->
307-
vecop 0x5al; memop x mo; u8 i;
308+
vecop 0x5al; memop x mo; byte i;
308309
| VecStoreLane (x, ({ty = V128Type; pack = Pack64; _} as mo), i) ->
309-
vecop 0x5bl; memop x mo; u8 i;
310+
vecop 0x5bl; memop x mo; byte i;
310311

311312
| MemorySize x -> op 0x3f; var x
312313
| MemoryGrow x -> op 0x40; var x
313-
| MemoryFill x -> op 0xfc; vu32 0x0bl; var x
314-
| MemoryCopy (x, y) -> op 0xfc; vu32 0x0al; var x; var y
315-
| MemoryInit (x, y) -> op 0xfc; vu32 0x08l; var y; var x
316-
| DataDrop x -> op 0xfc; vu32 0x09l; var x
314+
| MemoryFill x -> op 0xfc; u32 0x0bl; var x
315+
| MemoryCopy (x, y) -> op 0xfc; u32 0x0al; var x; var y
316+
| MemoryInit (x, y) -> op 0xfc; u32 0x08l; var y; var x
317+
| DataDrop x -> op 0xfc; u32 0x09l; var x
317318

318319
| RefNull t -> op 0xd0; ref_type t
319320
| RefIsNull -> op 0xd1

interpreter/exec/eval.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ let rec step (c : config) : config =
341341
vs', []
342342
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at]);
343343

344-
| LoadVec (x, {offset; ty; pack; _}), Num (I32 i) :: vs' ->
344+
| VecLoad (x, {offset; ty; pack; _}), Num (I32 i) :: vs' ->
345345
let mem = memory frame.inst x in
346346
let addr = I64_convert.extend_i32_u i in
347347
(try
@@ -353,15 +353,15 @@ let rec step (c : config) : config =
353353
in Vec v :: vs', []
354354
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at])
355355

356-
| StoreVec (x, {offset; _}), Vec v :: Num (I32 i) :: vs' ->
356+
| VecStore (x, {offset; _}), Vec v :: Num (I32 i) :: vs' ->
357357
let mem = memory frame.inst x in
358358
let addr = I64_convert.extend_i32_u i in
359359
(try
360360
Memory.store_vec mem addr offset v;
361361
vs', []
362362
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at]);
363363

364-
| LoadVecLane (x, {offset; ty; pack; _}, j), Vec (V128 v) :: Num (I32 i) :: vs' ->
364+
| VecLoadLane (x, {offset; ty; pack; _}, j), Vec (V128 v) :: Num (I32 i) :: vs' ->
365365
let mem = memory frame.inst x in
366366
let addr = I64_convert.extend_i32_u i in
367367
(try
@@ -382,7 +382,7 @@ let rec step (c : config) : config =
382382
in Vec (V128 v) :: vs', []
383383
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at])
384384

385-
| StoreVecLane (x, {offset; ty; pack; _}, j), Vec (V128 v) :: Num (I32 i) :: vs' ->
385+
| VecStoreLane (x, {offset; ty; pack; _}, j), Vec (V128 v) :: Num (I32 i) :: vs' ->
386386
let mem = memory frame.inst x in
387387
let addr = I64_convert.extend_i32_u i in
388388
(try

interpreter/syntax/ast.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ and instr' =
163163
| TableInit of var * var (* initialize table range from segment *)
164164
| ElemDrop of var (* drop passive element segment *)
165165
| Load of var * loadop (* read memory at address *)
166-
| LoadVec of var * vec_loadop (* read memory at address *)
167-
| LoadVecLane of var * vec_laneop * int (* read single lane at address *)
168166
| Store of var * storeop (* write memory at address *)
169-
| StoreVec of var * vec_storeop (* write memory at address *)
170-
| StoreVecLane of var * vec_laneop * int (* write single lane to address *)
167+
| VecLoad of var * vec_loadop (* read memory at address *)
168+
| VecStore of var * vec_storeop (* write memory at address *)
169+
| VecLoadLane of var * vec_laneop * int (* read single lane at address *)
170+
| VecStoreLane of var * vec_laneop * int (* write single lane to address *)
171171
| MemorySize of var (* size of memory *)
172172
| MemoryGrow of var (* grow memory *)
173173
| MemoryFill of var (* fill memory range with value *)

interpreter/syntax/free.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ let rec instr (e : instr) =
8383
| TableCopy (x, y) -> tables (var x) ++ tables (var y)
8484
| TableInit (x, y) -> tables (var x) ++ elems (var y)
8585
| ElemDrop x -> elems (var x)
86-
| Load (x, _) | Store (x, _) | LoadVec (x, _) | StoreVec (x, _)
87-
| LoadVecLane (x, _, _) | StoreVecLane (x, _, _)
86+
| Load (x, _) | Store (x, _) | VecLoad (x, _) | VecStore (x, _)
87+
| VecLoadLane (x, _, _) | VecStoreLane (x, _, _)
8888
| MemorySize x | MemoryGrow x | MemoryFill x ->
8989
memories (var x)
9090
| MemoryCopy (x, y) -> memories (var x) ++ memories (var y)

interpreter/syntax/operators.ml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,50 +92,50 @@ let i64_store32 x align offset =
9292
Store (x, {ty = I64Type; align; offset; pack = Some Pack32})
9393

9494
let v128_load x align offset =
95-
LoadVec (x, {ty = V128Type; align; offset; pack = None})
95+
VecLoad (x, {ty = V128Type; align; offset; pack = None})
9696
let v128_load8x8_s x align offset =
97-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack8x8, SX))})
97+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack8x8, SX))})
9898
let v128_load8x8_u x align offset =
99-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack8x8, ZX))})
99+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack8x8, ZX))})
100100
let v128_load16x4_s x align offset =
101-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack16x4, SX))})
101+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack16x4, SX))})
102102
let v128_load16x4_u x align offset =
103-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack16x4, ZX))})
103+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack16x4, ZX))})
104104
let v128_load32x2_s x align offset =
105-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack32x2, SX))})
105+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack32x2, SX))})
106106
let v128_load32x2_u x align offset =
107-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack32x2, ZX))})
107+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtLane (Pack32x2, ZX))})
108108
let v128_load8_splat x align offset =
109-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack8, ExtSplat)})
109+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack8, ExtSplat)})
110110
let v128_load16_splat x align offset =
111-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack16, ExtSplat)})
111+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack16, ExtSplat)})
112112
let v128_load32_splat x align offset =
113-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack32, ExtSplat)})
113+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack32, ExtSplat)})
114114
let v128_load64_splat x align offset =
115-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtSplat)})
115+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtSplat)})
116116
let v128_load32_zero x align offset =
117-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack32, ExtZero)})
117+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack32, ExtZero)})
118118
let v128_load64_zero x align offset =
119-
LoadVec (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtZero)})
119+
VecLoad (x, {ty = V128Type; align; offset; pack = Some (Pack64, ExtZero)})
120120
let v128_load8_lane x align offset i =
121-
LoadVecLane (x, {ty = V128Type; align; offset; pack = Pack8}, i)
121+
VecLoadLane (x, {ty = V128Type; align; offset; pack = Pack8}, i)
122122
let v128_load16_lane x align offset i =
123-
LoadVecLane (x, {ty = V128Type; align; offset; pack = Pack16}, i)
123+
VecLoadLane (x, {ty = V128Type; align; offset; pack = Pack16}, i)
124124
let v128_load32_lane x align offset i =
125-
LoadVecLane (x, {ty = V128Type; align; offset; pack = Pack32}, i)
125+
VecLoadLane (x, {ty = V128Type; align; offset; pack = Pack32}, i)
126126
let v128_load64_lane x align offset i =
127-
LoadVecLane (x, {ty = V128Type; align; offset; pack = Pack64}, i)
127+
VecLoadLane (x, {ty = V128Type; align; offset; pack = Pack64}, i)
128128

129129
let v128_store x align offset =
130-
StoreVec (x, {ty = V128Type; align; offset; pack = ()})
130+
VecStore (x, {ty = V128Type; align; offset; pack = ()})
131131
let v128_store8_lane x align offset i =
132-
StoreVecLane (x, {ty = V128Type; align; offset; pack = Pack8}, i)
132+
VecStoreLane (x, {ty = V128Type; align; offset; pack = Pack8}, i)
133133
let v128_store16_lane x align offset i =
134-
StoreVecLane (x, {ty = V128Type; align; offset; pack = Pack16}, i)
134+
VecStoreLane (x, {ty = V128Type; align; offset; pack = Pack16}, i)
135135
let v128_store32_lane x align offset i =
136-
StoreVecLane (x, {ty = V128Type; align; offset; pack = Pack32}, i)
136+
VecStoreLane (x, {ty = V128Type; align; offset; pack = Pack32}, i)
137137
let v128_store64_lane x align offset i =
138-
StoreVecLane (x, {ty = V128Type; align; offset; pack = Pack64}, i)
138+
VecStoreLane (x, {ty = V128Type; align; offset; pack = Pack64}, i)
139139

140140
let memory_size x = MemorySize x
141141
let memory_grow x = MemoryGrow x

interpreter/text/arrange.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,11 @@ let rec instr e =
467467
| TableInit (x, y) -> "table.init " ^ var x ^ " " ^ var y, []
468468
| ElemDrop x -> "elem.drop " ^ var x, []
469469
| Load (x, op) -> loadop x op, []
470-
| LoadVec (x, op) -> vec_loadop x op, []
471-
| LoadVecLane (x, op, i) -> vec_laneop "load" x op i, []
472470
| Store (x, op) -> storeop x op, []
473-
| StoreVec (x, op) -> vec_storeop x op, []
474-
| StoreVecLane (x, op, i) -> vec_laneop "store" x op i, []
471+
| VecLoad (x, op) -> vec_loadop x op, []
472+
| VecStore (x, op) -> vec_storeop x op, []
473+
| VecLoadLane (x, op, i) -> vec_laneop "load" x op i, []
474+
| VecStoreLane (x, op, i) -> vec_laneop "store" x op i, []
475475
| MemorySize x -> "memory.size " ^ var x, []
476476
| MemoryGrow x -> "memory.grow " ^ var x, []
477477
| MemoryFill x -> "memory.fill " ^ var x, []

interpreter/text/lexer.mll

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -191,68 +191,68 @@ rule token = parse
191191
| "memory.init" -> MEMORY_INIT
192192
| "data.drop" -> DATA_DROP
193193

194-
| "i32.load" -> LOAD (fun a o -> i32_load (opt a 2) o)
195-
| "i64.load" -> LOAD (fun a o -> i64_load (opt a 3) o)
196-
| "f32.load" -> LOAD (fun a o -> f32_load (opt a 2) o)
197-
| "f64.load" -> LOAD (fun a o -> f64_load (opt a 3) o)
198-
| "i32.store" -> STORE (fun a o -> i32_store (opt a 2) o)
199-
| "i64.store" -> STORE (fun a o -> i64_store (opt a 3) o)
200-
| "f32.store" -> STORE (fun a o -> f32_store (opt a 2) o)
201-
| "f64.store" -> STORE (fun a o -> f64_store (opt a 3) o)
202-
203-
| "i32.load8_u" -> LOAD (fun a o -> i32_load8_u (opt a 0) o)
204-
| "i32.load8_s" -> LOAD (fun a o -> i32_load8_s (opt a 0) o)
205-
| "i32.load16_u" -> LOAD (fun a o -> i32_load16_u (opt a 1) o)
206-
| "i32.load16_s" -> LOAD (fun a o -> i32_load16_s (opt a 1) o)
207-
| "i64.load8_u" -> LOAD (fun a o -> i64_load8_u (opt a 0) o)
208-
| "i64.load8_s" -> LOAD (fun a o -> i64_load8_s (opt a 0) o)
209-
| "i64.load16_u" -> LOAD (fun a o -> i64_load16_u (opt a 1) o)
210-
| "i64.load16_s" -> LOAD (fun a o -> i64_load16_s (opt a 1) o)
211-
| "i64.load32_u" -> LOAD (fun a o -> i64_load32_u (opt a 2) o)
212-
| "i64.load32_s" -> LOAD (fun a o -> i64_load32_s (opt a 2) o)
213-
214-
| "i32.store8" -> LOAD (fun a o -> i32_store8 (opt a 0) o)
215-
| "i32.store16" -> LOAD (fun a o -> i32_store16 (opt a 1) o)
216-
| "i64.store8" -> LOAD (fun a o -> i64_store8 (opt a 0) o)
217-
| "i64.store16" -> LOAD (fun a o -> i64_store16 (opt a 1) o)
218-
| "i64.store32" -> LOAD (fun a o -> i64_store32 (opt a 2) o)
219-
220-
| "v128.load" -> VEC_LOAD (fun a o -> v128_load (opt a 4) o)
221-
| "v128.store" -> VEC_STORE (fun a o -> v128_store (opt a 4) o)
222-
| "v128.load8x8_u" -> VEC_LOAD (fun a o -> v128_load8x8_u (opt a 3) o)
223-
| "v128.load8x8_s" -> VEC_LOAD (fun a o -> v128_load8x8_s (opt a 3) o)
224-
| "v128.load16x4_u" -> VEC_LOAD (fun a o -> v128_load16x4_u (opt a 3) o)
225-
| "v128.load16x4_s" -> VEC_LOAD (fun a o -> v128_load16x4_s (opt a 3) o)
226-
| "v128.load32x2_u" -> VEC_LOAD (fun a o -> v128_load32x2_u (opt a 3) o)
227-
| "v128.load32x2_s" -> VEC_LOAD (fun a o -> v128_load32x2_s (opt a 3) o)
194+
| "i32.load" -> LOAD (fun x a o -> i32_load x (opt a 2) o)
195+
| "i64.load" -> LOAD (fun x a o -> i64_load x (opt a 3) o)
196+
| "f32.load" -> LOAD (fun x a o -> f32_load x (opt a 2) o)
197+
| "f64.load" -> LOAD (fun x a o -> f64_load x (opt a 3) o)
198+
| "i32.store" -> STORE (fun x a o -> i32_store x (opt a 2) o)
199+
| "i64.store" -> STORE (fun x a o -> i64_store x (opt a 3) o)
200+
| "f32.store" -> STORE (fun x a o -> f32_store x (opt a 2) o)
201+
| "f64.store" -> STORE (fun x a o -> f64_store x (opt a 3) o)
202+
203+
| "i32.load8_u" -> LOAD (fun x a o -> i32_load8_u x (opt a 0) o)
204+
| "i32.load8_s" -> LOAD (fun x a o -> i32_load8_s x (opt a 0) o)
205+
| "i32.load16_u" -> LOAD (fun x a o -> i32_load16_u x (opt a 1) o)
206+
| "i32.load16_s" -> LOAD (fun x a o -> i32_load16_s x (opt a 1) o)
207+
| "i64.load8_u" -> LOAD (fun x a o -> i64_load8_u x (opt a 0) o)
208+
| "i64.load8_s" -> LOAD (fun x a o -> i64_load8_s x (opt a 0) o)
209+
| "i64.load16_u" -> LOAD (fun x a o -> i64_load16_u x (opt a 1) o)
210+
| "i64.load16_s" -> LOAD (fun x a o -> i64_load16_s x (opt a 1) o)
211+
| "i64.load32_u" -> LOAD (fun x a o -> i64_load32_u x (opt a 2) o)
212+
| "i64.load32_s" -> LOAD (fun x a o -> i64_load32_s x (opt a 2) o)
213+
214+
| "i32.store8" -> LOAD (fun x a o -> i32_store8 x (opt a 0) o)
215+
| "i32.store16" -> LOAD (fun x a o -> i32_store16 x (opt a 1) o)
216+
| "i64.store8" -> LOAD (fun x a o -> i64_store8 x (opt a 0) o)
217+
| "i64.store16" -> LOAD (fun x a o -> i64_store16 x (opt a 1) o)
218+
| "i64.store32" -> LOAD (fun x a o -> i64_store32 x (opt a 2) o)
219+
220+
| "v128.load" -> VEC_LOAD (fun x a o -> v128_load x (opt a 4) o)
221+
| "v128.store" -> VEC_STORE (fun x a o -> v128_store x (opt a 4) o)
222+
| "v128.load8x8_u" -> VEC_LOAD (fun x a o -> v128_load8x8_u x (opt a 3) o)
223+
| "v128.load8x8_s" -> VEC_LOAD (fun x a o -> v128_load8x8_s x (opt a 3) o)
224+
| "v128.load16x4_u" -> VEC_LOAD (fun x a o -> v128_load16x4_u x (opt a 3) o)
225+
| "v128.load16x4_s" -> VEC_LOAD (fun x a o -> v128_load16x4_s x (opt a 3) o)
226+
| "v128.load32x2_u" -> VEC_LOAD (fun x a o -> v128_load32x2_u x (opt a 3) o)
227+
| "v128.load32x2_s" -> VEC_LOAD (fun x a o -> v128_load32x2_s x (opt a 3) o)
228228
| "v128.load8_splat" ->
229-
VEC_LOAD (fun a o -> v128_load8_splat (opt a 0) o)
229+
VEC_LOAD (fun x a o -> v128_load8_splat x (opt a 0) o)
230230
| "v128.load16_splat" ->
231-
VEC_LOAD (fun a o -> v128_load16_splat (opt a 1) o)
231+
VEC_LOAD (fun x a o -> v128_load16_splat x (opt a 1) o)
232232
| "v128.load32_splat" ->
233-
VEC_LOAD (fun a o -> v128_load32_splat (opt a 2) o)
233+
VEC_LOAD (fun x a o -> v128_load32_splat x (opt a 2) o)
234234
| "v128.load64_splat" ->
235-
VEC_LOAD (fun a o -> v128_load64_splat (opt a 3) o)
235+
VEC_LOAD (fun x a o -> v128_load64_splat x (opt a 3) o)
236236
| "v128.load32_zero" ->
237-
VEC_LOAD (fun a o -> v128_load32_zero (opt a 2) o)
237+
VEC_LOAD (fun x a o -> v128_load32_zero x (opt a 2) o)
238238
| "v128.load64_zero" ->
239-
VEC_LOAD (fun a o -> v128_load64_zero (opt a 3) o)
239+
VEC_LOAD (fun x a o -> v128_load64_zero x (opt a 3) o)
240240
| "v128.load8_lane" ->
241-
VEC_LOAD_LANE (fun a o i -> v128_load8_lane (opt a 0) o i)
241+
VEC_LOAD_LANE (fun x a o i -> v128_load8_lane x (opt a 0) o i)
242242
| "v128.load16_lane" ->
243-
VEC_LOAD_LANE (fun a o i -> v128_load16_lane (opt a 1) o i)
243+
VEC_LOAD_LANE (fun x a o i -> v128_load16_lane x (opt a 1) o i)
244244
| "v128.load32_lane" ->
245-
VEC_LOAD_LANE (fun a o i -> v128_load32_lane (opt a 2) o i)
245+
VEC_LOAD_LANE (fun x a o i -> v128_load32_lane x (opt a 2) o i)
246246
| "v128.load64_lane" ->
247-
VEC_LOAD_LANE (fun a o i -> v128_load64_lane (opt a 3) o i)
247+
VEC_LOAD_LANE (fun x a o i -> v128_load64_lane x (opt a 3) o i)
248248
| "v128.store8_lane" ->
249-
VEC_STORE_LANE (fun a o i -> v128_store8_lane (opt a 0) o i)
249+
VEC_STORE_LANE (fun x a o i -> v128_store8_lane x (opt a 0) o i)
250250
| "v128.store16_lane" ->
251-
VEC_STORE_LANE (fun a o i -> v128_store16_lane (opt a 1) o i)
251+
VEC_STORE_LANE (fun x a o i -> v128_store16_lane x (opt a 1) o i)
252252
| "v128.store32_lane" ->
253-
VEC_STORE_LANE (fun a o i -> v128_store32_lane (opt a 2) o i)
253+
VEC_STORE_LANE (fun x a o i -> v128_store32_lane x (opt a 2) o i)
254254
| "v128.store64_lane" ->
255-
VEC_STORE_LANE (fun a o i -> v128_store64_lane (opt a 3) o i)
255+
VEC_STORE_LANE (fun x a o i -> v128_store64_lane x (opt a 3) o i)
256256

257257
| "i32.const" ->
258258
CONST (fun s ->

interpreter/valid/valid.ml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -357,29 +357,29 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : op_type
357357
check_memop c memop num_size (Lib.Option.map fst) e.at;
358358
[NumType I32Type] --> [NumType memop.ty]
359359

360-
| LoadVec (x, memop) ->
360+
| Store (x, memop) ->
361+
let _mt = memory c x in
362+
check_memop c memop num_size (fun sz -> sz) e.at;
363+
[NumType I32Type; NumType memop.ty] --> []
364+
365+
| VecLoad (x, memop) ->
361366
let _mt = memory c x in
362367
check_memop c memop vec_size (Lib.Option.map fst) e.at;
363368
[NumType I32Type] --> [VecType memop.ty]
364369

365-
| LoadVecLane (x, memop, i) ->
370+
| VecStore (x, memop) ->
371+
let _mt = memory c x in
372+
check_memop c memop vec_size (fun _ -> None) e.at;
373+
[NumType I32Type; VecType memop.ty] --> []
374+
375+
| VecLoadLane (x, memop, i) ->
366376
let _mt = memory c x in
367377
check_memop c memop vec_size (fun sz -> Some sz) e.at;
368378
require (i < vec_size memop.ty / packed_size memop.pack) e.at
369379
"invalid lane index";
370380
[NumType I32Type; VecType memop.ty] --> [VecType memop.ty]
371381

372-
| Store (x, memop) ->
373-
let _mt = memory c x in
374-
check_memop c memop num_size (fun sz -> sz) e.at;
375-
[NumType I32Type; NumType memop.ty] --> []
376-
377-
| StoreVec (x, memop) ->
378-
let _mt = memory c x in
379-
check_memop c memop vec_size (fun _ -> None) e.at;
380-
[NumType I32Type; VecType memop.ty] --> []
381-
382-
| StoreVecLane (x, memop, i) ->
382+
| VecStoreLane (x, memop, i) ->
383383
let _mt = memory c x in
384384
check_memop c memop vec_size (fun sz -> Some sz) e.at;
385385
require (i < vec_size memop.ty / packed_size memop.pack) e.at

0 commit comments

Comments
 (0)