|
1 | 1 | ;; Test all the boolean operators on major boundary values and all special values. |
2 | 2 |
|
3 | 3 | (module |
4 | | - (func (export "i8x16.any_true") (param $0 v128) (result i32) (i8x16.any_true (local.get $0))) |
| 4 | + (func (export "i8x16.any_true") (param $0 v128) (result i32) (v128.any_true (local.get $0))) |
5 | 5 | (func (export "i8x16.all_true") (param $0 v128) (result i32) (i8x16.all_true (local.get $0))) |
6 | 6 | (func (export "i8x16.bitmask") (param $0 v128) (result i32) (i8x16.bitmask (local.get $0))) |
7 | 7 |
|
8 | | - (func (export "i16x8.any_true") (param $0 v128) (result i32) (i16x8.any_true (local.get $0))) |
| 8 | + (func (export "i16x8.any_true") (param $0 v128) (result i32) (v128.any_true (local.get $0))) |
9 | 9 | (func (export "i16x8.all_true") (param $0 v128) (result i32) (i16x8.all_true (local.get $0))) |
10 | 10 | (func (export "i16x8.bitmask") (param $0 v128) (result i32) (i16x8.bitmask (local.get $0))) |
11 | 11 |
|
12 | | - (func (export "i32x4.any_true") (param $0 v128) (result i32) (i32x4.any_true (local.get $0))) |
| 12 | + (func (export "i32x4.any_true") (param $0 v128) (result i32) (v128.any_true (local.get $0))) |
13 | 13 | (func (export "i32x4.all_true") (param $0 v128) (result i32) (i32x4.all_true (local.get $0))) |
14 | 14 | (func (export "i32x4.bitmask") (param $0 v128) (result i32) (i32x4.bitmask (local.get $0))) |
15 | 15 | ) |
|
161 | 161 | (module (memory 1) |
162 | 162 | ;; as if condition |
163 | 163 | (func (export "i8x16_any_true_as_if_cond") (param v128) (result i32) |
164 | | - (if (result i32) (i8x16.any_true (local.get 0)) |
| 164 | + (if (result i32) (v128.any_true (local.get 0)) |
165 | 165 | (then (i32.const 1)) |
166 | 166 | (else (i32.const 0)) |
167 | 167 | ) |
168 | 168 | ) |
169 | 169 | (func (export "i16x8_any_true_as_if_cond") (param v128) (result i32) |
170 | | - (if (result i32) (i16x8.any_true (local.get 0)) |
| 170 | + (if (result i32) (v128.any_true (local.get 0)) |
171 | 171 | (then (i32.const 1)) |
172 | 172 | (else (i32.const 0)) |
173 | 173 | ) |
174 | 174 | ) |
175 | 175 | (func (export "i32x4_any_true_as_if_cond") (param v128) (result i32) |
176 | | - (if (result i32) (i32x4.any_true (local.get 0)) |
| 176 | + (if (result i32) (v128.any_true (local.get 0)) |
177 | 177 | (then (i32.const 1)) |
178 | 178 | (else (i32.const 0)) |
179 | 179 | ) |
|
198 | 198 | ) |
199 | 199 | ;; any_true as select condition |
200 | 200 | (func (export "i8x16_any_true_as_select_cond") (param v128) (result i32) |
201 | | - (select (i32.const 1) (i32.const 0) (i8x16.any_true (local.get 0))) |
| 201 | + (select (i32.const 1) (i32.const 0) (v128.any_true (local.get 0))) |
202 | 202 | ) |
203 | 203 | (func (export "i16x8_any_true_as_select_cond") (param v128) (result i32) |
204 | | - (select (i32.const 1) (i32.const 0) (i16x8.any_true (local.get 0))) |
| 204 | + (select (i32.const 1) (i32.const 0) (v128.any_true (local.get 0))) |
205 | 205 | ) |
206 | 206 | (func (export "i32x4_any_true_as_select_cond") (param v128) (result i32) |
207 | | - (select (i32.const 1) (i32.const 0) (i32x4.any_true (local.get 0))) |
| 207 | + (select (i32.const 1) (i32.const 0) (v128.any_true (local.get 0))) |
208 | 208 | ) |
209 | 209 | ;; all_true as select condition |
210 | 210 | (func (export "i8x16_all_true_as_select_cond") (param v128) (result i32) |
|
222 | 222 | (local.set $1 (i32.const 2)) |
223 | 223 | (block |
224 | 224 | (local.set $1 (i32.const 1)) |
225 | | - (br_if 0 (i8x16.any_true (local.get $0))) |
| 225 | + (br_if 0 (v128.any_true (local.get $0))) |
226 | 226 | (local.set $1 (i32.const 0)) |
227 | 227 | ) |
228 | 228 | (local.get $1) |
|
232 | 232 | (local.set $1 (i32.const 2)) |
233 | 233 | (block |
234 | 234 | (local.set $1 (i32.const 1)) |
235 | | - (br_if 0 (i16x8.any_true (local.get $0))) |
| 235 | + (br_if 0 (v128.any_true (local.get $0))) |
236 | 236 | (local.set $1 (i32.const 0)) |
237 | 237 | ) |
238 | 238 | (local.get $1) |
|
242 | 242 | (local.set $1 (i32.const 2)) |
243 | 243 | (block |
244 | 244 | (local.set $1 (i32.const 1)) |
245 | | - (br_if 0 (i32x4.any_true (local.get $0))) |
| 245 | + (br_if 0 (v128.any_true (local.get $0))) |
246 | 246 | (local.set $1 (i32.const 0)) |
247 | 247 | ) |
248 | 248 | (local.get $1) |
|
280 | 280 | ) |
281 | 281 | ;; any_true as i32.and operand |
282 | 282 | (func (export "i8x16_any_true_as_i32.and_operand") (param $0 v128) (param $1 v128) (result i32) |
283 | | - (i32.and (i8x16.any_true (local.get $0)) (i8x16.any_true (local.get $1))) |
| 283 | + (i32.and (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
284 | 284 | ) |
285 | 285 | (func (export "i16x8_any_true_as_i32.and_operand") (param $0 v128) (param $1 v128) (result i32) |
286 | | - (i32.and (i16x8.any_true (local.get $0)) (i16x8.any_true (local.get $1))) |
| 286 | + (i32.and (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
287 | 287 | ) |
288 | 288 | (func (export "i32x4_any_true_as_i32.and_operand") (param $0 v128) (param $1 v128) (result i32) |
289 | | - (i32.and (i32x4.any_true (local.get $0)) (i32x4.any_true (local.get $1))) |
| 289 | + (i32.and (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
290 | 290 | ) |
291 | 291 | ;; any_true as i32.or operand |
292 | 292 | (func (export "i8x16_any_true_as_i32.or_operand") (param $0 v128) (param $1 v128) (result i32) |
293 | | - (i32.or (i8x16.any_true (local.get $0)) (i8x16.any_true (local.get $1))) |
| 293 | + (i32.or (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
294 | 294 | ) |
295 | 295 | (func (export "i16x8_any_true_as_i32.or_operand") (param $0 v128) (param $1 v128) (result i32) |
296 | | - (i32.or (i16x8.any_true (local.get $0)) (i16x8.any_true (local.get $1))) |
| 296 | + (i32.or (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
297 | 297 | ) |
298 | 298 | (func (export "i32x4_any_true_as_i32.or_operand") (param $0 v128) (param $1 v128) (result i32) |
299 | | - (i32.or (i32x4.any_true (local.get $0)) (i32x4.any_true (local.get $1))) |
| 299 | + (i32.or (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
300 | 300 | ) |
301 | 301 | ;; any_true as i32.xor operand |
302 | 302 | (func (export "i8x16_any_true_as_i32.xor_operand") (param $0 v128) (param $1 v128) (result i32) |
303 | | - (i32.xor (i8x16.any_true (local.get $0)) (i8x16.any_true (local.get $1))) |
| 303 | + (i32.xor (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
304 | 304 | ) |
305 | 305 | (func (export "i16x8_any_true_as_i32.xor_operand") (param $0 v128) (param $1 v128) (result i32) |
306 | | - (i32.xor (i16x8.any_true (local.get $0)) (i16x8.any_true (local.get $1))) |
| 306 | + (i32.xor (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
307 | 307 | ) |
308 | 308 | (func (export "i32x4_any_true_as_i32.xor_operand") (param $0 v128) (param $1 v128) (result i32) |
309 | | - (i32.xor (i32x4.any_true (local.get $0)) (i32x4.any_true (local.get $1))) |
| 309 | + (i32.xor (v128.any_true (local.get $0)) (v128.any_true (local.get $1))) |
310 | 310 | ) |
311 | 311 | ;; all_true as i32.and operand |
312 | 312 | (func (export "i8x16_all_true_as_i32.and_operand") (param $0 v128) (param $1 v128) (result i32) |
|
340 | 340 | ) |
341 | 341 | ;; any_true with v128.not |
342 | 342 | (func (export "i8x16_any_true_with_v128.not") (param $0 v128) (result i32) |
343 | | - (i8x16.any_true (v128.not (local.get $0))) |
| 343 | + (v128.any_true (v128.not (local.get $0))) |
344 | 344 | ) |
345 | 345 | (func (export "i16x8_any_true_with_v128.not") (param $0 v128) (result i32) |
346 | | - (i16x8.any_true (v128.not (local.get $0))) |
| 346 | + (v128.any_true (v128.not (local.get $0))) |
347 | 347 | ) |
348 | 348 | (func (export "i32x4_any_true_with_v128.not") (param $0 v128) (result i32) |
349 | | - (i32x4.any_true (v128.not (local.get $0))) |
| 349 | + (v128.any_true (v128.not (local.get $0))) |
350 | 350 | ) |
351 | 351 | ;; any_true with v128.and |
352 | 352 | (func (export "i8x16_any_true_with_v128.and") (param $0 v128) (param $1 v128) (result i32) |
353 | | - (i8x16.any_true (v128.and (local.get $0) (local.get $1))) |
| 353 | + (v128.any_true (v128.and (local.get $0) (local.get $1))) |
354 | 354 | ) |
355 | 355 | (func (export "i16x8_any_true_with_v128.and") (param $0 v128) (param $1 v128) (result i32) |
356 | | - (i16x8.any_true (v128.and (local.get $0) (local.get $1))) |
| 356 | + (v128.any_true (v128.and (local.get $0) (local.get $1))) |
357 | 357 | ) |
358 | 358 | (func (export "i32x4_any_true_with_v128.and") (param $0 v128) (param $1 v128) (result i32) |
359 | | - (i32x4.any_true (v128.and (local.get $0) (local.get $1))) |
| 359 | + (v128.any_true (v128.and (local.get $0) (local.get $1))) |
360 | 360 | ) |
361 | 361 | ;; any_true with v128.or |
362 | 362 | (func (export "i8x16_any_true_with_v128.or") (param $0 v128) (param $1 v128) (result i32) |
363 | | - (i8x16.any_true (v128.or (local.get $0) (local.get $1))) |
| 363 | + (v128.any_true (v128.or (local.get $0) (local.get $1))) |
364 | 364 | ) |
365 | 365 | (func (export "i16x8_any_true_with_v128.or") (param $0 v128) (param $1 v128) (result i32) |
366 | | - (i16x8.any_true (v128.or (local.get $0) (local.get $1))) |
| 366 | + (v128.any_true (v128.or (local.get $0) (local.get $1))) |
367 | 367 | ) |
368 | 368 | (func (export "i32x4_any_true_with_v128.or") (param $0 v128) (param $1 v128) (result i32) |
369 | | - (i32x4.any_true (v128.or (local.get $0) (local.get $1))) |
| 369 | + (v128.any_true (v128.or (local.get $0) (local.get $1))) |
370 | 370 | ) |
371 | 371 | ;; any_true with v128.xor |
372 | 372 | (func (export "i8x16_any_true_with_v128.xor") (param $0 v128) (param $1 v128) (result i32) |
373 | | - (i8x16.any_true (v128.xor (local.get $0) (local.get $1))) |
| 373 | + (v128.any_true (v128.xor (local.get $0) (local.get $1))) |
374 | 374 | ) |
375 | 375 | (func (export "i16x8_any_true_with_v128.xor") (param $0 v128) (param $1 v128) (result i32) |
376 | | - (i16x8.any_true (v128.xor (local.get $0) (local.get $1))) |
| 376 | + (v128.any_true (v128.xor (local.get $0) (local.get $1))) |
377 | 377 | ) |
378 | 378 | (func (export "i32x4_any_true_with_v128.xor") (param $0 v128) (param $1 v128) (result i32) |
379 | | - (i32x4.any_true (v128.xor (local.get $0) (local.get $1))) |
| 379 | + (v128.any_true (v128.xor (local.get $0) (local.get $1))) |
380 | 380 | ) |
381 | 381 | ;; any_true with v128.bitselect |
382 | 382 | (func (export "i8x16_any_true_with_v128.bitselect") (param $0 v128) (param $1 v128) (param $2 v128) (result i32) |
383 | | - (i8x16.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
| 383 | + (v128.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
384 | 384 | ) |
385 | 385 | (func (export "i16x8_any_true_with_v128.bitselect") (param $0 v128) (param $1 v128) (param $2 v128) (result i32) |
386 | | - (i16x8.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
| 386 | + (v128.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
387 | 387 | ) |
388 | 388 | (func (export "i32x4_any_true_with_v128.bitselect") (param $0 v128) (param $1 v128) (param $2 v128) (result i32) |
389 | | - (i32x4.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
| 389 | + (v128.any_true (v128.bitselect (local.get $0) (local.get $1) (local.get $2))) |
390 | 390 | ) |
391 | 391 | ;; all_true with v128.not |
392 | 392 | (func (export "i8x16_all_true_with_v128.not") (param $0 v128) (result i32) |
|
965 | 965 |
|
966 | 966 | ;; Type check |
967 | 967 |
|
968 | | -(assert_invalid (module (func (result i32) (i8x16.any_true (i32.const 0)))) "type mismatch") |
| 968 | +(assert_invalid (module (func (result i32) (v128.any_true (i32.const 0)))) "type mismatch") |
969 | 969 | (assert_invalid (module (func (result i32) (i8x16.all_true (i32.const 0)))) "type mismatch") |
970 | | -(assert_invalid (module (func (result i32) (i16x8.any_true (i32.const 0)))) "type mismatch") |
| 970 | +(assert_invalid (module (func (result i32) (v128.any_true (i32.const 0)))) "type mismatch") |
971 | 971 | (assert_invalid (module (func (result i32) (i16x8.all_true (i32.const 0)))) "type mismatch") |
972 | | -(assert_invalid (module (func (result i32) (i32x4.any_true (i32.const 0)))) "type mismatch") |
| 972 | +(assert_invalid (module (func (result i32) (v128.any_true (i32.const 0)))) "type mismatch") |
973 | 973 | (assert_invalid (module (func (result i32) (i32x4.all_true (i32.const 0)))) "type mismatch") |
974 | 974 |
|
975 | 975 | ;; Unknown operators |
|
983 | 983 |
|
984 | 984 | (assert_invalid |
985 | 985 | (module |
986 | | - (func $i8x16.any_true-arg-empty (result v128) |
987 | | - (i8x16.any_true) |
| 986 | + (func $v128.any_true-arg-empty (result v128) |
| 987 | + (v128.any_true) |
988 | 988 | ) |
989 | 989 | ) |
990 | 990 | "type mismatch" |
|
999 | 999 | ) |
1000 | 1000 | (assert_invalid |
1001 | 1001 | (module |
1002 | | - (func $i16x8.any_true-arg-empty (result v128) |
1003 | | - (i16x8.any_true) |
| 1002 | + (func $v128.any_true-arg-empty (result v128) |
| 1003 | + (v128.any_true) |
1004 | 1004 | ) |
1005 | 1005 | ) |
1006 | 1006 | "type mismatch" |
|
1015 | 1015 | ) |
1016 | 1016 | (assert_invalid |
1017 | 1017 | (module |
1018 | | - (func $i32x4.any_true-arg-empty (result v128) |
1019 | | - (i32x4.any_true) |
| 1018 | + (func $v128.any_true-arg-empty (result v128) |
| 1019 | + (v128.any_true) |
1020 | 1020 | ) |
1021 | 1021 | ) |
1022 | 1022 | "type mismatch" |
|
0 commit comments