|
1 | | -;; i32 |
| 1 | +(module |
2 | 2 |
|
3 | | -(func $i64_to_i32 (param i64) (result i32) |
4 | | - (i32.wrap/i64 |
5 | | - (get_local 0))) |
| 3 | + ;; i32 |
6 | 4 |
|
7 | | -(func $f32_to_i32 (param f32) (result i32) |
8 | | - (i32.trunc_s/f32 |
9 | | - (get_local 0))) |
| 5 | + (func $i64_to_i32 (param i64) (result i32) |
| 6 | + (i32.wrap/i64 |
| 7 | + (get_local 0))) |
10 | 8 |
|
11 | | -(func $f64_to_i32 (param f64) (result i32) |
12 | | - (i32.trunc_s/f64 |
13 | | - (get_local 0))) |
| 9 | + (func $f32_to_i32 (param f32) (result i32) |
| 10 | + (i32.trunc_s/f32 |
| 11 | + (get_local 0))) |
14 | 12 |
|
| 13 | + (func $f64_to_i32 (param f64) (result i32) |
| 14 | + (i32.trunc_s/f64 |
| 15 | + (get_local 0))) |
15 | 16 |
|
16 | | -;; i64 |
17 | 17 |
|
18 | | -(func $i32_to_i64 (param i32) (result i64) |
19 | | - (i64.extend_s/i32 |
20 | | - (get_local 0))) |
| 18 | + ;; i64 |
21 | 19 |
|
22 | | -(func $f32_to_i64 (param f32) (result i64) |
23 | | - (i64.trunc_s/f32 |
24 | | - (get_local 0))) |
| 20 | + (func $i32_to_i64 (param i32) (result i64) |
| 21 | + (i64.extend_s/i32 |
| 22 | + (get_local 0))) |
25 | 23 |
|
26 | | -(func $f64_to_i64 (param f64) (result i64) |
27 | | - (i64.trunc_s/f64 |
28 | | - (get_local 0))) |
| 24 | + (func $f32_to_i64 (param f32) (result i64) |
| 25 | + (i64.trunc_s/f32 |
| 26 | + (get_local 0))) |
29 | 27 |
|
| 28 | + (func $f64_to_i64 (param f64) (result i64) |
| 29 | + (i64.trunc_s/f64 |
| 30 | + (get_local 0))) |
30 | 31 |
|
31 | | -;; f32 |
32 | 32 |
|
33 | | -(func $i32_to_f32 (param i32) (result f32) |
34 | | - (f32.convert_s/i32 |
35 | | - (get_local 0))) |
| 33 | + ;; f32 |
36 | 34 |
|
37 | | -(func $i64_to_f32 (param i64) (result f32) |
38 | | - (f32.convert_s/i64 |
39 | | - (get_local 0))) |
| 35 | + (func $i32_to_f32 (param i32) (result f32) |
| 36 | + (f32.convert_s/i32 |
| 37 | + (get_local 0))) |
40 | 38 |
|
41 | | -(func $f64_to_f32 (param f64) (result f32) |
42 | | - (f32.demote/f64 |
43 | | - (get_local 0))) |
| 39 | + (func $i64_to_f32 (param i64) (result f32) |
| 40 | + (f32.convert_s/i64 |
| 41 | + (get_local 0))) |
44 | 42 |
|
| 43 | + (func $f64_to_f32 (param f64) (result f32) |
| 44 | + (f32.demote/f64 |
| 45 | + (get_local 0))) |
45 | 46 |
|
46 | | -;; f64 |
47 | 47 |
|
48 | | -(func $i32_to_f64 (param i32) (result f64) |
49 | | - (f64.convert_s/i32 |
50 | | - (get_local 0))) |
| 48 | + ;; f64 |
51 | 49 |
|
52 | | -(func $i64_to_f64 (param i64) (result f64) |
53 | | - (f64.convert_s/i64 |
54 | | - (get_local 0))) |
| 50 | + (func $i32_to_f64 (param i32) (result f64) |
| 51 | + (f64.convert_s/i32 |
| 52 | + (get_local 0))) |
55 | 53 |
|
56 | | -(func $f32_to_f64 (param f32) (result f64) |
57 | | - (f64.promote/f32 |
58 | | - (get_local 0))) |
| 54 | + (func $i64_to_f64 (param i64) (result f64) |
| 55 | + (f64.convert_s/i64 |
| 56 | + (get_local 0))) |
59 | 57 |
|
| 58 | + (func $f32_to_f64 (param f32) (result f64) |
| 59 | + (f64.promote/f32 |
| 60 | + (get_local 0))) |
60 | 61 |
|
61 | | -;; bool, i8, i16 |
62 | 62 |
|
63 | | -(func $i32_to_bool (param i32) (result i32) |
64 | | - (i32.ne |
65 | | - (get_local 0) |
66 | | - (i32.const 0))) |
| 63 | + ;; bool, i8, i16 |
67 | 64 |
|
68 | | -(func $i32_to_i8 (param i32) (result i32) |
69 | | - (i32.shr_s |
70 | | - (i32.shl |
| 65 | + (func $i32_to_bool (param i32) (result i32) |
| 66 | + (i32.ne |
71 | 67 | (get_local 0) |
72 | | - (i32.const 24)) |
73 | | - (i32.const 24))) |
74 | | - |
75 | | -(func $i32_to_i16 (param i32) (result i32) |
76 | | - (i32.shr_s |
77 | | - (i32.shl |
78 | | - (get_local 0) |
79 | | - (i32.const 16)) |
80 | | - (i32.const 16))) |
| 68 | + (i32.const 0))) |
| 69 | + |
| 70 | + (func $i32_to_i8 (param i32) (result i32) |
| 71 | + (i32.shr_s |
| 72 | + (i32.shl |
| 73 | + (get_local 0) |
| 74 | + (i32.const 24)) |
| 75 | + (i32.const 24))) |
| 76 | + |
| 77 | + (func $i32_to_i16 (param i32) (result i32) |
| 78 | + (i32.shr_s |
| 79 | + (i32.shl |
| 80 | + (get_local 0) |
| 81 | + (i32.const 16)) |
| 82 | + (i32.const 16))) |
| 83 | +) |
0 commit comments