...
1;; Tests for i32x4 [min_s, min_u, max_s, max_u, abs] operations.
2
3(module
4 (func (export "i32x4.min_s") (param v128 v128) (result v128) (i32x4.min_s (local.get 0) (local.get 1)))
5 (func (export "i32x4.min_u") (param v128 v128) (result v128) (i32x4.min_u (local.get 0) (local.get 1)))
6 (func (export "i32x4.max_s") (param v128 v128) (result v128) (i32x4.max_s (local.get 0) (local.get 1)))
7 (func (export "i32x4.max_u") (param v128 v128) (result v128) (i32x4.max_u (local.get 0) (local.get 1)))
8 (func (export "i32x4.abs") (param v128) (result v128) (i32x4.abs (local.get 0)))
9 (func (export "i32x4.min_s_with_const_0") (result v128) (i32x4.min_s (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295) (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648)))
10 (func (export "i32x4.min_s_with_const_1") (result v128) (i32x4.min_s (v128.const i32x4 0 1 2 3) (v128.const i32x4 3 2 1 0)))
11 (func (export "i32x4.min_u_with_const_2") (result v128) (i32x4.min_u (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295) (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648)))
12 (func (export "i32x4.min_u_with_const_3") (result v128) (i32x4.min_u (v128.const i32x4 0 1 2 3) (v128.const i32x4 3 2 1 0)))
13 (func (export "i32x4.max_s_with_const_4") (result v128) (i32x4.max_s (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295) (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648)))
14 (func (export "i32x4.max_s_with_const_5") (result v128) (i32x4.max_s (v128.const i32x4 0 1 2 3) (v128.const i32x4 3 2 1 0)))
15 (func (export "i32x4.max_u_with_const_6") (result v128) (i32x4.max_u (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295) (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648)))
16 (func (export "i32x4.max_u_with_const_7") (result v128) (i32x4.max_u (v128.const i32x4 0 1 2 3) (v128.const i32x4 3 2 1 0)))
17 (func (export "i32x4.abs_with_const_8") (result v128) (i32x4.abs (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)))
18 (func (export "i32x4.min_s_with_const_9") (param v128) (result v128) (i32x4.min_s (local.get 0) (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)))
19 (func (export "i32x4.min_s_with_const_10") (param v128) (result v128) (i32x4.min_s (local.get 0) (v128.const i32x4 0 1 2 3)))
20 (func (export "i32x4.min_u_with_const_11") (param v128) (result v128) (i32x4.min_u (local.get 0) (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)))
21 (func (export "i32x4.min_u_with_const_12") (param v128) (result v128) (i32x4.min_u (local.get 0) (v128.const i32x4 0 1 2 3)))
22 (func (export "i32x4.max_s_with_const_13") (param v128) (result v128) (i32x4.max_s (local.get 0) (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)))
23 (func (export "i32x4.max_s_with_const_14") (param v128) (result v128) (i32x4.max_s (local.get 0) (v128.const i32x4 0 1 2 3)))
24 (func (export "i32x4.max_u_with_const_15") (param v128) (result v128) (i32x4.max_u (local.get 0) (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)))
25 (func (export "i32x4.max_u_with_const_16") (param v128) (result v128) (i32x4.max_u (local.get 0) (v128.const i32x4 0 1 2 3)))
26)
27
28(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0 0 0 0)
29 (v128.const i32x4 0 0 0 0))
30 (v128.const i32x4 0 0 0 0))
31(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0 0 0 0)
32 (v128.const i32x4 -1 -1 -1 -1))
33 (v128.const i32x4 -1 -1 -1 -1))
34(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0 0 -1 -1)
35 (v128.const i32x4 0 -1 0 -1))
36 (v128.const i32x4 0 -1 -1 -1))
37(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0 0 0 0)
38 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
39 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
40(assert_return (invoke "i32x4.min_s" (v128.const i32x4 1 1 1 1)
41 (v128.const i32x4 1 1 1 1))
42 (v128.const i32x4 1 1 1 1))
43(assert_return (invoke "i32x4.min_s" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
44 (v128.const i32x4 1 1 1 1))
45 (v128.const i32x4 4294967295 4294967295 4294967295 4294967295))
46(assert_return (invoke "i32x4.min_s" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
47 (v128.const i32x4 128 128 128 128))
48 (v128.const i32x4 4294967295 4294967295 4294967295 4294967295))
49(assert_return (invoke "i32x4.min_s" (v128.const i32x4 2147483648 2147483648 2147483648 2147483648)
50 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
51 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
52(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)
53 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
54 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
55(assert_return (invoke "i32x4.min_s" (v128.const i32x4 123 123 123 123)
56 (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
57 (v128.const i32x4 123 123 123 123))
58(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0x80 0x80 0x80 0x80)
59 (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
60 (v128.const i32x4 0x80 0x80 0x80 0x80))
61(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0 0 0 0)
62 (v128.const i32x4 0 0 0 0))
63 (v128.const i32x4 0 0 0 0))
64(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0 0 0 0)
65 (v128.const i32x4 -1 -1 -1 -1))
66 (v128.const i32x4 0 0 0 0))
67(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0 0 -1 -1)
68 (v128.const i32x4 0 -1 0 -1))
69 (v128.const i32x4 0 0 0 -1))
70(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0 0 0 0)
71 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
72 (v128.const i32x4 0 0 0 0))
73(assert_return (invoke "i32x4.min_u" (v128.const i32x4 1 1 1 1)
74 (v128.const i32x4 1 1 1 1))
75 (v128.const i32x4 1 1 1 1))
76(assert_return (invoke "i32x4.min_u" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
77 (v128.const i32x4 1 1 1 1))
78 (v128.const i32x4 1 1 1 1))
79(assert_return (invoke "i32x4.min_u" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
80 (v128.const i32x4 128 128 128 128))
81 (v128.const i32x4 128 128 128 128))
82(assert_return (invoke "i32x4.min_u" (v128.const i32x4 2147483648 2147483648 2147483648 2147483648)
83 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
84 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
85(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)
86 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
87 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
88(assert_return (invoke "i32x4.min_u" (v128.const i32x4 123 123 123 123)
89 (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
90 (v128.const i32x4 123 123 123 123))
91(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0x80 0x80 0x80 0x80)
92 (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
93 (v128.const i32x4 0x80 0x80 0x80 0x80))
94(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0 0 0 0)
95 (v128.const i32x4 0 0 0 0))
96 (v128.const i32x4 0 0 0 0))
97(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0 0 0 0)
98 (v128.const i32x4 -1 -1 -1 -1))
99 (v128.const i32x4 0 0 0 0))
100(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0 0 -1 -1)
101 (v128.const i32x4 0 -1 0 -1))
102 (v128.const i32x4 0 0 0 -1))
103(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0 0 0 0)
104 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
105 (v128.const i32x4 0 0 0 0))
106(assert_return (invoke "i32x4.max_s" (v128.const i32x4 1 1 1 1)
107 (v128.const i32x4 1 1 1 1))
108 (v128.const i32x4 1 1 1 1))
109(assert_return (invoke "i32x4.max_s" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
110 (v128.const i32x4 1 1 1 1))
111 (v128.const i32x4 1 1 1 1))
112(assert_return (invoke "i32x4.max_s" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
113 (v128.const i32x4 128 128 128 128))
114 (v128.const i32x4 128 128 128 128))
115(assert_return (invoke "i32x4.max_s" (v128.const i32x4 2147483648 2147483648 2147483648 2147483648)
116 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
117 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
118(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)
119 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
120 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
121(assert_return (invoke "i32x4.max_s" (v128.const i32x4 123 123 123 123)
122 (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
123 (v128.const i32x4 123 123 123 123))
124(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0x80 0x80 0x80 0x80)
125 (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
126 (v128.const i32x4 0x80 0x80 0x80 0x80))
127(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0 0 0 0)
128 (v128.const i32x4 0 0 0 0))
129 (v128.const i32x4 0 0 0 0))
130(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0 0 0 0)
131 (v128.const i32x4 -1 -1 -1 -1))
132 (v128.const i32x4 -1 -1 -1 -1))
133(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0 0 -1 -1)
134 (v128.const i32x4 0 -1 0 -1))
135 (v128.const i32x4 0 -1 -1 -1))
136(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0 0 0 0)
137 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
138 (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
139(assert_return (invoke "i32x4.max_u" (v128.const i32x4 1 1 1 1)
140 (v128.const i32x4 1 1 1 1))
141 (v128.const i32x4 1 1 1 1))
142(assert_return (invoke "i32x4.max_u" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
143 (v128.const i32x4 1 1 1 1))
144 (v128.const i32x4 4294967295 4294967295 4294967295 4294967295))
145(assert_return (invoke "i32x4.max_u" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295)
146 (v128.const i32x4 128 128 128 128))
147 (v128.const i32x4 4294967295 4294967295 4294967295 4294967295))
148(assert_return (invoke "i32x4.max_u" (v128.const i32x4 2147483648 2147483648 2147483648 2147483648)
149 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
150 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
151(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)
152 (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
153 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
154(assert_return (invoke "i32x4.max_u" (v128.const i32x4 123 123 123 123)
155 (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
156 (v128.const i32x4 123 123 123 123))
157(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0x80 0x80 0x80 0x80)
158 (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
159 (v128.const i32x4 0x80 0x80 0x80 0x80))
160(assert_return (invoke "i32x4.abs" (v128.const i32x4 1 1 1 1))
161 (v128.const i32x4 1 1 1 1))
162(assert_return (invoke "i32x4.abs" (v128.const i32x4 -1 -1 -1 -1))
163 (v128.const i32x4 1 1 1 1))
164(assert_return (invoke "i32x4.abs" (v128.const i32x4 4294967295 4294967295 4294967295 4294967295))
165 (v128.const i32x4 1 1 1 1))
166(assert_return (invoke "i32x4.abs" (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff))
167 (v128.const i32x4 0x1 0x1 0x1 0x1))
168(assert_return (invoke "i32x4.abs" (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
169 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
170(assert_return (invoke "i32x4.abs" (v128.const i32x4 -2147483648 -2147483648 -2147483648 -2147483648))
171 (v128.const i32x4 2147483648 2147483648 2147483648 2147483648))
172(assert_return (invoke "i32x4.abs" (v128.const i32x4 -0x80000000 -0x80000000 -0x80000000 -0x80000000))
173 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
174(assert_return (invoke "i32x4.abs" (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
175 (v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000))
176(assert_return (invoke "i32x4.abs" (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
177 (v128.const i32x4 01_2_3 01_2_3 01_2_3 01_2_3))
178(assert_return (invoke "i32x4.abs" (v128.const i32x4 -01_2_3 -01_2_3 -01_2_3 -01_2_3))
179 (v128.const i32x4 123 123 123 123))
180(assert_return (invoke "i32x4.abs" (v128.const i32x4 0x80 0x80 0x80 0x80))
181 (v128.const i32x4 0x80 0x80 0x80 0x80))
182(assert_return (invoke "i32x4.abs" (v128.const i32x4 -0x80 -0x80 -0x80 -0x80))
183 (v128.const i32x4 0x80 0x80 0x80 0x80))
184(assert_return (invoke "i32x4.abs" (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
185 (v128.const i32x4 0x0_8_0 0x0_8_0 0x0_8_0 0x0_8_0))
186(assert_return (invoke "i32x4.abs" (v128.const i32x4 -0x0_8_0 -0x0_8_0 -0x0_8_0 -0x0_8_0))
187 (v128.const i32x4 0x80 0x80 0x80 0x80))
188
189;; Const vs const
190(assert_return (invoke "i32x4.min_s_with_const_0") (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
191(assert_return (invoke "i32x4.min_s_with_const_1") (v128.const i32x4 0 1 1 0))
192(assert_return (invoke "i32x4.min_u_with_const_2") (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
193(assert_return (invoke "i32x4.min_u_with_const_3") (v128.const i32x4 0 1 1 0))
194(assert_return (invoke "i32x4.max_s_with_const_4") (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
195(assert_return (invoke "i32x4.max_s_with_const_5") (v128.const i32x4 3 2 2 3))
196(assert_return (invoke "i32x4.max_u_with_const_6") (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
197(assert_return (invoke "i32x4.max_u_with_const_7") (v128.const i32x4 3 2 2 3))
198(assert_return (invoke "i32x4.abs_with_const_8") (v128.const i32x4 2147483648 2147483647 1073741824 1))
199
200;; Param vs const
201(assert_return (invoke "i32x4.min_s_with_const_9" (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
202 (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
203(assert_return (invoke "i32x4.min_s_with_const_10" (v128.const i32x4 3 2 1 0))
204 (v128.const i32x4 0 1 1 0))
205(assert_return (invoke "i32x4.min_u_with_const_11" (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
206 (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
207(assert_return (invoke "i32x4.min_u_with_const_12" (v128.const i32x4 3 2 1 0))
208 (v128.const i32x4 0 1 1 0))
209(assert_return (invoke "i32x4.max_s_with_const_13" (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
210 (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
211(assert_return (invoke "i32x4.max_s_with_const_14" (v128.const i32x4 3 2 1 0))
212 (v128.const i32x4 3 2 2 3))
213(assert_return (invoke "i32x4.max_u_with_const_15" (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
214 (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
215(assert_return (invoke "i32x4.max_u_with_const_16" (v128.const i32x4 3 2 1 0))
216 (v128.const i32x4 3 2 2 3))
217
218;; Test different lanes go through different if-then clauses
219(assert_return (invoke "i32x4.min_s" (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)
220 (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
221 (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
222(assert_return (invoke "i32x4.min_s" (v128.const i32x4 0 1 2 128)
223 (v128.const i32x4 0 2 1 128))
224 (v128.const i32x4 0 1 1 128))
225(assert_return (invoke "i32x4.min_u" (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)
226 (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
227 (v128.const i32x4 -2147483648 1073741824 1073741824 -2147483648))
228(assert_return (invoke "i32x4.min_u" (v128.const i32x4 0 1 2 128)
229 (v128.const i32x4 0 2 1 128))
230 (v128.const i32x4 0 1 1 128))
231(assert_return (invoke "i32x4.max_s" (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)
232 (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
233 (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
234(assert_return (invoke "i32x4.max_s" (v128.const i32x4 0 1 2 128)
235 (v128.const i32x4 0 2 1 128))
236 (v128.const i32x4 0 2 2 128))
237(assert_return (invoke "i32x4.max_u" (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295)
238 (v128.const i32x4 4294967295 1073741824 2147483647 -2147483648))
239 (v128.const i32x4 4294967295 2147483647 2147483647 4294967295))
240(assert_return (invoke "i32x4.max_u" (v128.const i32x4 0 1 2 128)
241 (v128.const i32x4 0 2 1 128))
242 (v128.const i32x4 0 2 2 128))
243(assert_return (invoke "i32x4.abs" (v128.const i32x4 -2147483648 2147483647 1073741824 4294967295))
244 (v128.const i32x4 2147483648 2147483647 1073741824 1))
245
246;; Test opposite signs of zero
247(assert_return (invoke "i32x4.min_s" (v128.const i32x4 -0 -0 +0 +0)
248 (v128.const i32x4 +0 0 -0 0))
249 (v128.const i32x4 -0 -0 +0 +0))
250(assert_return (invoke "i32x4.min_s" (v128.const i32x4 -0 -0 -0 -0)
251 (v128.const i32x4 +0 +0 +0 +0))
252 (v128.const i32x4 -0 -0 -0 -0))
253(assert_return (invoke "i32x4.min_u" (v128.const i32x4 -0 -0 +0 +0)
254 (v128.const i32x4 +0 0 -0 0))
255 (v128.const i32x4 -0 -0 +0 +0))
256(assert_return (invoke "i32x4.min_u" (v128.const i32x4 -0 -0 -0 -0)
257 (v128.const i32x4 +0 +0 +0 +0))
258 (v128.const i32x4 -0 -0 -0 -0))
259(assert_return (invoke "i32x4.max_s" (v128.const i32x4 -0 -0 +0 +0)
260 (v128.const i32x4 +0 0 -0 0))
261 (v128.const i32x4 -0 -0 +0 +0))
262(assert_return (invoke "i32x4.max_s" (v128.const i32x4 -0 -0 -0 -0)
263 (v128.const i32x4 +0 +0 +0 +0))
264 (v128.const i32x4 -0 -0 -0 -0))
265(assert_return (invoke "i32x4.max_u" (v128.const i32x4 -0 -0 +0 +0)
266 (v128.const i32x4 +0 0 -0 0))
267 (v128.const i32x4 -0 -0 +0 +0))
268(assert_return (invoke "i32x4.max_u" (v128.const i32x4 -0 -0 -0 -0)
269 (v128.const i32x4 +0 +0 +0 +0))
270 (v128.const i32x4 -0 -0 -0 -0))
271(assert_return (invoke "i32x4.abs" (v128.const i32x4 -0 -0 +0 +0))
272 (v128.const i32x4 -0 -0 +0 +0))
273(assert_return (invoke "i32x4.abs" (v128.const i32x4 +0 0 -0 0))
274 (v128.const i32x4 +0 0 -0 0))
275(assert_return (invoke "i32x4.abs" (v128.const i32x4 -0 -0 -0 -0))
276 (v128.const i32x4 -0 -0 -0 -0))
277(assert_return (invoke "i32x4.abs" (v128.const i32x4 +0 +0 +0 +0))
278 (v128.const i32x4 +0 +0 +0 +0))
279
280;; Unknown operators
281(assert_malformed (module quote "(memory 1) (func (result v128) (f32x4.min_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
282(assert_malformed (module quote "(memory 1) (func (result v128) (f32x4.min_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
283(assert_malformed (module quote "(memory 1) (func (result v128) (f32x4.max_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
284(assert_malformed (module quote "(memory 1) (func (result v128) (f32x4.max_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
285(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.min_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
286(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.min_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
287(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.max_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
288(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.max_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
289(assert_malformed (module quote "(memory 1) (func (result v128) (f64x2.min_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
290(assert_malformed (module quote "(memory 1) (func (result v128) (f64x2.min_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
291(assert_malformed (module quote "(memory 1) (func (result v128) (f64x2.max_s (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
292(assert_malformed (module quote "(memory 1) (func (result v128) (f64x2.max_u (v128.const i32x4 0 0 0 0) (v128.const i32x4 1 1 1 1)))") "unknown operator")
293
294;; Type check
295(assert_invalid (module (func (result v128) (i32x4.min_s (i32.const 0) (f32.const 0.0)))) "type mismatch")
296(assert_invalid (module (func (result v128) (i32x4.min_u (i32.const 0) (f32.const 0.0)))) "type mismatch")
297(assert_invalid (module (func (result v128) (i32x4.max_s (i32.const 0) (f32.const 0.0)))) "type mismatch")
298(assert_invalid (module (func (result v128) (i32x4.max_u (i32.const 0) (f32.const 0.0)))) "type mismatch")
299(assert_invalid (module (func (result v128) (i32x4.abs (f32.const 0.0)))) "type mismatch")
300
301;; Test operation with empty argument
302
303(assert_invalid
304 (module
305 (func $i32x4.min_s-1st-arg-empty (result v128)
306 (i32x4.min_s (v128.const i32x4 0 0 0 0))
307 )
308 )
309 "type mismatch"
310)
311(assert_invalid
312 (module
313 (func $i32x4.min_s-arg-empty (result v128)
314 (i32x4.min_s)
315 )
316 )
317 "type mismatch"
318)
319(assert_invalid
320 (module
321 (func $i32x4.min_u-1st-arg-empty (result v128)
322 (i32x4.min_u (v128.const i32x4 0 0 0 0))
323 )
324 )
325 "type mismatch"
326)
327(assert_invalid
328 (module
329 (func $i32x4.min_u-arg-empty (result v128)
330 (i32x4.min_u)
331 )
332 )
333 "type mismatch"
334)
335(assert_invalid
336 (module
337 (func $i32x4.max_s-1st-arg-empty (result v128)
338 (i32x4.max_s (v128.const i32x4 0 0 0 0))
339 )
340 )
341 "type mismatch"
342)
343(assert_invalid
344 (module
345 (func $i32x4.max_s-arg-empty (result v128)
346 (i32x4.max_s)
347 )
348 )
349 "type mismatch"
350)
351(assert_invalid
352 (module
353 (func $i32x4.max_u-1st-arg-empty (result v128)
354 (i32x4.max_u (v128.const i32x4 0 0 0 0))
355 )
356 )
357 "type mismatch"
358)
359(assert_invalid
360 (module
361 (func $i32x4.max_u-arg-empty (result v128)
362 (i32x4.max_u)
363 )
364 )
365 "type mismatch"
366)
367(assert_invalid
368 (module
369 (func $i32x4.abs-arg-empty (result v128)
370 (i32x4.abs)
371 )
372 )
373 "type mismatch"
374)
375
376;; Combination
377(module
378 (func (export "i32x4.min_s-i32x4.max_u") (param v128 v128 v128) (result v128) (i32x4.min_s (i32x4.max_u (local.get 0) (local.get 1))(local.get 2)))
379 (func (export "i32x4.min_s-i32x4.max_s") (param v128 v128 v128) (result v128) (i32x4.min_s (i32x4.max_s (local.get 0) (local.get 1))(local.get 2)))
380 (func (export "i32x4.min_s-i32x4.min_u") (param v128 v128 v128) (result v128) (i32x4.min_s (i32x4.min_u (local.get 0) (local.get 1))(local.get 2)))
381 (func (export "i32x4.min_s-i32x4.min_s") (param v128 v128 v128) (result v128) (i32x4.min_s (i32x4.min_s (local.get 0) (local.get 1))(local.get 2)))
382 (func (export "i32x4.min_s-i32x4.abs") (param v128 v128) (result v128) (i32x4.min_s (i32x4.abs (local.get 0))(local.get 1)))
383 (func (export "i32x4.abs-i32x4.min_s") (param v128 v128) (result v128) (i32x4.abs (i32x4.min_s (local.get 0) (local.get 1))))
384 (func (export "i32x4.min_u-i32x4.max_u") (param v128 v128 v128) (result v128) (i32x4.min_u (i32x4.max_u (local.get 0) (local.get 1))(local.get 2)))
385 (func (export "i32x4.min_u-i32x4.max_s") (param v128 v128 v128) (result v128) (i32x4.min_u (i32x4.max_s (local.get 0) (local.get 1))(local.get 2)))
386 (func (export "i32x4.min_u-i32x4.min_u") (param v128 v128 v128) (result v128) (i32x4.min_u (i32x4.min_u (local.get 0) (local.get 1))(local.get 2)))
387 (func (export "i32x4.min_u-i32x4.min_s") (param v128 v128 v128) (result v128) (i32x4.min_u (i32x4.min_s (local.get 0) (local.get 1))(local.get 2)))
388 (func (export "i32x4.min_u-i32x4.abs") (param v128 v128) (result v128) (i32x4.min_u (i32x4.abs (local.get 0))(local.get 1)))
389 (func (export "i32x4.abs-i32x4.min_u") (param v128 v128) (result v128) (i32x4.abs (i32x4.min_u (local.get 0) (local.get 1))))
390 (func (export "i32x4.max_s-i32x4.max_u") (param v128 v128 v128) (result v128) (i32x4.max_s (i32x4.max_u (local.get 0) (local.get 1))(local.get 2)))
391 (func (export "i32x4.max_s-i32x4.max_s") (param v128 v128 v128) (result v128) (i32x4.max_s (i32x4.max_s (local.get 0) (local.get 1))(local.get 2)))
392 (func (export "i32x4.max_s-i32x4.min_u") (param v128 v128 v128) (result v128) (i32x4.max_s (i32x4.min_u (local.get 0) (local.get 1))(local.get 2)))
393 (func (export "i32x4.max_s-i32x4.min_s") (param v128 v128 v128) (result v128) (i32x4.max_s (i32x4.min_s (local.get 0) (local.get 1))(local.get 2)))
394 (func (export "i32x4.max_s-i32x4.abs") (param v128 v128) (result v128) (i32x4.max_s (i32x4.abs (local.get 0))(local.get 1)))
395 (func (export "i32x4.abs-i32x4.max_s") (param v128 v128) (result v128) (i32x4.abs (i32x4.max_s (local.get 0) (local.get 1))))
396 (func (export "i32x4.max_u-i32x4.max_u") (param v128 v128 v128) (result v128) (i32x4.max_u (i32x4.max_u (local.get 0) (local.get 1))(local.get 2)))
397 (func (export "i32x4.max_u-i32x4.max_s") (param v128 v128 v128) (result v128) (i32x4.max_u (i32x4.max_s (local.get 0) (local.get 1))(local.get 2)))
398 (func (export "i32x4.max_u-i32x4.min_u") (param v128 v128 v128) (result v128) (i32x4.max_u (i32x4.min_u (local.get 0) (local.get 1))(local.get 2)))
399 (func (export "i32x4.max_u-i32x4.min_s") (param v128 v128 v128) (result v128) (i32x4.max_u (i32x4.min_s (local.get 0) (local.get 1))(local.get 2)))
400 (func (export "i32x4.max_u-i32x4.abs") (param v128 v128) (result v128) (i32x4.max_u (i32x4.abs (local.get 0))(local.get 1)))
401 (func (export "i32x4.abs-i32x4.max_u") (param v128 v128) (result v128) (i32x4.abs (i32x4.max_u (local.get 0) (local.get 1))))
402 (func (export "i32x4.abs-i32x4.abs") (param v128) (result v128) (i32x4.abs (i32x4.abs (local.get 0))))
403)
404
405(assert_return (invoke "i32x4.min_s-i32x4.max_u" (v128.const i32x4 0 0 0 0)
406 (v128.const i32x4 1 1 1 1)
407 (v128.const i32x4 2 2 2 2))
408 (v128.const i32x4 1 1 1 1))
409(assert_return (invoke "i32x4.min_s-i32x4.max_s" (v128.const i32x4 0 0 0 0)
410 (v128.const i32x4 1 1 1 1)
411 (v128.const i32x4 2 2 2 2))
412 (v128.const i32x4 1 1 1 1))
413(assert_return (invoke "i32x4.min_s-i32x4.min_u" (v128.const i32x4 0 0 0 0)
414 (v128.const i32x4 1 1 1 1)
415 (v128.const i32x4 2 2 2 2))
416 (v128.const i32x4 0 0 0 0))
417(assert_return (invoke "i32x4.min_s-i32x4.min_s" (v128.const i32x4 0 0 0 0)
418 (v128.const i32x4 1 1 1 1)
419 (v128.const i32x4 2 2 2 2))
420 (v128.const i32x4 0 0 0 0))
421(assert_return (invoke "i32x4.min_s-i32x4.abs" (v128.const i32x4 -1 -1 -1 -1)
422 (v128.const i32x4 0 0 0 0))
423 (v128.const i32x4 0 0 0 0))
424(assert_return (invoke "i32x4.abs-i32x4.min_s" (v128.const i32x4 0 0 0 0)
425 (v128.const i32x4 -1 -1 -1 -1))
426 (v128.const i32x4 1 1 1 1))
427(assert_return (invoke "i32x4.min_u-i32x4.max_u" (v128.const i32x4 0 0 0 0)
428 (v128.const i32x4 1 1 1 1)
429 (v128.const i32x4 2 2 2 2))
430 (v128.const i32x4 1 1 1 1))
431(assert_return (invoke "i32x4.min_u-i32x4.max_s" (v128.const i32x4 0 0 0 0)
432 (v128.const i32x4 1 1 1 1)
433 (v128.const i32x4 2 2 2 2))
434 (v128.const i32x4 1 1 1 1))
435(assert_return (invoke "i32x4.min_u-i32x4.min_u" (v128.const i32x4 0 0 0 0)
436 (v128.const i32x4 1 1 1 1)
437 (v128.const i32x4 2 2 2 2))
438 (v128.const i32x4 0 0 0 0))
439(assert_return (invoke "i32x4.min_u-i32x4.min_s" (v128.const i32x4 0 0 0 0)
440 (v128.const i32x4 1 1 1 1)
441 (v128.const i32x4 2 2 2 2))
442 (v128.const i32x4 0 0 0 0))
443(assert_return (invoke "i32x4.min_u-i32x4.abs" (v128.const i32x4 -1 -1 -1 -1)
444 (v128.const i32x4 0 0 0 0))
445 (v128.const i32x4 0 0 0 0))
446(assert_return (invoke "i32x4.abs-i32x4.min_u" (v128.const i32x4 0 0 0 0)
447 (v128.const i32x4 -1 -1 -1 -1))
448 (v128.const i32x4 0 0 0 0))
449(assert_return (invoke "i32x4.max_s-i32x4.max_u" (v128.const i32x4 0 0 0 0)
450 (v128.const i32x4 1 1 1 1)
451 (v128.const i32x4 2 2 2 2))
452 (v128.const i32x4 2 2 2 2))
453(assert_return (invoke "i32x4.max_s-i32x4.max_s" (v128.const i32x4 0 0 0 0)
454 (v128.const i32x4 1 1 1 1)
455 (v128.const i32x4 2 2 2 2))
456 (v128.const i32x4 2 2 2 2))
457(assert_return (invoke "i32x4.max_s-i32x4.min_u" (v128.const i32x4 0 0 0 0)
458 (v128.const i32x4 1 1 1 1)
459 (v128.const i32x4 2 2 2 2))
460 (v128.const i32x4 2 2 2 2))
461(assert_return (invoke "i32x4.max_s-i32x4.min_s" (v128.const i32x4 0 0 0 0)
462 (v128.const i32x4 1 1 1 1)
463 (v128.const i32x4 2 2 2 2))
464 (v128.const i32x4 2 2 2 2))
465(assert_return (invoke "i32x4.max_s-i32x4.abs" (v128.const i32x4 -1 -1 -1 -1)
466 (v128.const i32x4 0 0 0 0))
467 (v128.const i32x4 1 1 1 1))
468(assert_return (invoke "i32x4.abs-i32x4.max_s" (v128.const i32x4 0 0 0 0)
469 (v128.const i32x4 -1 -1 -1 -1))
470 (v128.const i32x4 0 0 0 0))
471(assert_return (invoke "i32x4.max_u-i32x4.max_u" (v128.const i32x4 0 0 0 0)
472 (v128.const i32x4 1 1 1 1)
473 (v128.const i32x4 2 2 2 2))
474 (v128.const i32x4 2 2 2 2))
475(assert_return (invoke "i32x4.max_u-i32x4.max_s" (v128.const i32x4 0 0 0 0)
476 (v128.const i32x4 1 1 1 1)
477 (v128.const i32x4 2 2 2 2))
478 (v128.const i32x4 2 2 2 2))
479(assert_return (invoke "i32x4.max_u-i32x4.min_u" (v128.const i32x4 0 0 0 0)
480 (v128.const i32x4 1 1 1 1)
481 (v128.const i32x4 2 2 2 2))
482 (v128.const i32x4 2 2 2 2))
483(assert_return (invoke "i32x4.max_u-i32x4.min_s" (v128.const i32x4 0 0 0 0)
484 (v128.const i32x4 1 1 1 1)
485 (v128.const i32x4 2 2 2 2))
486 (v128.const i32x4 2 2 2 2))
487(assert_return (invoke "i32x4.max_u-i32x4.abs" (v128.const i32x4 -1 -1 -1 -1)
488 (v128.const i32x4 0 0 0 0))
489 (v128.const i32x4 1 1 1 1))
490(assert_return (invoke "i32x4.abs-i32x4.max_u" (v128.const i32x4 0 0 0 0)
491 (v128.const i32x4 -1 -1 -1 -1))
492 (v128.const i32x4 1 1 1 1))
493(assert_return (invoke "i32x4.abs-i32x4.abs" (v128.const i32x4 -1 -1 -1 -1))
494 (v128.const i32x4 1 1 1 1))
View as plain text