xref: /wasmtime-44.0.1/tests/disas/memory.wat (revision 2f7dbd61)
1;;! target = "x86_64"
2
3(module
4  (memory 1)
5  (func $main (local i32)
6    (i32.store (i32.const 0) (i32.const 0x0))
7    (if (i32.load (i32.const 0))
8        (then (i32.store (i32.const 0) (i32.const 0xa)))
9        (else (i32.store (i32.const 0) (i32.const 0xb))))
10  )
11  (start $main)
12  (data (i32.const 0) "0000")
13)
14
15;; function u0:0(i64 vmctx, i64) tail {
16;;     gv0 = vmctx
17;;     gv1 = load.i64 notrap aligned readonly gv0+8
18;;     gv2 = load.i64 notrap aligned gv1+24
19;;     gv3 = vmctx
20;;     gv4 = load.i64 notrap aligned gv3+64
21;;     gv5 = load.i64 notrap aligned readonly can_move gv3+56
22;;     stack_limit = gv2
23;;
24;;                                 block0(v0: i64, v1: i64):
25;; @001f                               v2 = iconst.i32 0
26;; @0021                               v3 = iconst.i32 0
27;; @0023                               v4 = iconst.i32 0
28;; @0025                               v5 = uextend.i64 v3  ; v3 = 0
29;; @0025                               v6 = load.i64 notrap aligned readonly can_move v0+56
30;; @0025                               v7 = iadd v6, v5
31;; @0025                               store little heap v4, v7  ; v4 = 0
32;; @0028                               v8 = iconst.i32 0
33;; @002a                               v9 = uextend.i64 v8  ; v8 = 0
34;; @002a                               v10 = load.i64 notrap aligned readonly can_move v0+56
35;; @002a                               v11 = iadd v10, v9
36;; @002a                               v12 = load.i32 little heap v11
37;; @002d                               brif v12, block2, block4
38;;
39;;                                 block2:
40;; @002f                               v13 = iconst.i32 0
41;; @0031                               v14 = iconst.i32 10
42;; @0033                               v15 = uextend.i64 v13  ; v13 = 0
43;; @0033                               v16 = load.i64 notrap aligned readonly can_move v0+56
44;; @0033                               v17 = iadd v16, v15
45;; @0033                               store little heap v14, v17  ; v14 = 10
46;; @0036                               jump block3
47;;
48;;                                 block4:
49;; @0037                               v18 = iconst.i32 0
50;; @0039                               v19 = iconst.i32 11
51;; @003b                               v20 = uextend.i64 v18  ; v18 = 0
52;; @003b                               v21 = load.i64 notrap aligned readonly can_move v0+56
53;; @003b                               v22 = iadd v21, v20
54;; @003b                               store little heap v19, v22  ; v19 = 11
55;; @003e                               jump block3
56;;
57;;                                 block3:
58;; @003f                               jump block1
59;;
60;;                                 block1:
61;; @003f                               return
62;; }
63