xref: /wasmtime-44.0.1/tests/disas/simd.wat (revision 7e0331c2)
1;;! target = "x86_64"
2
3(module
4  (func $test_splat (result i32)
5    i32.const 42
6    i32x4.splat
7    i32x4.extract_lane 0
8  )
9
10  (func $test_insert_lane (result i32)
11      v128.const i64x2 0 0
12      i32.const 99
13      i32x4.replace_lane 1
14      i32x4.extract_lane 1
15  )
16
17  (func $test_const (result i32)
18    v128.const i32x4 1 2 3 4
19    i32x4.extract_lane 3
20  )
21
22  (func $test_locals (local i32 v128)
23    local.get 0
24    i32x4.splat
25    local.set 1
26  )
27
28  (export "test_splat" (func $test_splat))
29  (export "test_insert_lane" (func $test_insert_lane))
30  (export "test_const" (func $test_const))
31)
32
33;; function u0:0(i64 vmctx, i64) -> i32 tail {
34;;     gv0 = vmctx
35;;     gv1 = load.i64 notrap aligned readonly gv0+8
36;;     gv2 = load.i64 notrap aligned gv1+24
37;;     stack_limit = gv2
38;;
39;;                                 block0(v0: i64, v1: i64):
40;; @004e                               v3 = iconst.i32 42
41;; @0050                               v4 = splat.i32x4 v3  ; v3 = 42
42;; @0052                               v5 = extractlane v4, 0
43;; @0055                               jump block1
44;;
45;;                                 block1:
46;; @0055                               return v5
47;; }
48;;
49;; function u0:1(i64 vmctx, i64) -> i32 tail {
50;;     gv0 = vmctx
51;;     gv1 = load.i64 notrap aligned readonly gv0+8
52;;     gv2 = load.i64 notrap aligned gv1+24
53;;     const0 = 0x00000000000000000000000000000000
54;;     stack_limit = gv2
55;;
56;;                                 block0(v0: i64, v1: i64):
57;; @0058                               v3 = vconst.i8x16 const0
58;; @006a                               v4 = iconst.i32 99
59;; @006d                               v5 = bitcast.i32x4 little v3  ; v3 = const0
60;; @006d                               v6 = insertlane v5, v4, 1  ; v4 = 99
61;; @0070                               v7 = extractlane v6, 1
62;; @0073                               jump block1
63;;
64;;                                 block1:
65;; @0073                               return v7
66;; }
67;;
68;; function u0:2(i64 vmctx, i64) -> i32 tail {
69;;     gv0 = vmctx
70;;     gv1 = load.i64 notrap aligned readonly gv0+8
71;;     gv2 = load.i64 notrap aligned gv1+24
72;;     const0 = 0x00000004000000030000000200000001
73;;     stack_limit = gv2
74;;
75;;                                 block0(v0: i64, v1: i64):
76;; @0076                               v3 = vconst.i8x16 const0
77;; @0088                               v4 = bitcast.i32x4 little v3  ; v3 = const0
78;; @0088                               v5 = extractlane v4, 3
79;; @008b                               jump block1
80;;
81;;                                 block1:
82;; @008b                               return v5
83;; }
84;;
85;; function u0:3(i64 vmctx, i64) tail {
86;;     gv0 = vmctx
87;;     gv1 = load.i64 notrap aligned readonly gv0+8
88;;     gv2 = load.i64 notrap aligned gv1+24
89;;     const0 = 0x00000000000000000000000000000000
90;;     stack_limit = gv2
91;;
92;;                                 block0(v0: i64, v1: i64):
93;; @008e                               v2 = iconst.i32 0
94;; @0090                               v3 = vconst.i8x16 const0
95;; @0094                               v4 = splat.i32x4 v2  ; v2 = 0
96;; @0096                               v5 = bitcast.i8x16 little v4
97;; @0098                               jump block1
98;;
99;;                                 block1:
100;; @0098                               return
101;; }
102