@@ -288,6 +288,177 @@ struct
288288 vecop 0x5al ; memop mo; byte i;
289289 | VecStoreLane ({ty = V128Type ; pack = Pack64 ; _} as mo , i ) ->
290290 vecop 0x5bl ; memop mo; byte i;
291+
292+ | MemoryAtomicNotify ({ty = I32Type ; pack = None ; _} as mo ) ->
293+ op 0xfe ; op 0x00 ; memop mo
294+ | MemoryAtomicNotify {ty = I32Type ; pack = Some _ ; _} -> assert false
295+ | MemoryAtomicNotify {ty = I64Type | F32Type | F64Type ; _} -> assert false
296+
297+ | MemoryAtomicWait ({ty = I32Type ; pack = None ; _} as mo ) ->
298+ op 0xfe ; op 0x01 ; memop mo
299+ | MemoryAtomicWait ({ty = I64Type ; pack = None ; _} as mo ) ->
300+ op 0xfe ; op 0x02 ; memop mo
301+ | MemoryAtomicWait {ty = I32Type | I64Type ; pack = Some _ ; _} ->
302+ assert false
303+ | MemoryAtomicWait {ty = F32Type | F64Type ; _} -> assert false
304+
305+ | AtomicFence ->
306+ op 0xfe ; op 0x03 ; op 0x00
307+
308+ | AtomicLoad ({ty = I32Type ; pack = None ; _} as mo ) ->
309+ op 0xfe ; op 0x10 ; memop mo
310+ | AtomicLoad ({ty = I64Type ; pack = None ; _} as mo ) ->
311+ op 0xfe ; op 0x11 ; memop mo
312+ | AtomicLoad ({ty = I32Type ; pack = Some Pack8 ; _} as mo ) ->
313+ op 0xfe ; op 0x12 ; memop mo
314+ | AtomicLoad ({ty = I32Type ; pack = Some Pack16 ; _} as mo ) ->
315+ op 0xfe ; op 0x13 ; memop mo
316+ | AtomicLoad {ty = I32Type ; pack = Some Pack32 ; _} -> assert false
317+ | AtomicLoad {ty = I32Type ; pack = Some Pack64 ; _} -> assert false
318+ | AtomicLoad ({ty = I64Type ; pack = Some Pack8 ; _} as mo ) ->
319+ op 0xfe ; op 0x14 ; memop mo
320+ | AtomicLoad ({ty = I64Type ; pack = Some Pack16 ; _} as mo ) ->
321+ op 0xfe ; op 0x15 ; memop mo
322+ | AtomicLoad ({ty = I64Type ; pack = Some Pack32 ; _} as mo ) ->
323+ op 0xfe ; op 0x16 ; memop mo
324+ | AtomicLoad ({ty = I64Type ; pack = Some Pack64 ; _} ) -> assert false
325+ | AtomicLoad {ty = F32Type | F64Type ; _} -> assert false
326+
327+ | AtomicStore ({ty = I32Type ; pack = None ; _} as mo ) ->
328+ op 0xfe ; op 0x17 ; memop mo
329+ | AtomicStore ({ty = I64Type ; pack = None ; _} as mo ) ->
330+ op 0xfe ; op 0x18 ; memop mo
331+ | AtomicStore ({ty = I32Type ; pack = Some Pack8 ; _} as mo ) ->
332+ op 0xfe ; op 0x19 ; memop mo
333+ | AtomicStore ({ty = I32Type ; pack = Some Pack16 ; _} as mo ) ->
334+ op 0xfe ; op 0x1a ; memop mo
335+ | AtomicStore {ty = I32Type ; pack = Some Pack32 ; _} -> assert false
336+ | AtomicStore {ty = I32Type ; pack = Some Pack64 ; _} -> assert false
337+ | AtomicStore ({ty = I64Type ; pack = Some Pack8 ; _} as mo ) ->
338+ op 0xfe ; op 0x1b ; memop mo
339+ | AtomicStore ({ty = I64Type ; pack = Some Pack16 ; _} as mo ) ->
340+ op 0xfe ; op 0x1c ; memop mo
341+ | AtomicStore ({ty = I64Type ; pack = Some Pack32 ; _} as mo ) ->
342+ op 0xfe ; op 0x1d ; memop mo
343+ | AtomicStore ({ty = I64Type ; pack = Some Pack64 ; _} ) -> assert false
344+ | AtomicStore {ty = F32Type | F64Type ; _} -> assert false
345+
346+ | AtomicRmw (I32 I32Op. RmwAdd, ({ty = I32Type ; pack = None ; _} as mo )) ->
347+ op 0xfe ; op 0x1e ; memop mo
348+ | AtomicRmw (I64 I64Op. RmwAdd, ({ty = I64Type ; pack = None ; _} as mo )) ->
349+ op 0xfe ; op 0x1f ; memop mo
350+ | AtomicRmw (I32 I32Op. RmwAdd, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
351+ op 0xfe ; op 0x20 ; memop mo
352+ | AtomicRmw (I32 I32Op. RmwAdd, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
353+ op 0xfe ; op 0x21 ; memop mo
354+ | AtomicRmw (I64 I64Op. RmwAdd, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
355+ op 0xfe ; op 0x22 ; memop mo
356+ | AtomicRmw (I64 I64Op. RmwAdd, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
357+ op 0xfe ; op 0x23 ; memop mo
358+ | AtomicRmw (I64 I64Op. RmwAdd, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
359+ op 0xfe ; op 0x24 ; memop mo
360+
361+ | AtomicRmw (I32 I32Op. RmwSub, ({ty = I32Type ; pack = None ; _} as mo )) ->
362+ op 0xfe ; op 0x25 ; memop mo
363+ | AtomicRmw (I64 I64Op. RmwSub, ({ty = I64Type ; pack = None ; _} as mo )) ->
364+ op 0xfe ; op 0x26 ; memop mo
365+ | AtomicRmw (I32 I32Op. RmwSub, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
366+ op 0xfe ; op 0x27 ; memop mo
367+ | AtomicRmw (I32 I32Op. RmwSub, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
368+ op 0xfe ; op 0x28 ; memop mo
369+ | AtomicRmw (I64 I64Op. RmwSub, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
370+ op 0xfe ; op 0x29 ; memop mo
371+ | AtomicRmw (I64 I64Op. RmwSub, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
372+ op 0xfe ; op 0x2a ; memop mo
373+ | AtomicRmw (I64 I64Op. RmwSub, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
374+ op 0xfe ; op 0x2b ; memop mo
375+
376+ | AtomicRmw (I32 I32Op. RmwAnd, ({ty = I32Type ; pack = None ; _} as mo )) ->
377+ op 0xfe ; op 0x2c ; memop mo
378+ | AtomicRmw (I64 I64Op. RmwAnd, ({ty = I64Type ; pack = None ; _} as mo )) ->
379+ op 0xfe ; op 0x2d ; memop mo
380+ | AtomicRmw (I32 I32Op. RmwAnd, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
381+ op 0xfe ; op 0x2e ; memop mo
382+ | AtomicRmw (I32 I32Op. RmwAnd, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
383+ op 0xfe ; op 0x2f ; memop mo
384+ | AtomicRmw (I64 I64Op. RmwAnd, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
385+ op 0xfe ; op 0x30 ; memop mo
386+ | AtomicRmw (I64 I64Op. RmwAnd, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
387+ op 0xfe ; op 0x31 ; memop mo
388+ | AtomicRmw (I64 I64Op. RmwAnd, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
389+ op 0xfe ; op 0x32 ; memop mo
390+
391+ | AtomicRmw (I32 I32Op. RmwOr, ({ty = I32Type ; pack = None ; _} as mo )) ->
392+ op 0xfe ; op 0x33 ; memop mo
393+ | AtomicRmw (I64 I64Op. RmwOr, ({ty = I64Type ; pack = None ; _} as mo )) ->
394+ op 0xfe ; op 0x34 ; memop mo
395+ | AtomicRmw (I32 I32Op. RmwOr, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
396+ op 0xfe ; op 0x35 ; memop mo
397+ | AtomicRmw (I32 I32Op. RmwOr, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
398+ op 0xfe ; op 0x36 ; memop mo
399+ | AtomicRmw (I64 I64Op. RmwOr, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
400+ op 0xfe ; op 0x37 ; memop mo
401+ | AtomicRmw (I64 I64Op. RmwOr, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
402+ op 0xfe ; op 0x38 ; memop mo
403+ | AtomicRmw (I64 I64Op. RmwOr, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
404+ op 0xfe ; op 0x39 ; memop mo
405+
406+ | AtomicRmw (I32 I32Op. RmwXor, ({ty = I32Type ; pack = None ; _} as mo )) ->
407+ op 0xfe ; op 0x3a ; memop mo
408+ | AtomicRmw (I64 I64Op. RmwXor, ({ty = I64Type ; pack = None ; _} as mo )) ->
409+ op 0xfe ; op 0x3b ; memop mo
410+ | AtomicRmw (I32 I32Op. RmwXor, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
411+ op 0xfe ; op 0x3c ; memop mo
412+ | AtomicRmw (I32 I32Op. RmwXor, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
413+ op 0xfe ; op 0x3d ; memop mo
414+ | AtomicRmw (I64 I64Op. RmwXor, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
415+ op 0xfe ; op 0x3e ; memop mo
416+ | AtomicRmw (I64 I64Op. RmwXor, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
417+ op 0xfe ; op 0x3f ; memop mo
418+ | AtomicRmw (I64 I64Op. RmwXor, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
419+ op 0xfe ; op 0x40 ; memop mo
420+
421+ | AtomicRmw (I32 I32Op. RmwXchg, ({ty = I32Type ; pack = None ; _} as mo )) ->
422+ op 0xfe ; op 0x41 ; memop mo
423+ | AtomicRmw (I64 I64Op. RmwXchg, ({ty = I64Type ; pack = None ; _} as mo )) ->
424+ op 0xfe ; op 0x42 ; memop mo
425+ | AtomicRmw (I32 I32Op. RmwXchg, ({ty = I32Type ; pack = Some Pack8 ; _} as mo )) ->
426+ op 0xfe ; op 0x43 ; memop mo
427+ | AtomicRmw (I32 I32Op. RmwXchg, ({ty = I32Type ; pack = Some Pack16 ; _} as mo )) ->
428+ op 0xfe ; op 0x44 ; memop mo
429+ | AtomicRmw (I64 I64Op. RmwXchg, ({ty = I64Type ; pack = Some Pack8 ; _} as mo )) ->
430+ op 0xfe ; op 0x45 ; memop mo
431+ | AtomicRmw (I64 I64Op. RmwXchg, ({ty = I64Type ; pack = Some Pack16 ; _} as mo )) ->
432+ op 0xfe ; op 0x46 ; memop mo
433+ | AtomicRmw (I64 I64Op. RmwXchg, ({ty = I64Type ; pack = Some Pack32 ; _} as mo )) ->
434+ op 0xfe ; op 0x47 ; memop mo
435+
436+ | AtomicRmw (I32 _ , {ty = I64Type ; _} ) -> assert false
437+ | AtomicRmw (I64 _ , {ty = I32Type ; _} ) -> assert false
438+ | AtomicRmw ((F32 _ | F64 _ ), _ ) -> assert false
439+ | AtomicRmw (_ , {ty = I32Type ; pack = Some Pack32 ; _} ) -> assert false
440+ | AtomicRmw (_ , {ty = I32Type ; pack = Some Pack64 ; _} ) -> assert false
441+ | AtomicRmw (_ , {ty = I64Type ; pack = Some Pack64 ; _} ) -> assert false
442+ | AtomicRmw (_ , {ty = F32Type | F64Type ; _} ) -> assert false
443+
444+ | AtomicRmwCmpXchg ({ty = I32Type ; pack = None ; _} as mo ) ->
445+ op 0xfe ; op 0x48 ; memop mo
446+ | AtomicRmwCmpXchg ({ty = I64Type ; pack = None ; _} as mo ) ->
447+ op 0xfe ; op 0x49 ; memop mo
448+ | AtomicRmwCmpXchg ({ty = I32Type ; pack = Some Pack8 ; _} as mo ) ->
449+ op 0xfe ; op 0x4a ; memop mo
450+ | AtomicRmwCmpXchg ({ty = I32Type ; pack = Some Pack16 ; _} as mo ) ->
451+ op 0xfe ; op 0x4b ; memop mo
452+ | AtomicRmwCmpXchg {ty = I32Type ; pack = Some Pack32 ; _} -> assert false
453+ | AtomicRmwCmpXchg {ty = I32Type ; pack = Some Pack64 ; _} -> assert false
454+ | AtomicRmwCmpXchg ({ty = I64Type ; pack = Some Pack8 ; _} as mo ) ->
455+ op 0xfe ; op 0x4c ; memop mo
456+ | AtomicRmwCmpXchg ({ty = I64Type ; pack = Some Pack16 ; _} as mo ) ->
457+ op 0xfe ; op 0x4d ; memop mo
458+ | AtomicRmwCmpXchg ({ty = I64Type ; pack = Some Pack32 ; _} as mo ) ->
459+ op 0xfe ; op 0x4e ; memop mo
460+ | AtomicRmwCmpXchg ({ty = I64Type ; pack = Some Pack64 ; _} ) -> assert false
461+ | AtomicRmwCmpXchg {ty = F32Type | F64Type ; _} -> assert false
291462
292463 | MemorySize -> op 0x3f ; byte 0x00
293464 | MemoryGrow -> op 0x40 ; byte 0x00
0 commit comments