blob: 894521cb2d70e379fb989132e0bab761a3a5c7ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs
(module
(func $fold-binary (result i32)
i32.const 1
i32.const 2
i32.add)
(func $fold-binary-chain (result i32)
i32.const 1
i32.const 1
i32.const 1
i32.add
i32.sub)
(func $fold-compare (result i32)
f32.const 1
f32.const 2
f32.le)
(func $fold-unary (result f32)
f32.const 1
f32.neg
f32.neg)
(func $fold-convert (result i64)
f64.const 0
f32.demote_f64
i32.trunc_f32_s
i64.extend_i32_s)
(func $fold-select (result f32)
f32.const 1
f32.const 2
i32.const 3
select))
(;; STDOUT ;;;
(module
(type (;0;) (func (result i32)))
(type (;1;) (func (result f32)))
(type (;2;) (func (result i64)))
(func (;0;) (type 0) (result i32)
(i32.add
(i32.const 1)
(i32.const 2)))
(func (;1;) (type 0) (result i32)
(i32.sub
(i32.const 1)
(i32.add
(i32.const 1)
(i32.const 1))))
(func (;2;) (type 0) (result i32)
(f32.le
(f32.const 0x1p+0 (;=1;))
(f32.const 0x1p+1 (;=2;))))
(func (;3;) (type 1) (result f32)
(f32.neg
(f32.neg
(f32.const 0x1p+0 (;=1;)))))
(func (;4;) (type 2) (result i64)
(i64.extend_i32_s
(i32.trunc_f32_s
(f32.demote_f64
(f64.const 0x0p+0 (;=0;))))))
(func (;5;) (type 1) (result f32)
(select
(f32.const 0x1p+0 (;=1;))
(f32.const 0x1p+1 (;=2;))
(i32.const 3))))
;;; STDOUT ;;)
|