xref: /wasmtime-44.0.1/tests/disas/select.wat (revision 7e0331c2)
1;;! target = "x86_64"
2
3(module
4  (func $untyped-select (result i32)
5  	i32.const 42
6  	i32.const 24
7  	i32.const 1
8  	select)
9
10  (func $typed-select-1 (result externref)
11  	ref.null extern
12  	ref.null extern
13  	i32.const 1
14  	select (result externref))
15
16  (func $typed-select-2 (param externref) (result externref)
17    ref.null extern
18    local.get 0
19    i32.const 1
20    select (result externref))
21)
22
23;; function u0:0(i64 vmctx, i64) -> i32 tail {
24;;     gv0 = vmctx
25;;     gv1 = load.i64 notrap aligned readonly gv0+8
26;;     gv2 = load.i64 notrap aligned gv1+24
27;;     stack_limit = gv2
28;;
29;;                                 block0(v0: i64, v1: i64):
30;; @0023                               v3 = iconst.i32 42
31;; @0025                               v4 = iconst.i32 24
32;; @0027                               v5 = iconst.i32 1
33;; @0029                               v6 = select v5, v3, v4  ; v5 = 1, v3 = 42, v4 = 24
34;; @002a                               jump block1
35;;
36;;                                 block1:
37;; @002a                               return v6
38;; }
39;;
40;; function u0:1(i64 vmctx, i64) -> i32 tail {
41;;     gv0 = vmctx
42;;     gv1 = load.i64 notrap aligned readonly gv0+8
43;;     gv2 = load.i64 notrap aligned gv1+24
44;;     stack_limit = gv2
45;;
46;;                                 block0(v0: i64, v1: i64):
47;; @002d                               v3 = iconst.i32 0
48;; @002f                               v4 = iconst.i32 0
49;; @0031                               v5 = iconst.i32 1
50;; @0033                               v6 = select v5, v3, v4  ; v5 = 1, v3 = 0, v4 = 0
51;; @0036                               jump block1
52;;
53;;                                 block1:
54;; @0036                               return v6
55;; }
56;;
57;; function u0:2(i64 vmctx, i64, i32) -> i32 tail {
58;;     gv0 = vmctx
59;;     gv1 = load.i64 notrap aligned readonly gv0+8
60;;     gv2 = load.i64 notrap aligned gv1+24
61;;     stack_limit = gv2
62;;
63;;                                 block0(v0: i64, v1: i64, v2: i32):
64;; @0039                               v4 = iconst.i32 0
65;; @003d                               v5 = iconst.i32 1
66;; @003f                               v6 = select v5, v4, v2  ; v5 = 1, v4 = 0
67;; @0042                               jump block1
68;;
69;;                                 block1:
70;; @0042                               return v6
71;; }
72