From 74475b012d5eb95d108976e1dac0af12c371c5df Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:40:49 +0800 Subject: [PATCH 01/16] fix: add tests for v128 --- tests/compiler/simd.debug.wat | 508 ++++++++++++++++++++++++-------- tests/compiler/simd.release.wat | 107 ++++++- tests/compiler/simd.ts | 85 ++++++ 3 files changed, 570 insertions(+), 130 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 5c62702d70..abcdb2ed34 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -22,11 +22,11 @@ (global $~lib/native/ASC_FEATURE_SIMD i32 (i32.const 1)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) + (global $~lib/builtins/u8.MAX_VALUE i32 (i32.const 255)) + (global $~lib/builtins/u16.MAX_VALUE i32 (i32.const 65535)) (global $~lib/builtins/i16.MAX_VALUE i32 (i32.const 32767)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) - (global $~lib/builtins/u8.MAX_VALUE i32 (i32.const 255)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $~lib/builtins/u16.MAX_VALUE i32 (i32.const 65535)) (global $~lib/memory/__data_end i32 (i32.const 188)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16572)) (global $~lib/memory/__heap_base i32 (i32.const 16572)) @@ -1879,6 +1879,266 @@ end local.get $2 call $~lib/rt/tlsf/__free + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $0 + local.get $0 + i32.const 42 + i32.store + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + local.set $1 + local.get $0 + local.get $1 + v128.load32_lane 0 + local.set $1 + local.get $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 196 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load8_lane 0 + local.set $1 + local.get $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 198 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load16_lane 0 + local.set $1 + local.get $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 200 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load32_lane 0 + local.set $1 + local.get $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 202 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load64_lane 0 + local.set $1 + local.get $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 204 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/__free + v128.const i32x4 0x3f8ccccd 0xbe800000 0x428c051f 0x40800000 + f32x4.ceil + local.set $1 + local.get $1 + f32x4.extract_lane 0 + f32.const 2 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 209 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 1 + f32.const 0 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 210 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 2 + f32.const 71 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 211 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 3 + f32.const 4 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 212 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0x3f8ccccd 0xbe800000 0x428c051f 0x40800000 + f32x4.floor + local.set $1 + local.get $1 + f32x4.extract_lane 0 + f32.const 1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 216 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 1 + f32.const -1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 217 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 2 + f32.const 70 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 218 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f32x4.extract_lane 3 + f32.const 4 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 219 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.bitmask + i32.const 65535 + i32.eq + drop + v128.const i32x4 0x020100ff 0x06050403 0x0a090807 0x0f0d0c0b + i8x16.bitmask + i32.const 1 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i16x8.bitmask + i32.const 255 + i32.eq + drop + v128.const i32x4 0x0000ffff 0x00020001 0x000c000b 0x000f000d + i16x8.bitmask + i32.const 1 + i32.eq + drop + v128.const i32x4 0x00000001 0xffffffff 0x00000001 0xffffffff + i32x4.bitmask + i32.const 10 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i32x4.bitmask + i32.const 15 + i32.eq + drop + v128.const i32x4 0xffffffff 0x00000000 0x00000001 0x0000000f + i32x4.bitmask + i32.const 1 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i64x2.bitmask + i32.const 3 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0x0000000f 0x00000000 + i64x2.bitmask + i32.const 1 + i32.eq + drop ) (func $simd/test_i8x16 (local $0 v128) @@ -1903,7 +2163,7 @@ if i32.const 0 i32.const 160 - i32.const 206 + i32.const 291 i32.const 3 call $~lib/builtins/abort unreachable @@ -1921,7 +2181,7 @@ if i32.const 0 i32.const 160 - i32.const 208 + i32.const 293 i32.const 3 call $~lib/builtins/abort unreachable @@ -1940,7 +2200,7 @@ if i32.const 0 i32.const 160 - i32.const 210 + i32.const 295 i32.const 3 call $~lib/builtins/abort unreachable @@ -1957,7 +2217,7 @@ if i32.const 0 i32.const 160 - i32.const 211 + i32.const 296 i32.const 3 call $~lib/builtins/abort unreachable @@ -2018,7 +2278,7 @@ if i32.const 0 i32.const 160 - i32.const 252 + i32.const 337 i32.const 3 call $~lib/builtins/abort unreachable @@ -2032,7 +2292,7 @@ if i32.const 0 i32.const 160 - i32.const 257 + i32.const 342 i32.const 3 call $~lib/builtins/abort unreachable @@ -2046,7 +2306,7 @@ if i32.const 0 i32.const 160 - i32.const 258 + i32.const 343 i32.const 3 call $~lib/builtins/abort unreachable @@ -2061,7 +2321,7 @@ if i32.const 0 i32.const 160 - i32.const 259 + i32.const 344 i32.const 3 call $~lib/builtins/abort unreachable @@ -2078,7 +2338,7 @@ if i32.const 0 i32.const 160 - i32.const 260 + i32.const 345 i32.const 3 call $~lib/builtins/abort unreachable @@ -2095,7 +2355,7 @@ if i32.const 0 i32.const 160 - i32.const 265 + i32.const 350 i32.const 3 call $~lib/builtins/abort unreachable @@ -2219,7 +2479,7 @@ if i32.const 0 i32.const 160 - i32.const 303 + i32.const 388 i32.const 3 call $~lib/builtins/abort unreachable @@ -2236,7 +2496,7 @@ if i32.const 0 i32.const 160 - i32.const 304 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable @@ -2253,7 +2513,7 @@ if i32.const 0 i32.const 160 - i32.const 305 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable @@ -2270,7 +2530,7 @@ if i32.const 0 i32.const 160 - i32.const 306 + i32.const 391 i32.const 3 call $~lib/builtins/abort unreachable @@ -2287,7 +2547,7 @@ if i32.const 0 i32.const 160 - i32.const 307 + i32.const 392 i32.const 3 call $~lib/builtins/abort unreachable @@ -2304,7 +2564,7 @@ if i32.const 0 i32.const 160 - i32.const 308 + i32.const 393 i32.const 3 call $~lib/builtins/abort unreachable @@ -2321,7 +2581,7 @@ if i32.const 0 i32.const 160 - i32.const 309 + i32.const 394 i32.const 3 call $~lib/builtins/abort unreachable @@ -2338,7 +2598,7 @@ if i32.const 0 i32.const 160 - i32.const 310 + i32.const 395 i32.const 3 call $~lib/builtins/abort unreachable @@ -2355,7 +2615,7 @@ if i32.const 0 i32.const 160 - i32.const 311 + i32.const 396 i32.const 3 call $~lib/builtins/abort unreachable @@ -2372,7 +2632,7 @@ if i32.const 0 i32.const 160 - i32.const 312 + i32.const 397 i32.const 3 call $~lib/builtins/abort unreachable @@ -2417,7 +2677,7 @@ if i32.const 0 i32.const 160 - i32.const 318 + i32.const 403 i32.const 5 call $~lib/builtins/abort unreachable @@ -2436,7 +2696,7 @@ if i32.const 0 i32.const 160 - i32.const 324 + i32.const 409 i32.const 5 call $~lib/builtins/abort unreachable @@ -2452,7 +2712,7 @@ if i32.const 0 i32.const 160 - i32.const 329 + i32.const 414 i32.const 5 call $~lib/builtins/abort unreachable @@ -2479,7 +2739,7 @@ if i32.const 0 i32.const 160 - i32.const 335 + i32.const 420 i32.const 3 call $~lib/builtins/abort unreachable @@ -2497,7 +2757,7 @@ if i32.const 0 i32.const 160 - i32.const 337 + i32.const 422 i32.const 3 call $~lib/builtins/abort unreachable @@ -2516,7 +2776,7 @@ if i32.const 0 i32.const 160 - i32.const 339 + i32.const 424 i32.const 3 call $~lib/builtins/abort unreachable @@ -2533,7 +2793,7 @@ if i32.const 0 i32.const 160 - i32.const 340 + i32.const 425 i32.const 3 call $~lib/builtins/abort unreachable @@ -2550,7 +2810,7 @@ if i32.const 0 i32.const 160 - i32.const 341 + i32.const 426 i32.const 3 call $~lib/builtins/abort unreachable @@ -2611,7 +2871,7 @@ if i32.const 0 i32.const 160 - i32.const 382 + i32.const 467 i32.const 3 call $~lib/builtins/abort unreachable @@ -2625,7 +2885,7 @@ if i32.const 0 i32.const 160 - i32.const 387 + i32.const 472 i32.const 3 call $~lib/builtins/abort unreachable @@ -2639,7 +2899,7 @@ if i32.const 0 i32.const 160 - i32.const 388 + i32.const 473 i32.const 3 call $~lib/builtins/abort unreachable @@ -2654,7 +2914,7 @@ if i32.const 0 i32.const 160 - i32.const 389 + i32.const 474 i32.const 3 call $~lib/builtins/abort unreachable @@ -2671,7 +2931,7 @@ if i32.const 0 i32.const 160 - i32.const 390 + i32.const 475 i32.const 3 call $~lib/builtins/abort unreachable @@ -2688,7 +2948,7 @@ if i32.const 0 i32.const 160 - i32.const 395 + i32.const 480 i32.const 3 call $~lib/builtins/abort unreachable @@ -2812,7 +3072,7 @@ if i32.const 0 i32.const 160 - i32.const 433 + i32.const 518 i32.const 3 call $~lib/builtins/abort unreachable @@ -2829,7 +3089,7 @@ if i32.const 0 i32.const 160 - i32.const 434 + i32.const 519 i32.const 3 call $~lib/builtins/abort unreachable @@ -2846,7 +3106,7 @@ if i32.const 0 i32.const 160 - i32.const 435 + i32.const 520 i32.const 3 call $~lib/builtins/abort unreachable @@ -2863,7 +3123,7 @@ if i32.const 0 i32.const 160 - i32.const 436 + i32.const 521 i32.const 3 call $~lib/builtins/abort unreachable @@ -2880,7 +3140,7 @@ if i32.const 0 i32.const 160 - i32.const 437 + i32.const 522 i32.const 3 call $~lib/builtins/abort unreachable @@ -2897,7 +3157,7 @@ if i32.const 0 i32.const 160 - i32.const 438 + i32.const 523 i32.const 3 call $~lib/builtins/abort unreachable @@ -2914,7 +3174,7 @@ if i32.const 0 i32.const 160 - i32.const 439 + i32.const 524 i32.const 3 call $~lib/builtins/abort unreachable @@ -2931,7 +3191,7 @@ if i32.const 0 i32.const 160 - i32.const 440 + i32.const 525 i32.const 3 call $~lib/builtins/abort unreachable @@ -2948,7 +3208,7 @@ if i32.const 0 i32.const 160 - i32.const 441 + i32.const 526 i32.const 3 call $~lib/builtins/abort unreachable @@ -2965,7 +3225,7 @@ if i32.const 0 i32.const 160 - i32.const 442 + i32.const 527 i32.const 3 call $~lib/builtins/abort unreachable @@ -3080,7 +3340,7 @@ if i32.const 0 i32.const 160 - i32.const 459 + i32.const 544 i32.const 5 call $~lib/builtins/abort unreachable @@ -3096,7 +3356,7 @@ if i32.const 0 i32.const 160 - i32.const 464 + i32.const 549 i32.const 5 call $~lib/builtins/abort unreachable @@ -3156,7 +3416,7 @@ if i32.const 0 i32.const 160 - i32.const 487 + i32.const 572 i32.const 3 call $~lib/builtins/abort unreachable @@ -3174,7 +3434,7 @@ if i32.const 0 i32.const 160 - i32.const 489 + i32.const 574 i32.const 3 call $~lib/builtins/abort unreachable @@ -3193,7 +3453,7 @@ if i32.const 0 i32.const 160 - i32.const 491 + i32.const 576 i32.const 3 call $~lib/builtins/abort unreachable @@ -3210,7 +3470,7 @@ if i32.const 0 i32.const 160 - i32.const 492 + i32.const 577 i32.const 3 call $~lib/builtins/abort unreachable @@ -3227,7 +3487,7 @@ if i32.const 0 i32.const 160 - i32.const 493 + i32.const 578 i32.const 3 call $~lib/builtins/abort unreachable @@ -3288,7 +3548,7 @@ if i32.const 0 i32.const 160 - i32.const 534 + i32.const 619 i32.const 3 call $~lib/builtins/abort unreachable @@ -3301,7 +3561,7 @@ if i32.const 0 i32.const 160 - i32.const 539 + i32.const 624 i32.const 3 call $~lib/builtins/abort unreachable @@ -3314,7 +3574,7 @@ if i32.const 0 i32.const 160 - i32.const 540 + i32.const 625 i32.const 3 call $~lib/builtins/abort unreachable @@ -3331,7 +3591,7 @@ if i32.const 0 i32.const 160 - i32.const 541 + i32.const 626 i32.const 3 call $~lib/builtins/abort unreachable @@ -3348,7 +3608,7 @@ if i32.const 0 i32.const 160 - i32.const 546 + i32.const 631 i32.const 3 call $~lib/builtins/abort unreachable @@ -3428,7 +3688,7 @@ if i32.const 0 i32.const 160 - i32.const 560 + i32.const 645 i32.const 3 call $~lib/builtins/abort unreachable @@ -3445,7 +3705,7 @@ if i32.const 0 i32.const 160 - i32.const 561 + i32.const 646 i32.const 3 call $~lib/builtins/abort unreachable @@ -3462,7 +3722,7 @@ if i32.const 0 i32.const 160 - i32.const 562 + i32.const 647 i32.const 3 call $~lib/builtins/abort unreachable @@ -3479,7 +3739,7 @@ if i32.const 0 i32.const 160 - i32.const 563 + i32.const 648 i32.const 3 call $~lib/builtins/abort unreachable @@ -3496,7 +3756,7 @@ if i32.const 0 i32.const 160 - i32.const 564 + i32.const 649 i32.const 3 call $~lib/builtins/abort unreachable @@ -3513,7 +3773,7 @@ if i32.const 0 i32.const 160 - i32.const 565 + i32.const 650 i32.const 3 call $~lib/builtins/abort unreachable @@ -3530,7 +3790,7 @@ if i32.const 0 i32.const 160 - i32.const 566 + i32.const 651 i32.const 3 call $~lib/builtins/abort unreachable @@ -3547,7 +3807,7 @@ if i32.const 0 i32.const 160 - i32.const 567 + i32.const 652 i32.const 3 call $~lib/builtins/abort unreachable @@ -3564,7 +3824,7 @@ if i32.const 0 i32.const 160 - i32.const 568 + i32.const 653 i32.const 3 call $~lib/builtins/abort unreachable @@ -3581,7 +3841,7 @@ if i32.const 0 i32.const 160 - i32.const 569 + i32.const 654 i32.const 3 call $~lib/builtins/abort unreachable @@ -3680,7 +3940,7 @@ if i32.const 0 i32.const 160 - i32.const 590 + i32.const 675 i32.const 5 call $~lib/builtins/abort unreachable @@ -3696,7 +3956,7 @@ if i32.const 0 i32.const 160 - i32.const 595 + i32.const 680 i32.const 5 call $~lib/builtins/abort unreachable @@ -3749,7 +4009,7 @@ if i32.const 0 i32.const 160 - i32.const 616 + i32.const 701 i32.const 3 call $~lib/builtins/abort unreachable @@ -3767,7 +4027,7 @@ if i32.const 0 i32.const 160 - i32.const 618 + i32.const 703 i32.const 3 call $~lib/builtins/abort unreachable @@ -3786,7 +4046,7 @@ if i32.const 0 i32.const 160 - i32.const 620 + i32.const 705 i32.const 3 call $~lib/builtins/abort unreachable @@ -3803,7 +4063,7 @@ if i32.const 0 i32.const 160 - i32.const 621 + i32.const 706 i32.const 3 call $~lib/builtins/abort unreachable @@ -3820,7 +4080,7 @@ if i32.const 0 i32.const 160 - i32.const 622 + i32.const 707 i32.const 3 call $~lib/builtins/abort unreachable @@ -3836,7 +4096,7 @@ if i32.const 0 i32.const 160 - i32.const 623 + i32.const 708 i32.const 3 call $~lib/builtins/abort unreachable @@ -3849,7 +4109,7 @@ if i32.const 0 i32.const 160 - i32.const 628 + i32.const 713 i32.const 3 call $~lib/builtins/abort unreachable @@ -3862,7 +4122,7 @@ if i32.const 0 i32.const 160 - i32.const 629 + i32.const 714 i32.const 3 call $~lib/builtins/abort unreachable @@ -3879,7 +4139,7 @@ if i32.const 0 i32.const 160 - i32.const 630 + i32.const 715 i32.const 3 call $~lib/builtins/abort unreachable @@ -3896,7 +4156,7 @@ if i32.const 0 i32.const 160 - i32.const 635 + i32.const 720 i32.const 3 call $~lib/builtins/abort unreachable @@ -3969,7 +4229,7 @@ if i32.const 0 i32.const 160 - i32.const 649 + i32.const 734 i32.const 5 call $~lib/builtins/abort unreachable @@ -3985,7 +4245,7 @@ if i32.const 0 i32.const 160 - i32.const 654 + i32.const 739 i32.const 5 call $~lib/builtins/abort unreachable @@ -4030,7 +4290,7 @@ if i32.const 0 i32.const 160 - i32.const 670 + i32.const 755 i32.const 3 call $~lib/builtins/abort unreachable @@ -4048,7 +4308,7 @@ if i32.const 0 i32.const 160 - i32.const 672 + i32.const 757 i32.const 3 call $~lib/builtins/abort unreachable @@ -4067,7 +4327,7 @@ if i32.const 0 i32.const 160 - i32.const 674 + i32.const 759 i32.const 3 call $~lib/builtins/abort unreachable @@ -4084,7 +4344,7 @@ if i32.const 0 i32.const 160 - i32.const 675 + i32.const 760 i32.const 3 call $~lib/builtins/abort unreachable @@ -4101,7 +4361,7 @@ if i32.const 0 i32.const 160 - i32.const 676 + i32.const 761 i32.const 3 call $~lib/builtins/abort unreachable @@ -4122,7 +4382,7 @@ if i32.const 0 i32.const 160 - i32.const 678 + i32.const 763 i32.const 3 call $~lib/builtins/abort unreachable @@ -4139,7 +4399,7 @@ if i32.const 0 i32.const 160 - i32.const 679 + i32.const 764 i32.const 3 call $~lib/builtins/abort unreachable @@ -4155,7 +4415,7 @@ if i32.const 0 i32.const 160 - i32.const 680 + i32.const 765 i32.const 3 call $~lib/builtins/abort unreachable @@ -4168,7 +4428,7 @@ if i32.const 0 i32.const 160 - i32.const 681 + i32.const 766 i32.const 3 call $~lib/builtins/abort unreachable @@ -4181,7 +4441,7 @@ if i32.const 0 i32.const 160 - i32.const 682 + i32.const 767 i32.const 3 call $~lib/builtins/abort unreachable @@ -4198,7 +4458,7 @@ if i32.const 0 i32.const 160 - i32.const 683 + i32.const 768 i32.const 3 call $~lib/builtins/abort unreachable @@ -4215,7 +4475,7 @@ if i32.const 0 i32.const 160 - i32.const 688 + i32.const 773 i32.const 3 call $~lib/builtins/abort unreachable @@ -4246,7 +4506,7 @@ if i32.const 0 i32.const 160 - i32.const 697 + i32.const 782 i32.const 3 call $~lib/builtins/abort unreachable @@ -4263,7 +4523,7 @@ if i32.const 0 i32.const 160 - i32.const 698 + i32.const 783 i32.const 3 call $~lib/builtins/abort unreachable @@ -4280,7 +4540,7 @@ if i32.const 0 i32.const 160 - i32.const 699 + i32.const 784 i32.const 3 call $~lib/builtins/abort unreachable @@ -4297,7 +4557,7 @@ if i32.const 0 i32.const 160 - i32.const 700 + i32.const 785 i32.const 3 call $~lib/builtins/abort unreachable @@ -4314,7 +4574,7 @@ if i32.const 0 i32.const 160 - i32.const 701 + i32.const 786 i32.const 3 call $~lib/builtins/abort unreachable @@ -4331,7 +4591,7 @@ if i32.const 0 i32.const 160 - i32.const 702 + i32.const 787 i32.const 3 call $~lib/builtins/abort unreachable @@ -4348,7 +4608,7 @@ if i32.const 0 i32.const 160 - i32.const 703 + i32.const 788 i32.const 3 call $~lib/builtins/abort unreachable @@ -4365,7 +4625,7 @@ if i32.const 0 i32.const 160 - i32.const 704 + i32.const 789 i32.const 3 call $~lib/builtins/abort unreachable @@ -4381,7 +4641,7 @@ if i32.const 0 i32.const 160 - i32.const 705 + i32.const 790 i32.const 3 call $~lib/builtins/abort unreachable @@ -4439,7 +4699,7 @@ if i32.const 0 i32.const 160 - i32.const 724 + i32.const 809 i32.const 3 call $~lib/builtins/abort unreachable @@ -4457,7 +4717,7 @@ if i32.const 0 i32.const 160 - i32.const 726 + i32.const 811 i32.const 3 call $~lib/builtins/abort unreachable @@ -4476,7 +4736,7 @@ if i32.const 0 i32.const 160 - i32.const 728 + i32.const 813 i32.const 3 call $~lib/builtins/abort unreachable @@ -4493,7 +4753,7 @@ if i32.const 0 i32.const 160 - i32.const 729 + i32.const 814 i32.const 3 call $~lib/builtins/abort unreachable @@ -4510,7 +4770,7 @@ if i32.const 0 i32.const 160 - i32.const 730 + i32.const 815 i32.const 3 call $~lib/builtins/abort unreachable @@ -4531,7 +4791,7 @@ if i32.const 0 i32.const 160 - i32.const 732 + i32.const 817 i32.const 3 call $~lib/builtins/abort unreachable @@ -4548,7 +4808,7 @@ if i32.const 0 i32.const 160 - i32.const 733 + i32.const 818 i32.const 3 call $~lib/builtins/abort unreachable @@ -4564,7 +4824,7 @@ if i32.const 0 i32.const 160 - i32.const 734 + i32.const 819 i32.const 3 call $~lib/builtins/abort unreachable @@ -4577,7 +4837,7 @@ if i32.const 0 i32.const 160 - i32.const 735 + i32.const 820 i32.const 3 call $~lib/builtins/abort unreachable @@ -4590,7 +4850,7 @@ if i32.const 0 i32.const 160 - i32.const 736 + i32.const 821 i32.const 3 call $~lib/builtins/abort unreachable @@ -4607,7 +4867,7 @@ if i32.const 0 i32.const 160 - i32.const 737 + i32.const 822 i32.const 3 call $~lib/builtins/abort unreachable @@ -4624,7 +4884,7 @@ if i32.const 0 i32.const 160 - i32.const 742 + i32.const 827 i32.const 3 call $~lib/builtins/abort unreachable @@ -4655,7 +4915,7 @@ if i32.const 0 i32.const 160 - i32.const 751 + i32.const 836 i32.const 3 call $~lib/builtins/abort unreachable @@ -4672,7 +4932,7 @@ if i32.const 0 i32.const 160 - i32.const 752 + i32.const 837 i32.const 3 call $~lib/builtins/abort unreachable @@ -4689,7 +4949,7 @@ if i32.const 0 i32.const 160 - i32.const 753 + i32.const 838 i32.const 3 call $~lib/builtins/abort unreachable @@ -4706,7 +4966,7 @@ if i32.const 0 i32.const 160 - i32.const 754 + i32.const 839 i32.const 3 call $~lib/builtins/abort unreachable @@ -4723,7 +4983,7 @@ if i32.const 0 i32.const 160 - i32.const 755 + i32.const 840 i32.const 3 call $~lib/builtins/abort unreachable @@ -4740,7 +5000,7 @@ if i32.const 0 i32.const 160 - i32.const 756 + i32.const 841 i32.const 3 call $~lib/builtins/abort unreachable @@ -4757,7 +5017,7 @@ if i32.const 0 i32.const 160 - i32.const 757 + i32.const 842 i32.const 3 call $~lib/builtins/abort unreachable @@ -4774,7 +5034,7 @@ if i32.const 0 i32.const 160 - i32.const 758 + i32.const 843 i32.const 3 call $~lib/builtins/abort unreachable @@ -4790,7 +5050,7 @@ if i32.const 0 i32.const 160 - i32.const 759 + i32.const 844 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 105f61d665..b461c686e0 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -999,6 +999,7 @@ ) (func $simd/test_v128 (local $0 i32) + (local $1 v128) global.get $~lib/rt/tlsf/ROOT i32.eqz if @@ -1219,6 +1220,100 @@ end local.get $0 call $~lib/rt/tlsf/__free + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + i32.const 16 + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + local.tee $0 + i32.const 42 + i32.store + local.get $0 + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + v128.load32_lane 0 + local.tee $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 196 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load8_lane 0 + local.tee $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 198 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load16_lane 0 + local.tee $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 200 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load32_lane 0 + local.tee $1 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 202 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + v128.load64_lane 0 + v128.const i32x4 0x0000002a 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 204 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/__free ) (func $simd/test_vars_i8x16_partial (param $0 i32) (param $1 i32) (param $2 i32) (result v128) v128.const i32x4 0x03000100 0x07000504 0x0b0a0908 0x000e0d0c @@ -1396,7 +1491,7 @@ if i32.const 0 i32.const 1184 - i32.const 459 + i32.const 544 i32.const 5 call $~lib/builtins/abort unreachable @@ -1410,7 +1505,7 @@ if i32.const 0 i32.const 1184 - i32.const 464 + i32.const 549 i32.const 5 call $~lib/builtins/abort unreachable @@ -1448,7 +1543,7 @@ if i32.const 0 i32.const 1184 - i32.const 590 + i32.const 675 i32.const 5 call $~lib/builtins/abort unreachable @@ -1462,7 +1557,7 @@ if i32.const 0 i32.const 1184 - i32.const 595 + i32.const 680 i32.const 5 call $~lib/builtins/abort unreachable @@ -1494,7 +1589,7 @@ if i32.const 0 i32.const 1184 - i32.const 649 + i32.const 734 i32.const 5 call $~lib/builtins/abort unreachable @@ -1508,7 +1603,7 @@ if i32.const 0 i32.const 1184 - i32.const 654 + i32.const 739 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 80d243ebaf..21c91c55a6 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -188,6 +188,91 @@ function test_v128(): void { assert(v == i32x4(42, 0, 0, 0)); __free(ptr); } + { + let ptr = __alloc(16); + store(ptr, 42); + let v: v128 = v128(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + v = v128.load_lane(ptr, v, 0); + assert(v == i32x4(42, 0, 0, 0)); + v = v128.load8_lane(ptr, v, 0); + assert(v == v128(42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + v = v128.load16_lane(ptr, v, 0); + assert(v == i16x8(42, 0, 0, 0, 0, 0, 0, 0)); + v = v128.load32_lane(ptr, v, 0); + assert(v == i32x4(42, 0, 0, 0)); + v = v128.load64_lane(ptr, v, 0); + assert(v == i64x2(42, 0)); + __free(ptr); + } + { + let v: v128 = v128.ceil(f32x4(1.1, -0.25, 70.01, 4.0)); + assert(v128.extract_lane(v, 0) == 2.0); + assert(v128.extract_lane(v, 1) == 0.0); + assert(v128.extract_lane(v, 2) == 71.0); + assert(v128.extract_lane(v, 3) == 4.0); + } + { + let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + assert(v128.extract_lane(v, 0) == 1.0); + assert(v128.extract_lane(v, 1) == -1); + assert(v128.extract_lane(v, 2) == 70.0); + assert(v128.extract_lane(v, 3) == 4.0); + } + { + assert( + v128.bitmask(i8x16(u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE)) + == + 0x0000FFFF + ); + assert( + v128.bitmask(i8x16(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 + ); + assert( + v128.bitmask(i16x8(u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE)) + == + 0x000000FF + ); + assert( + v128.bitmask(i16x8(-1, 0, 1, 2, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 + ); + assert( + v128.bitmask(i32x4(1, -1, 1, -1)) == 10 + ); + assert( + v128.bitmask(i32x4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF)) == 0x0000000F + ); + assert( + v128.bitmask(i32x4(-1, 0, 1, 0xF)) == 1 + ); + assert( + v128.bitmask(i64x2(0xFFFFFFFF_FFFFFFFF, 0xFFFFFFFF_FFFFFFFF)) == 0x00000003 + ); + assert( + v128.bitmask(i64x2(-1, 0xF)) == 0x00000001 + ); + } // TODO: missing C-API in Binaryen (see also passes/pass.ts) // v128.load8_lane // v128.load16_lane From 11cce23ca0f1da75b7b44c61385bf442761a6cc7 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:44:47 +0800 Subject: [PATCH 02/16] fix: add tests for i8x16 --- tests/compiler/simd.debug.wat | 240 +++++++++++++++++++------------- tests/compiler/simd.release.wat | 12 +- tests/compiler/simd.ts | 49 +++++++ 3 files changed, 196 insertions(+), 105 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index abcdb2ed34..140da6a6c2 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -2717,6 +2717,48 @@ call $~lib/builtins/abort unreachable end + v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101 + i8x16.abs + v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.abs + v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.abs + v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80808080 0x80808080 0x80808080 0x80808080 + i8x16.abs + v128.const i32x4 0x80808080 0x80808080 0x80808080 0x80808080 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.bitmask + i32.const 65535 + i32.eq + drop + v128.const i32x4 0x020100ff 0x06050403 0x0a090807 0x0f0d0c0b + i8x16.bitmask + i32.const 1 + i32.eq + drop ) (func $simd/test_i16x8 (local $0 v128) @@ -2739,7 +2781,7 @@ if i32.const 0 i32.const 160 - i32.const 420 + i32.const 469 i32.const 3 call $~lib/builtins/abort unreachable @@ -2757,7 +2799,7 @@ if i32.const 0 i32.const 160 - i32.const 422 + i32.const 471 i32.const 3 call $~lib/builtins/abort unreachable @@ -2776,7 +2818,7 @@ if i32.const 0 i32.const 160 - i32.const 424 + i32.const 473 i32.const 3 call $~lib/builtins/abort unreachable @@ -2793,7 +2835,7 @@ if i32.const 0 i32.const 160 - i32.const 425 + i32.const 474 i32.const 3 call $~lib/builtins/abort unreachable @@ -2810,7 +2852,7 @@ if i32.const 0 i32.const 160 - i32.const 426 + i32.const 475 i32.const 3 call $~lib/builtins/abort unreachable @@ -2871,7 +2913,7 @@ if i32.const 0 i32.const 160 - i32.const 467 + i32.const 516 i32.const 3 call $~lib/builtins/abort unreachable @@ -2885,7 +2927,7 @@ if i32.const 0 i32.const 160 - i32.const 472 + i32.const 521 i32.const 3 call $~lib/builtins/abort unreachable @@ -2899,7 +2941,7 @@ if i32.const 0 i32.const 160 - i32.const 473 + i32.const 522 i32.const 3 call $~lib/builtins/abort unreachable @@ -2914,7 +2956,7 @@ if i32.const 0 i32.const 160 - i32.const 474 + i32.const 523 i32.const 3 call $~lib/builtins/abort unreachable @@ -2931,7 +2973,7 @@ if i32.const 0 i32.const 160 - i32.const 475 + i32.const 524 i32.const 3 call $~lib/builtins/abort unreachable @@ -2948,7 +2990,7 @@ if i32.const 0 i32.const 160 - i32.const 480 + i32.const 529 i32.const 3 call $~lib/builtins/abort unreachable @@ -3072,7 +3114,7 @@ if i32.const 0 i32.const 160 - i32.const 518 + i32.const 567 i32.const 3 call $~lib/builtins/abort unreachable @@ -3089,7 +3131,7 @@ if i32.const 0 i32.const 160 - i32.const 519 + i32.const 568 i32.const 3 call $~lib/builtins/abort unreachable @@ -3106,7 +3148,7 @@ if i32.const 0 i32.const 160 - i32.const 520 + i32.const 569 i32.const 3 call $~lib/builtins/abort unreachable @@ -3123,7 +3165,7 @@ if i32.const 0 i32.const 160 - i32.const 521 + i32.const 570 i32.const 3 call $~lib/builtins/abort unreachable @@ -3140,7 +3182,7 @@ if i32.const 0 i32.const 160 - i32.const 522 + i32.const 571 i32.const 3 call $~lib/builtins/abort unreachable @@ -3157,7 +3199,7 @@ if i32.const 0 i32.const 160 - i32.const 523 + i32.const 572 i32.const 3 call $~lib/builtins/abort unreachable @@ -3174,7 +3216,7 @@ if i32.const 0 i32.const 160 - i32.const 524 + i32.const 573 i32.const 3 call $~lib/builtins/abort unreachable @@ -3191,7 +3233,7 @@ if i32.const 0 i32.const 160 - i32.const 525 + i32.const 574 i32.const 3 call $~lib/builtins/abort unreachable @@ -3208,7 +3250,7 @@ if i32.const 0 i32.const 160 - i32.const 526 + i32.const 575 i32.const 3 call $~lib/builtins/abort unreachable @@ -3225,7 +3267,7 @@ if i32.const 0 i32.const 160 - i32.const 527 + i32.const 576 i32.const 3 call $~lib/builtins/abort unreachable @@ -3340,7 +3382,7 @@ if i32.const 0 i32.const 160 - i32.const 544 + i32.const 593 i32.const 5 call $~lib/builtins/abort unreachable @@ -3356,7 +3398,7 @@ if i32.const 0 i32.const 160 - i32.const 549 + i32.const 598 i32.const 5 call $~lib/builtins/abort unreachable @@ -3416,7 +3458,7 @@ if i32.const 0 i32.const 160 - i32.const 572 + i32.const 621 i32.const 3 call $~lib/builtins/abort unreachable @@ -3434,7 +3476,7 @@ if i32.const 0 i32.const 160 - i32.const 574 + i32.const 623 i32.const 3 call $~lib/builtins/abort unreachable @@ -3453,7 +3495,7 @@ if i32.const 0 i32.const 160 - i32.const 576 + i32.const 625 i32.const 3 call $~lib/builtins/abort unreachable @@ -3470,7 +3512,7 @@ if i32.const 0 i32.const 160 - i32.const 577 + i32.const 626 i32.const 3 call $~lib/builtins/abort unreachable @@ -3487,7 +3529,7 @@ if i32.const 0 i32.const 160 - i32.const 578 + i32.const 627 i32.const 3 call $~lib/builtins/abort unreachable @@ -3548,7 +3590,7 @@ if i32.const 0 i32.const 160 - i32.const 619 + i32.const 668 i32.const 3 call $~lib/builtins/abort unreachable @@ -3561,7 +3603,7 @@ if i32.const 0 i32.const 160 - i32.const 624 + i32.const 673 i32.const 3 call $~lib/builtins/abort unreachable @@ -3574,7 +3616,7 @@ if i32.const 0 i32.const 160 - i32.const 625 + i32.const 674 i32.const 3 call $~lib/builtins/abort unreachable @@ -3591,7 +3633,7 @@ if i32.const 0 i32.const 160 - i32.const 626 + i32.const 675 i32.const 3 call $~lib/builtins/abort unreachable @@ -3608,7 +3650,7 @@ if i32.const 0 i32.const 160 - i32.const 631 + i32.const 680 i32.const 3 call $~lib/builtins/abort unreachable @@ -3688,7 +3730,7 @@ if i32.const 0 i32.const 160 - i32.const 645 + i32.const 694 i32.const 3 call $~lib/builtins/abort unreachable @@ -3705,7 +3747,7 @@ if i32.const 0 i32.const 160 - i32.const 646 + i32.const 695 i32.const 3 call $~lib/builtins/abort unreachable @@ -3722,7 +3764,7 @@ if i32.const 0 i32.const 160 - i32.const 647 + i32.const 696 i32.const 3 call $~lib/builtins/abort unreachable @@ -3739,7 +3781,7 @@ if i32.const 0 i32.const 160 - i32.const 648 + i32.const 697 i32.const 3 call $~lib/builtins/abort unreachable @@ -3756,7 +3798,7 @@ if i32.const 0 i32.const 160 - i32.const 649 + i32.const 698 i32.const 3 call $~lib/builtins/abort unreachable @@ -3773,7 +3815,7 @@ if i32.const 0 i32.const 160 - i32.const 650 + i32.const 699 i32.const 3 call $~lib/builtins/abort unreachable @@ -3790,7 +3832,7 @@ if i32.const 0 i32.const 160 - i32.const 651 + i32.const 700 i32.const 3 call $~lib/builtins/abort unreachable @@ -3807,7 +3849,7 @@ if i32.const 0 i32.const 160 - i32.const 652 + i32.const 701 i32.const 3 call $~lib/builtins/abort unreachable @@ -3824,7 +3866,7 @@ if i32.const 0 i32.const 160 - i32.const 653 + i32.const 702 i32.const 3 call $~lib/builtins/abort unreachable @@ -3841,7 +3883,7 @@ if i32.const 0 i32.const 160 - i32.const 654 + i32.const 703 i32.const 3 call $~lib/builtins/abort unreachable @@ -3940,7 +3982,7 @@ if i32.const 0 i32.const 160 - i32.const 675 + i32.const 724 i32.const 5 call $~lib/builtins/abort unreachable @@ -3956,7 +3998,7 @@ if i32.const 0 i32.const 160 - i32.const 680 + i32.const 729 i32.const 5 call $~lib/builtins/abort unreachable @@ -4009,7 +4051,7 @@ if i32.const 0 i32.const 160 - i32.const 701 + i32.const 750 i32.const 3 call $~lib/builtins/abort unreachable @@ -4027,7 +4069,7 @@ if i32.const 0 i32.const 160 - i32.const 703 + i32.const 752 i32.const 3 call $~lib/builtins/abort unreachable @@ -4046,7 +4088,7 @@ if i32.const 0 i32.const 160 - i32.const 705 + i32.const 754 i32.const 3 call $~lib/builtins/abort unreachable @@ -4063,7 +4105,7 @@ if i32.const 0 i32.const 160 - i32.const 706 + i32.const 755 i32.const 3 call $~lib/builtins/abort unreachable @@ -4080,7 +4122,7 @@ if i32.const 0 i32.const 160 - i32.const 707 + i32.const 756 i32.const 3 call $~lib/builtins/abort unreachable @@ -4096,7 +4138,7 @@ if i32.const 0 i32.const 160 - i32.const 708 + i32.const 757 i32.const 3 call $~lib/builtins/abort unreachable @@ -4109,7 +4151,7 @@ if i32.const 0 i32.const 160 - i32.const 713 + i32.const 762 i32.const 3 call $~lib/builtins/abort unreachable @@ -4122,7 +4164,7 @@ if i32.const 0 i32.const 160 - i32.const 714 + i32.const 763 i32.const 3 call $~lib/builtins/abort unreachable @@ -4139,7 +4181,7 @@ if i32.const 0 i32.const 160 - i32.const 715 + i32.const 764 i32.const 3 call $~lib/builtins/abort unreachable @@ -4156,7 +4198,7 @@ if i32.const 0 i32.const 160 - i32.const 720 + i32.const 769 i32.const 3 call $~lib/builtins/abort unreachable @@ -4229,7 +4271,7 @@ if i32.const 0 i32.const 160 - i32.const 734 + i32.const 783 i32.const 5 call $~lib/builtins/abort unreachable @@ -4245,7 +4287,7 @@ if i32.const 0 i32.const 160 - i32.const 739 + i32.const 788 i32.const 5 call $~lib/builtins/abort unreachable @@ -4290,7 +4332,7 @@ if i32.const 0 i32.const 160 - i32.const 755 + i32.const 804 i32.const 3 call $~lib/builtins/abort unreachable @@ -4308,7 +4350,7 @@ if i32.const 0 i32.const 160 - i32.const 757 + i32.const 806 i32.const 3 call $~lib/builtins/abort unreachable @@ -4327,7 +4369,7 @@ if i32.const 0 i32.const 160 - i32.const 759 + i32.const 808 i32.const 3 call $~lib/builtins/abort unreachable @@ -4344,7 +4386,7 @@ if i32.const 0 i32.const 160 - i32.const 760 + i32.const 809 i32.const 3 call $~lib/builtins/abort unreachable @@ -4361,7 +4403,7 @@ if i32.const 0 i32.const 160 - i32.const 761 + i32.const 810 i32.const 3 call $~lib/builtins/abort unreachable @@ -4382,7 +4424,7 @@ if i32.const 0 i32.const 160 - i32.const 763 + i32.const 812 i32.const 3 call $~lib/builtins/abort unreachable @@ -4399,7 +4441,7 @@ if i32.const 0 i32.const 160 - i32.const 764 + i32.const 813 i32.const 3 call $~lib/builtins/abort unreachable @@ -4415,7 +4457,7 @@ if i32.const 0 i32.const 160 - i32.const 765 + i32.const 814 i32.const 3 call $~lib/builtins/abort unreachable @@ -4428,7 +4470,7 @@ if i32.const 0 i32.const 160 - i32.const 766 + i32.const 815 i32.const 3 call $~lib/builtins/abort unreachable @@ -4441,7 +4483,7 @@ if i32.const 0 i32.const 160 - i32.const 767 + i32.const 816 i32.const 3 call $~lib/builtins/abort unreachable @@ -4458,7 +4500,7 @@ if i32.const 0 i32.const 160 - i32.const 768 + i32.const 817 i32.const 3 call $~lib/builtins/abort unreachable @@ -4475,7 +4517,7 @@ if i32.const 0 i32.const 160 - i32.const 773 + i32.const 822 i32.const 3 call $~lib/builtins/abort unreachable @@ -4506,7 +4548,7 @@ if i32.const 0 i32.const 160 - i32.const 782 + i32.const 831 i32.const 3 call $~lib/builtins/abort unreachable @@ -4523,7 +4565,7 @@ if i32.const 0 i32.const 160 - i32.const 783 + i32.const 832 i32.const 3 call $~lib/builtins/abort unreachable @@ -4540,7 +4582,7 @@ if i32.const 0 i32.const 160 - i32.const 784 + i32.const 833 i32.const 3 call $~lib/builtins/abort unreachable @@ -4557,7 +4599,7 @@ if i32.const 0 i32.const 160 - i32.const 785 + i32.const 834 i32.const 3 call $~lib/builtins/abort unreachable @@ -4574,7 +4616,7 @@ if i32.const 0 i32.const 160 - i32.const 786 + i32.const 835 i32.const 3 call $~lib/builtins/abort unreachable @@ -4591,7 +4633,7 @@ if i32.const 0 i32.const 160 - i32.const 787 + i32.const 836 i32.const 3 call $~lib/builtins/abort unreachable @@ -4608,7 +4650,7 @@ if i32.const 0 i32.const 160 - i32.const 788 + i32.const 837 i32.const 3 call $~lib/builtins/abort unreachable @@ -4625,7 +4667,7 @@ if i32.const 0 i32.const 160 - i32.const 789 + i32.const 838 i32.const 3 call $~lib/builtins/abort unreachable @@ -4641,7 +4683,7 @@ if i32.const 0 i32.const 160 - i32.const 790 + i32.const 839 i32.const 3 call $~lib/builtins/abort unreachable @@ -4699,7 +4741,7 @@ if i32.const 0 i32.const 160 - i32.const 809 + i32.const 858 i32.const 3 call $~lib/builtins/abort unreachable @@ -4717,7 +4759,7 @@ if i32.const 0 i32.const 160 - i32.const 811 + i32.const 860 i32.const 3 call $~lib/builtins/abort unreachable @@ -4736,7 +4778,7 @@ if i32.const 0 i32.const 160 - i32.const 813 + i32.const 862 i32.const 3 call $~lib/builtins/abort unreachable @@ -4753,7 +4795,7 @@ if i32.const 0 i32.const 160 - i32.const 814 + i32.const 863 i32.const 3 call $~lib/builtins/abort unreachable @@ -4770,7 +4812,7 @@ if i32.const 0 i32.const 160 - i32.const 815 + i32.const 864 i32.const 3 call $~lib/builtins/abort unreachable @@ -4791,7 +4833,7 @@ if i32.const 0 i32.const 160 - i32.const 817 + i32.const 866 i32.const 3 call $~lib/builtins/abort unreachable @@ -4808,7 +4850,7 @@ if i32.const 0 i32.const 160 - i32.const 818 + i32.const 867 i32.const 3 call $~lib/builtins/abort unreachable @@ -4824,7 +4866,7 @@ if i32.const 0 i32.const 160 - i32.const 819 + i32.const 868 i32.const 3 call $~lib/builtins/abort unreachable @@ -4837,7 +4879,7 @@ if i32.const 0 i32.const 160 - i32.const 820 + i32.const 869 i32.const 3 call $~lib/builtins/abort unreachable @@ -4850,7 +4892,7 @@ if i32.const 0 i32.const 160 - i32.const 821 + i32.const 870 i32.const 3 call $~lib/builtins/abort unreachable @@ -4867,7 +4909,7 @@ if i32.const 0 i32.const 160 - i32.const 822 + i32.const 871 i32.const 3 call $~lib/builtins/abort unreachable @@ -4884,7 +4926,7 @@ if i32.const 0 i32.const 160 - i32.const 827 + i32.const 876 i32.const 3 call $~lib/builtins/abort unreachable @@ -4915,7 +4957,7 @@ if i32.const 0 i32.const 160 - i32.const 836 + i32.const 885 i32.const 3 call $~lib/builtins/abort unreachable @@ -4932,7 +4974,7 @@ if i32.const 0 i32.const 160 - i32.const 837 + i32.const 886 i32.const 3 call $~lib/builtins/abort unreachable @@ -4949,7 +4991,7 @@ if i32.const 0 i32.const 160 - i32.const 838 + i32.const 887 i32.const 3 call $~lib/builtins/abort unreachable @@ -4966,7 +5008,7 @@ if i32.const 0 i32.const 160 - i32.const 839 + i32.const 888 i32.const 3 call $~lib/builtins/abort unreachable @@ -4983,7 +5025,7 @@ if i32.const 0 i32.const 160 - i32.const 840 + i32.const 889 i32.const 3 call $~lib/builtins/abort unreachable @@ -5000,7 +5042,7 @@ if i32.const 0 i32.const 160 - i32.const 841 + i32.const 890 i32.const 3 call $~lib/builtins/abort unreachable @@ -5017,7 +5059,7 @@ if i32.const 0 i32.const 160 - i32.const 842 + i32.const 891 i32.const 3 call $~lib/builtins/abort unreachable @@ -5034,7 +5076,7 @@ if i32.const 0 i32.const 160 - i32.const 843 + i32.const 892 i32.const 3 call $~lib/builtins/abort unreachable @@ -5050,7 +5092,7 @@ if i32.const 0 i32.const 160 - i32.const 844 + i32.const 893 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index b461c686e0..7a0f71d1c1 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -1491,7 +1491,7 @@ if i32.const 0 i32.const 1184 - i32.const 544 + i32.const 593 i32.const 5 call $~lib/builtins/abort unreachable @@ -1505,7 +1505,7 @@ if i32.const 0 i32.const 1184 - i32.const 549 + i32.const 598 i32.const 5 call $~lib/builtins/abort unreachable @@ -1543,7 +1543,7 @@ if i32.const 0 i32.const 1184 - i32.const 675 + i32.const 724 i32.const 5 call $~lib/builtins/abort unreachable @@ -1557,7 +1557,7 @@ if i32.const 0 i32.const 1184 - i32.const 680 + i32.const 729 i32.const 5 call $~lib/builtins/abort unreachable @@ -1589,7 +1589,7 @@ if i32.const 0 i32.const 1184 - i32.const 734 + i32.const 783 i32.const 5 call $~lib/builtins/abort unreachable @@ -1603,7 +1603,7 @@ if i32.const 0 i32.const 1184 - i32.const 739 + i32.const 788 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 21c91c55a6..eba48d183b 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -413,6 +413,55 @@ function test_i8x16(): void { ); assert(i8x16.popcnt(a) == v128(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4)); } + + assert(i8x16.abs(i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)) == i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + assert(i8x16.abs(i8x16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)) == i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + assert(i8x16.abs(i8x16(u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE)) + == + i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) + ); + assert(i8x16.abs(i8x16(-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128)) + == + i8x16(i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128)) + ); + assert( + i8x16.bitmask(i8x16(u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE + ,u8.MAX_VALUE)) + == + 0x0000FFFF + ); + assert( + i8x16.bitmask(i8x16(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 + ); } function test_i16x8(): void { From 21d320aab0d93ad3adaf31cde63473b9ae0064d5 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:49:44 +0800 Subject: [PATCH 03/16] fix: add tests for i16x8 --- tests/compiler/simd.debug.wat | 194 +++++++++++++++++++------------- tests/compiler/simd.release.wat | 8 +- tests/compiler/simd.ts | 43 +++++++ 3 files changed, 165 insertions(+), 80 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 140da6a6c2..1231ad7296 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -3436,6 +3436,48 @@ local.get $0 i16x8.extmul_high_i8x16_u drop + v128.const i32x4 0x00010001 0x00010001 0x00010001 0x00010001 + i16x8.abs + v128.const i32x4 0x00010001 0x00010001 0x00010001 0x00010001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i16x8.abs + v128.const i32x4 0x00010001 0x00010001 0x00010001 0x00010001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i16x8.abs + v128.const i32x4 0x00010001 0x00010001 0x00010001 0x00010001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80008000 0x80008000 0x80008000 0x80008000 + i16x8.abs + v128.const i32x4 0x80008000 0x80008000 0x80008000 0x80008000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i16x8.bitmask + i32.const 255 + i32.eq + drop + v128.const i32x4 0x0000ffff 0x00020001 0x000c000b 0x000f000d + i16x8.bitmask + i32.const 1 + i32.eq + drop ) (func $simd/test_i32x4 (local $0 v128) @@ -3458,7 +3500,7 @@ if i32.const 0 i32.const 160 - i32.const 621 + i32.const 664 i32.const 3 call $~lib/builtins/abort unreachable @@ -3476,7 +3518,7 @@ if i32.const 0 i32.const 160 - i32.const 623 + i32.const 666 i32.const 3 call $~lib/builtins/abort unreachable @@ -3495,7 +3537,7 @@ if i32.const 0 i32.const 160 - i32.const 625 + i32.const 668 i32.const 3 call $~lib/builtins/abort unreachable @@ -3512,7 +3554,7 @@ if i32.const 0 i32.const 160 - i32.const 626 + i32.const 669 i32.const 3 call $~lib/builtins/abort unreachable @@ -3529,7 +3571,7 @@ if i32.const 0 i32.const 160 - i32.const 627 + i32.const 670 i32.const 3 call $~lib/builtins/abort unreachable @@ -3590,7 +3632,7 @@ if i32.const 0 i32.const 160 - i32.const 668 + i32.const 711 i32.const 3 call $~lib/builtins/abort unreachable @@ -3603,7 +3645,7 @@ if i32.const 0 i32.const 160 - i32.const 673 + i32.const 716 i32.const 3 call $~lib/builtins/abort unreachable @@ -3616,7 +3658,7 @@ if i32.const 0 i32.const 160 - i32.const 674 + i32.const 717 i32.const 3 call $~lib/builtins/abort unreachable @@ -3633,7 +3675,7 @@ if i32.const 0 i32.const 160 - i32.const 675 + i32.const 718 i32.const 3 call $~lib/builtins/abort unreachable @@ -3650,7 +3692,7 @@ if i32.const 0 i32.const 160 - i32.const 680 + i32.const 723 i32.const 3 call $~lib/builtins/abort unreachable @@ -3730,7 +3772,7 @@ if i32.const 0 i32.const 160 - i32.const 694 + i32.const 737 i32.const 3 call $~lib/builtins/abort unreachable @@ -3747,7 +3789,7 @@ if i32.const 0 i32.const 160 - i32.const 695 + i32.const 738 i32.const 3 call $~lib/builtins/abort unreachable @@ -3764,7 +3806,7 @@ if i32.const 0 i32.const 160 - i32.const 696 + i32.const 739 i32.const 3 call $~lib/builtins/abort unreachable @@ -3781,7 +3823,7 @@ if i32.const 0 i32.const 160 - i32.const 697 + i32.const 740 i32.const 3 call $~lib/builtins/abort unreachable @@ -3798,7 +3840,7 @@ if i32.const 0 i32.const 160 - i32.const 698 + i32.const 741 i32.const 3 call $~lib/builtins/abort unreachable @@ -3815,7 +3857,7 @@ if i32.const 0 i32.const 160 - i32.const 699 + i32.const 742 i32.const 3 call $~lib/builtins/abort unreachable @@ -3832,7 +3874,7 @@ if i32.const 0 i32.const 160 - i32.const 700 + i32.const 743 i32.const 3 call $~lib/builtins/abort unreachable @@ -3849,7 +3891,7 @@ if i32.const 0 i32.const 160 - i32.const 701 + i32.const 744 i32.const 3 call $~lib/builtins/abort unreachable @@ -3866,7 +3908,7 @@ if i32.const 0 i32.const 160 - i32.const 702 + i32.const 745 i32.const 3 call $~lib/builtins/abort unreachable @@ -3883,7 +3925,7 @@ if i32.const 0 i32.const 160 - i32.const 703 + i32.const 746 i32.const 3 call $~lib/builtins/abort unreachable @@ -3982,7 +4024,7 @@ if i32.const 0 i32.const 160 - i32.const 724 + i32.const 767 i32.const 5 call $~lib/builtins/abort unreachable @@ -3998,7 +4040,7 @@ if i32.const 0 i32.const 160 - i32.const 729 + i32.const 772 i32.const 5 call $~lib/builtins/abort unreachable @@ -4051,7 +4093,7 @@ if i32.const 0 i32.const 160 - i32.const 750 + i32.const 793 i32.const 3 call $~lib/builtins/abort unreachable @@ -4069,7 +4111,7 @@ if i32.const 0 i32.const 160 - i32.const 752 + i32.const 795 i32.const 3 call $~lib/builtins/abort unreachable @@ -4088,7 +4130,7 @@ if i32.const 0 i32.const 160 - i32.const 754 + i32.const 797 i32.const 3 call $~lib/builtins/abort unreachable @@ -4105,7 +4147,7 @@ if i32.const 0 i32.const 160 - i32.const 755 + i32.const 798 i32.const 3 call $~lib/builtins/abort unreachable @@ -4122,7 +4164,7 @@ if i32.const 0 i32.const 160 - i32.const 756 + i32.const 799 i32.const 3 call $~lib/builtins/abort unreachable @@ -4138,7 +4180,7 @@ if i32.const 0 i32.const 160 - i32.const 757 + i32.const 800 i32.const 3 call $~lib/builtins/abort unreachable @@ -4151,7 +4193,7 @@ if i32.const 0 i32.const 160 - i32.const 762 + i32.const 805 i32.const 3 call $~lib/builtins/abort unreachable @@ -4164,7 +4206,7 @@ if i32.const 0 i32.const 160 - i32.const 763 + i32.const 806 i32.const 3 call $~lib/builtins/abort unreachable @@ -4181,7 +4223,7 @@ if i32.const 0 i32.const 160 - i32.const 764 + i32.const 807 i32.const 3 call $~lib/builtins/abort unreachable @@ -4198,7 +4240,7 @@ if i32.const 0 i32.const 160 - i32.const 769 + i32.const 812 i32.const 3 call $~lib/builtins/abort unreachable @@ -4271,7 +4313,7 @@ if i32.const 0 i32.const 160 - i32.const 783 + i32.const 826 i32.const 5 call $~lib/builtins/abort unreachable @@ -4287,7 +4329,7 @@ if i32.const 0 i32.const 160 - i32.const 788 + i32.const 831 i32.const 5 call $~lib/builtins/abort unreachable @@ -4332,7 +4374,7 @@ if i32.const 0 i32.const 160 - i32.const 804 + i32.const 847 i32.const 3 call $~lib/builtins/abort unreachable @@ -4350,7 +4392,7 @@ if i32.const 0 i32.const 160 - i32.const 806 + i32.const 849 i32.const 3 call $~lib/builtins/abort unreachable @@ -4369,7 +4411,7 @@ if i32.const 0 i32.const 160 - i32.const 808 + i32.const 851 i32.const 3 call $~lib/builtins/abort unreachable @@ -4386,7 +4428,7 @@ if i32.const 0 i32.const 160 - i32.const 809 + i32.const 852 i32.const 3 call $~lib/builtins/abort unreachable @@ -4403,7 +4445,7 @@ if i32.const 0 i32.const 160 - i32.const 810 + i32.const 853 i32.const 3 call $~lib/builtins/abort unreachable @@ -4424,7 +4466,7 @@ if i32.const 0 i32.const 160 - i32.const 812 + i32.const 855 i32.const 3 call $~lib/builtins/abort unreachable @@ -4441,7 +4483,7 @@ if i32.const 0 i32.const 160 - i32.const 813 + i32.const 856 i32.const 3 call $~lib/builtins/abort unreachable @@ -4457,7 +4499,7 @@ if i32.const 0 i32.const 160 - i32.const 814 + i32.const 857 i32.const 3 call $~lib/builtins/abort unreachable @@ -4470,7 +4512,7 @@ if i32.const 0 i32.const 160 - i32.const 815 + i32.const 858 i32.const 3 call $~lib/builtins/abort unreachable @@ -4483,7 +4525,7 @@ if i32.const 0 i32.const 160 - i32.const 816 + i32.const 859 i32.const 3 call $~lib/builtins/abort unreachable @@ -4500,7 +4542,7 @@ if i32.const 0 i32.const 160 - i32.const 817 + i32.const 860 i32.const 3 call $~lib/builtins/abort unreachable @@ -4517,7 +4559,7 @@ if i32.const 0 i32.const 160 - i32.const 822 + i32.const 865 i32.const 3 call $~lib/builtins/abort unreachable @@ -4548,7 +4590,7 @@ if i32.const 0 i32.const 160 - i32.const 831 + i32.const 874 i32.const 3 call $~lib/builtins/abort unreachable @@ -4565,7 +4607,7 @@ if i32.const 0 i32.const 160 - i32.const 832 + i32.const 875 i32.const 3 call $~lib/builtins/abort unreachable @@ -4582,7 +4624,7 @@ if i32.const 0 i32.const 160 - i32.const 833 + i32.const 876 i32.const 3 call $~lib/builtins/abort unreachable @@ -4599,7 +4641,7 @@ if i32.const 0 i32.const 160 - i32.const 834 + i32.const 877 i32.const 3 call $~lib/builtins/abort unreachable @@ -4616,7 +4658,7 @@ if i32.const 0 i32.const 160 - i32.const 835 + i32.const 878 i32.const 3 call $~lib/builtins/abort unreachable @@ -4633,7 +4675,7 @@ if i32.const 0 i32.const 160 - i32.const 836 + i32.const 879 i32.const 3 call $~lib/builtins/abort unreachable @@ -4650,7 +4692,7 @@ if i32.const 0 i32.const 160 - i32.const 837 + i32.const 880 i32.const 3 call $~lib/builtins/abort unreachable @@ -4667,7 +4709,7 @@ if i32.const 0 i32.const 160 - i32.const 838 + i32.const 881 i32.const 3 call $~lib/builtins/abort unreachable @@ -4683,7 +4725,7 @@ if i32.const 0 i32.const 160 - i32.const 839 + i32.const 882 i32.const 3 call $~lib/builtins/abort unreachable @@ -4741,7 +4783,7 @@ if i32.const 0 i32.const 160 - i32.const 858 + i32.const 901 i32.const 3 call $~lib/builtins/abort unreachable @@ -4759,7 +4801,7 @@ if i32.const 0 i32.const 160 - i32.const 860 + i32.const 903 i32.const 3 call $~lib/builtins/abort unreachable @@ -4778,7 +4820,7 @@ if i32.const 0 i32.const 160 - i32.const 862 + i32.const 905 i32.const 3 call $~lib/builtins/abort unreachable @@ -4795,7 +4837,7 @@ if i32.const 0 i32.const 160 - i32.const 863 + i32.const 906 i32.const 3 call $~lib/builtins/abort unreachable @@ -4812,7 +4854,7 @@ if i32.const 0 i32.const 160 - i32.const 864 + i32.const 907 i32.const 3 call $~lib/builtins/abort unreachable @@ -4833,7 +4875,7 @@ if i32.const 0 i32.const 160 - i32.const 866 + i32.const 909 i32.const 3 call $~lib/builtins/abort unreachable @@ -4850,7 +4892,7 @@ if i32.const 0 i32.const 160 - i32.const 867 + i32.const 910 i32.const 3 call $~lib/builtins/abort unreachable @@ -4866,7 +4908,7 @@ if i32.const 0 i32.const 160 - i32.const 868 + i32.const 911 i32.const 3 call $~lib/builtins/abort unreachable @@ -4879,7 +4921,7 @@ if i32.const 0 i32.const 160 - i32.const 869 + i32.const 912 i32.const 3 call $~lib/builtins/abort unreachable @@ -4892,7 +4934,7 @@ if i32.const 0 i32.const 160 - i32.const 870 + i32.const 913 i32.const 3 call $~lib/builtins/abort unreachable @@ -4909,7 +4951,7 @@ if i32.const 0 i32.const 160 - i32.const 871 + i32.const 914 i32.const 3 call $~lib/builtins/abort unreachable @@ -4926,7 +4968,7 @@ if i32.const 0 i32.const 160 - i32.const 876 + i32.const 919 i32.const 3 call $~lib/builtins/abort unreachable @@ -4957,7 +4999,7 @@ if i32.const 0 i32.const 160 - i32.const 885 + i32.const 928 i32.const 3 call $~lib/builtins/abort unreachable @@ -4974,7 +5016,7 @@ if i32.const 0 i32.const 160 - i32.const 886 + i32.const 929 i32.const 3 call $~lib/builtins/abort unreachable @@ -4991,7 +5033,7 @@ if i32.const 0 i32.const 160 - i32.const 887 + i32.const 930 i32.const 3 call $~lib/builtins/abort unreachable @@ -5008,7 +5050,7 @@ if i32.const 0 i32.const 160 - i32.const 888 + i32.const 931 i32.const 3 call $~lib/builtins/abort unreachable @@ -5025,7 +5067,7 @@ if i32.const 0 i32.const 160 - i32.const 889 + i32.const 932 i32.const 3 call $~lib/builtins/abort unreachable @@ -5042,7 +5084,7 @@ if i32.const 0 i32.const 160 - i32.const 890 + i32.const 933 i32.const 3 call $~lib/builtins/abort unreachable @@ -5059,7 +5101,7 @@ if i32.const 0 i32.const 160 - i32.const 891 + i32.const 934 i32.const 3 call $~lib/builtins/abort unreachable @@ -5076,7 +5118,7 @@ if i32.const 0 i32.const 160 - i32.const 892 + i32.const 935 i32.const 3 call $~lib/builtins/abort unreachable @@ -5092,7 +5134,7 @@ if i32.const 0 i32.const 160 - i32.const 893 + i32.const 936 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 7a0f71d1c1..5a0ff7e22e 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -1543,7 +1543,7 @@ if i32.const 0 i32.const 1184 - i32.const 724 + i32.const 767 i32.const 5 call $~lib/builtins/abort unreachable @@ -1557,7 +1557,7 @@ if i32.const 0 i32.const 1184 - i32.const 729 + i32.const 772 i32.const 5 call $~lib/builtins/abort unreachable @@ -1589,7 +1589,7 @@ if i32.const 0 i32.const 1184 - i32.const 783 + i32.const 826 i32.const 5 call $~lib/builtins/abort unreachable @@ -1603,7 +1603,7 @@ if i32.const 0 i32.const 1184 - i32.const 788 + i32.const 831 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index eba48d183b..78e7fa95af 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -614,6 +614,49 @@ function test_i16x8(): void { i16x8.extmul_low_i8x16_u(a, a); i16x8.extmul_high_i8x16_s(a, a); i16x8.extmul_high_i8x16_u(a, a); + assert(i16x8.abs(i16x8(1, 1, 1, 1, 1, 1, 1, 1)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); + assert(i16x8.abs(i16x8(-1, -1, -1, -1, -1, -1, -1, -1)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); + assert(i16x8.abs(i16x8(u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); + assert(i16x8.abs(i16x8(-32768, + -32768, + -32768, + -32768, + -32768, + -32768, + -32768, + -32768)) + == + i16x8(i16(32768), + i16(32768), + i16(32768), + i16(32768), + i16(32768), + i16(32768), + i16(32768), + i16(32768)) + ); + assert( + i16x8.bitmask(i16x8(u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE, + u16.MAX_VALUE)) + == + 0x000000FF + ); + assert( + i16x8.bitmask(i16x8(-1, 0, 1, 2, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 + ); } function test_i32x4(): void { From 51115e2de25182e1c4fb2818f4751e2a65557a83 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:54:26 +0800 Subject: [PATCH 04/16] fix: add tests for i32x4 --- tests/compiler/simd.debug.wat | 156 +++++++++++++++++++++----------- tests/compiler/simd.release.wat | 4 +- tests/compiler/simd.ts | 13 +++ 3 files changed, 117 insertions(+), 56 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 1231ad7296..3fe32f1926 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -27,6 +27,7 @@ (global $~lib/builtins/i16.MAX_VALUE i32 (i32.const 32767)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) + (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/memory/__data_end i32 (i32.const 188)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16572)) (global $~lib/memory/__heap_base i32 (i32.const 16572)) @@ -4075,6 +4076,53 @@ local.get $0 i32x4.extmul_high_i16x8_u drop + v128.const i32x4 0x00000001 0x00000001 0x00000001 0x00000001 + i32x4.abs + v128.const i32x4 0x00000001 0x00000001 0x00000001 0x00000001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i32x4.abs + v128.const i32x4 0x00000001 0x00000001 0x00000001 0x00000001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i32x4.abs + v128.const i32x4 0x00000001 0x00000001 0x00000001 0x00000001 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000 + i32x4.abs + v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0xffffffff 0x00000001 0xffffffff + i32x4.bitmask + i32.const 10 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i32x4.bitmask + i32.const 15 + i32.eq + drop + v128.const i32x4 0xffffffff 0x00000000 0x00000001 0x0000000f + i32x4.bitmask + i32.const 1 + i32.eq + drop ) (func $simd/test_i64x2 (local $0 v128) @@ -4093,7 +4141,7 @@ if i32.const 0 i32.const 160 - i32.const 793 + i32.const 806 i32.const 3 call $~lib/builtins/abort unreachable @@ -4111,7 +4159,7 @@ if i32.const 0 i32.const 160 - i32.const 795 + i32.const 808 i32.const 3 call $~lib/builtins/abort unreachable @@ -4130,7 +4178,7 @@ if i32.const 0 i32.const 160 - i32.const 797 + i32.const 810 i32.const 3 call $~lib/builtins/abort unreachable @@ -4147,7 +4195,7 @@ if i32.const 0 i32.const 160 - i32.const 798 + i32.const 811 i32.const 3 call $~lib/builtins/abort unreachable @@ -4164,7 +4212,7 @@ if i32.const 0 i32.const 160 - i32.const 799 + i32.const 812 i32.const 3 call $~lib/builtins/abort unreachable @@ -4180,7 +4228,7 @@ if i32.const 0 i32.const 160 - i32.const 800 + i32.const 813 i32.const 3 call $~lib/builtins/abort unreachable @@ -4193,7 +4241,7 @@ if i32.const 0 i32.const 160 - i32.const 805 + i32.const 818 i32.const 3 call $~lib/builtins/abort unreachable @@ -4206,7 +4254,7 @@ if i32.const 0 i32.const 160 - i32.const 806 + i32.const 819 i32.const 3 call $~lib/builtins/abort unreachable @@ -4223,7 +4271,7 @@ if i32.const 0 i32.const 160 - i32.const 807 + i32.const 820 i32.const 3 call $~lib/builtins/abort unreachable @@ -4240,7 +4288,7 @@ if i32.const 0 i32.const 160 - i32.const 812 + i32.const 825 i32.const 3 call $~lib/builtins/abort unreachable @@ -4313,7 +4361,7 @@ if i32.const 0 i32.const 160 - i32.const 826 + i32.const 839 i32.const 5 call $~lib/builtins/abort unreachable @@ -4329,7 +4377,7 @@ if i32.const 0 i32.const 160 - i32.const 831 + i32.const 844 i32.const 5 call $~lib/builtins/abort unreachable @@ -4374,7 +4422,7 @@ if i32.const 0 i32.const 160 - i32.const 847 + i32.const 860 i32.const 3 call $~lib/builtins/abort unreachable @@ -4392,7 +4440,7 @@ if i32.const 0 i32.const 160 - i32.const 849 + i32.const 862 i32.const 3 call $~lib/builtins/abort unreachable @@ -4411,7 +4459,7 @@ if i32.const 0 i32.const 160 - i32.const 851 + i32.const 864 i32.const 3 call $~lib/builtins/abort unreachable @@ -4428,7 +4476,7 @@ if i32.const 0 i32.const 160 - i32.const 852 + i32.const 865 i32.const 3 call $~lib/builtins/abort unreachable @@ -4445,7 +4493,7 @@ if i32.const 0 i32.const 160 - i32.const 853 + i32.const 866 i32.const 3 call $~lib/builtins/abort unreachable @@ -4466,7 +4514,7 @@ if i32.const 0 i32.const 160 - i32.const 855 + i32.const 868 i32.const 3 call $~lib/builtins/abort unreachable @@ -4483,7 +4531,7 @@ if i32.const 0 i32.const 160 - i32.const 856 + i32.const 869 i32.const 3 call $~lib/builtins/abort unreachable @@ -4499,7 +4547,7 @@ if i32.const 0 i32.const 160 - i32.const 857 + i32.const 870 i32.const 3 call $~lib/builtins/abort unreachable @@ -4512,7 +4560,7 @@ if i32.const 0 i32.const 160 - i32.const 858 + i32.const 871 i32.const 3 call $~lib/builtins/abort unreachable @@ -4525,7 +4573,7 @@ if i32.const 0 i32.const 160 - i32.const 859 + i32.const 872 i32.const 3 call $~lib/builtins/abort unreachable @@ -4542,7 +4590,7 @@ if i32.const 0 i32.const 160 - i32.const 860 + i32.const 873 i32.const 3 call $~lib/builtins/abort unreachable @@ -4559,7 +4607,7 @@ if i32.const 0 i32.const 160 - i32.const 865 + i32.const 878 i32.const 3 call $~lib/builtins/abort unreachable @@ -4590,7 +4638,7 @@ if i32.const 0 i32.const 160 - i32.const 874 + i32.const 887 i32.const 3 call $~lib/builtins/abort unreachable @@ -4607,7 +4655,7 @@ if i32.const 0 i32.const 160 - i32.const 875 + i32.const 888 i32.const 3 call $~lib/builtins/abort unreachable @@ -4624,7 +4672,7 @@ if i32.const 0 i32.const 160 - i32.const 876 + i32.const 889 i32.const 3 call $~lib/builtins/abort unreachable @@ -4641,7 +4689,7 @@ if i32.const 0 i32.const 160 - i32.const 877 + i32.const 890 i32.const 3 call $~lib/builtins/abort unreachable @@ -4658,7 +4706,7 @@ if i32.const 0 i32.const 160 - i32.const 878 + i32.const 891 i32.const 3 call $~lib/builtins/abort unreachable @@ -4675,7 +4723,7 @@ if i32.const 0 i32.const 160 - i32.const 879 + i32.const 892 i32.const 3 call $~lib/builtins/abort unreachable @@ -4692,7 +4740,7 @@ if i32.const 0 i32.const 160 - i32.const 880 + i32.const 893 i32.const 3 call $~lib/builtins/abort unreachable @@ -4709,7 +4757,7 @@ if i32.const 0 i32.const 160 - i32.const 881 + i32.const 894 i32.const 3 call $~lib/builtins/abort unreachable @@ -4725,7 +4773,7 @@ if i32.const 0 i32.const 160 - i32.const 882 + i32.const 895 i32.const 3 call $~lib/builtins/abort unreachable @@ -4783,7 +4831,7 @@ if i32.const 0 i32.const 160 - i32.const 901 + i32.const 914 i32.const 3 call $~lib/builtins/abort unreachable @@ -4801,7 +4849,7 @@ if i32.const 0 i32.const 160 - i32.const 903 + i32.const 916 i32.const 3 call $~lib/builtins/abort unreachable @@ -4820,7 +4868,7 @@ if i32.const 0 i32.const 160 - i32.const 905 + i32.const 918 i32.const 3 call $~lib/builtins/abort unreachable @@ -4837,7 +4885,7 @@ if i32.const 0 i32.const 160 - i32.const 906 + i32.const 919 i32.const 3 call $~lib/builtins/abort unreachable @@ -4854,7 +4902,7 @@ if i32.const 0 i32.const 160 - i32.const 907 + i32.const 920 i32.const 3 call $~lib/builtins/abort unreachable @@ -4875,7 +4923,7 @@ if i32.const 0 i32.const 160 - i32.const 909 + i32.const 922 i32.const 3 call $~lib/builtins/abort unreachable @@ -4892,7 +4940,7 @@ if i32.const 0 i32.const 160 - i32.const 910 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -4908,7 +4956,7 @@ if i32.const 0 i32.const 160 - i32.const 911 + i32.const 924 i32.const 3 call $~lib/builtins/abort unreachable @@ -4921,7 +4969,7 @@ if i32.const 0 i32.const 160 - i32.const 912 + i32.const 925 i32.const 3 call $~lib/builtins/abort unreachable @@ -4934,7 +4982,7 @@ if i32.const 0 i32.const 160 - i32.const 913 + i32.const 926 i32.const 3 call $~lib/builtins/abort unreachable @@ -4951,7 +4999,7 @@ if i32.const 0 i32.const 160 - i32.const 914 + i32.const 927 i32.const 3 call $~lib/builtins/abort unreachable @@ -4968,7 +5016,7 @@ if i32.const 0 i32.const 160 - i32.const 919 + i32.const 932 i32.const 3 call $~lib/builtins/abort unreachable @@ -4999,7 +5047,7 @@ if i32.const 0 i32.const 160 - i32.const 928 + i32.const 941 i32.const 3 call $~lib/builtins/abort unreachable @@ -5016,7 +5064,7 @@ if i32.const 0 i32.const 160 - i32.const 929 + i32.const 942 i32.const 3 call $~lib/builtins/abort unreachable @@ -5033,7 +5081,7 @@ if i32.const 0 i32.const 160 - i32.const 930 + i32.const 943 i32.const 3 call $~lib/builtins/abort unreachable @@ -5050,7 +5098,7 @@ if i32.const 0 i32.const 160 - i32.const 931 + i32.const 944 i32.const 3 call $~lib/builtins/abort unreachable @@ -5067,7 +5115,7 @@ if i32.const 0 i32.const 160 - i32.const 932 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -5084,7 +5132,7 @@ if i32.const 0 i32.const 160 - i32.const 933 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -5101,7 +5149,7 @@ if i32.const 0 i32.const 160 - i32.const 934 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -5118,7 +5166,7 @@ if i32.const 0 i32.const 160 - i32.const 935 + i32.const 948 i32.const 3 call $~lib/builtins/abort unreachable @@ -5134,7 +5182,7 @@ if i32.const 0 i32.const 160 - i32.const 936 + i32.const 949 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 5a0ff7e22e..3fa6092278 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -1589,7 +1589,7 @@ if i32.const 0 i32.const 1184 - i32.const 826 + i32.const 839 i32.const 5 call $~lib/builtins/abort unreachable @@ -1603,7 +1603,7 @@ if i32.const 0 i32.const 1184 - i32.const 831 + i32.const 844 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 78e7fa95af..dd60ac569c 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -786,6 +786,19 @@ function test_i32x4(): void { i32x4.extmul_low_i16x8_u(a, a); i32x4.extmul_high_i16x8_s(a, a); i32x4.extmul_high_i16x8_u(a, a); + assert(i32x4.abs(i32x4(1, 1, 1, 1)) == i32x4(1, 1, 1, 1)); + assert(i32x4.abs(i32x4(-1, -1, -1, -1)) == i32x4(1, 1, 1, 1)); + assert(i32x4.abs(i32x4(u32.MAX_VALUE, u32.MAX_VALUE, u32.MAX_VALUE, u32.MAX_VALUE)) == i32x4(1, 1, 1, 1)); + assert(i32x4.abs(i32x4(-2147483648, -2147483648, -2147483648, -2147483648)) == i32x4(2147483648, 2147483648, 2147483648, 2147483648)); + assert( + i32x4.bitmask(i32x4(1, -1, 1, -1)) == 10 + ); + assert( + i32x4.bitmask(i32x4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF)) == 0x0000000F + ); + assert( + i32x4.bitmask(i32x4(-1, 0, 1, 0xF)) == 1 + ); } function test_i64x2(): void { From d49eded598c5daf5dfab431eb63c53b5655c90f2 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:56:44 +0800 Subject: [PATCH 05/16] fix: add tests for i64x2 --- tests/compiler/simd.debug.wat | 419 ++++++++++++++++++++++++++++++---- tests/compiler/simd.ts | 57 +++++ 2 files changed, 434 insertions(+), 42 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 3fe32f1926..18174029d2 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -28,6 +28,7 @@ (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) + (global $~lib/builtins/u64.MAX_VALUE i64 (i64.const -1)) (global $~lib/memory/__data_end i32 (i32.const 188)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16572)) (global $~lib/memory/__heap_base i32 (i32.const 16572)) @@ -4400,6 +4401,340 @@ local.get $0 i64x2.extmul_high_i32x4_u drop + v128.const i32x4 0x0000000c 0x00000000 0x0000000c 0x00000000 + v128.const i32x4 0x0000000c 0x00000000 0x0000000c 0x00000000 + i64x2.eq + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x0000000c 0x00000000 0x0000000c 0x00000000 + v128.const i32x4 0x0000000c 0x00000000 0x0000000d 0x00000000 + i64x2.eq + v128.const i32x4 0xffffffff 0xffffffff 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x0000000c 0x00000000 0x0000000c 0x00000000 + v128.const i32x4 0x0000000c 0x00000000 0x0000000d 0x00000000 + i64x2.ne + v128.const i32x4 0x00000000 0x00000000 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x0000000b 0x00000000 0x0000000c 0x00000000 + v128.const i32x4 0x0000000c 0x00000000 0x0000000d 0x00000000 + i64x2.ne + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000002 0x00000000 0x00000000 0x00000000 + i64x2.lt_s + v128.const i32x4 0xffffffff 0xffffffff 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000002 0x00000000 0x00000001 0x00000000 + i64x2.lt_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000002 0x00000000 0x00000000 0x00000000 + i64x2.le_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000002 0x00000000 0x00000001 0x00000000 + i64x2.le_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000002 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i64x2.gt_s + v128.const i32x4 0xffffffff 0xffffffff 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000002 0x00000000 0x00000001 0x00000000 + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i64x2.gt_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000002 0x00000000 0x00000000 0x00000000 + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i64x2.ge_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000002 0x00000000 0x00000001 0x00000000 + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i64x2.ge_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0x00000001 0x00000001 0xffffffff + i64x2.extend_low_i32x4_s + v128.const i32x4 0xffffffff 0xffffffff 0x00000001 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000001 0xffffffff + i64x2.extend_low_i32x4_s + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000001 0x00000000 0x00000000 + i64x2.extend_low_i32x4_s + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i64x2.extend_low_i32x4_s + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80000000 0x80000000 0x7fffffff 0x7fffffff + i64x2.extend_low_i32x4_s + v128.const i32x4 0x80000000 0xffffffff 0x80000000 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0x7fffffff 0x7fffffff + i64x2.extend_low_i32x4_s + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i64x2.extend_low_i32x4_u + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000001 0xffffffff + i64x2.extend_low_i32x4_u + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000001 0x00000000 0x00000000 + i64x2.extend_low_i32x4_u + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0x00000000 0x00000000 + i64x2.extend_low_i32x4_u + v128.const i32x4 0xffffffff 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000 + i64x2.extend_low_i32x4_u + v128.const i32x4 0x80000000 0x00000000 0x80000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0x7fffffff 0x7fffffff + i64x2.extend_low_i32x4_u + v128.const i32x4 0xffffffff 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0x00000001 0x00000001 0xffffffff + i64x2.extend_high_i32x4_s + v128.const i32x4 0x00000001 0x00000000 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000001 0xffffffff + i64x2.extend_high_i32x4_s + v128.const i32x4 0x00000001 0x00000000 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000001 0x00000000 0x00000000 + i64x2.extend_high_i32x4_s + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i64x2.extend_high_i32x4_s + v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80000000 0x80000000 0x7fffffff 0x7fffffff + i64x2.extend_high_i32x4_s + v128.const i32x4 0x7fffffff 0x00000000 0x7fffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0x7fffffff 0x7fffffff + i64x2.extend_high_i32x4_s + v128.const i32x4 0x7fffffff 0x00000000 0x7fffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i64x2.extend_high_i32x4_u + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0x00000001 0xffffffff + i64x2.extend_high_i32x4_u + v128.const i32x4 0x00000001 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000001 0x00000000 0x00000000 + i64x2.extend_high_i32x4_u + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x00000000 0xffffffff 0xffffffff + i64x2.extend_high_i32x4_u + v128.const i32x4 0xffffffff 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000 + i64x2.extend_high_i32x4_u + v128.const i32x4 0x80000000 0x00000000 0x80000000 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x7fffffff 0x7fffffff 0xffffffff 0xffffffff + i64x2.extend_high_i32x4_u + v128.const i32x4 0xffffffff 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i64x2.abs + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i64x2.abs + v128.const i32x4 0x00000001 0x00000000 0x00000001 0x00000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x80000000 0x00000000 0x80000000 + i64x2.abs + v128.const i32x4 0x00000000 0x80000000 0x00000000 0x80000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff + i64x2.bitmask + i32.const 3 + i32.eq + drop + v128.const i32x4 0xffffffff 0xffffffff 0x0000000f 0x00000000 + i64x2.bitmask + i32.const 1 + i32.eq + drop ) (func $simd/test_f32x4 (local $0 v128) @@ -4422,7 +4757,7 @@ if i32.const 0 i32.const 160 - i32.const 860 + i32.const 917 i32.const 3 call $~lib/builtins/abort unreachable @@ -4440,7 +4775,7 @@ if i32.const 0 i32.const 160 - i32.const 862 + i32.const 919 i32.const 3 call $~lib/builtins/abort unreachable @@ -4459,7 +4794,7 @@ if i32.const 0 i32.const 160 - i32.const 864 + i32.const 921 i32.const 3 call $~lib/builtins/abort unreachable @@ -4476,7 +4811,7 @@ if i32.const 0 i32.const 160 - i32.const 865 + i32.const 922 i32.const 3 call $~lib/builtins/abort unreachable @@ -4493,7 +4828,7 @@ if i32.const 0 i32.const 160 - i32.const 866 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -4514,7 +4849,7 @@ if i32.const 0 i32.const 160 - i32.const 868 + i32.const 925 i32.const 3 call $~lib/builtins/abort unreachable @@ -4531,7 +4866,7 @@ if i32.const 0 i32.const 160 - i32.const 869 + i32.const 926 i32.const 3 call $~lib/builtins/abort unreachable @@ -4547,7 +4882,7 @@ if i32.const 0 i32.const 160 - i32.const 870 + i32.const 927 i32.const 3 call $~lib/builtins/abort unreachable @@ -4560,7 +4895,7 @@ if i32.const 0 i32.const 160 - i32.const 871 + i32.const 928 i32.const 3 call $~lib/builtins/abort unreachable @@ -4573,7 +4908,7 @@ if i32.const 0 i32.const 160 - i32.const 872 + i32.const 929 i32.const 3 call $~lib/builtins/abort unreachable @@ -4590,7 +4925,7 @@ if i32.const 0 i32.const 160 - i32.const 873 + i32.const 930 i32.const 3 call $~lib/builtins/abort unreachable @@ -4607,7 +4942,7 @@ if i32.const 0 i32.const 160 - i32.const 878 + i32.const 935 i32.const 3 call $~lib/builtins/abort unreachable @@ -4638,7 +4973,7 @@ if i32.const 0 i32.const 160 - i32.const 887 + i32.const 944 i32.const 3 call $~lib/builtins/abort unreachable @@ -4655,7 +4990,7 @@ if i32.const 0 i32.const 160 - i32.const 888 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -4672,7 +5007,7 @@ if i32.const 0 i32.const 160 - i32.const 889 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -4689,7 +5024,7 @@ if i32.const 0 i32.const 160 - i32.const 890 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -4706,7 +5041,7 @@ if i32.const 0 i32.const 160 - i32.const 891 + i32.const 948 i32.const 3 call $~lib/builtins/abort unreachable @@ -4723,7 +5058,7 @@ if i32.const 0 i32.const 160 - i32.const 892 + i32.const 949 i32.const 3 call $~lib/builtins/abort unreachable @@ -4740,7 +5075,7 @@ if i32.const 0 i32.const 160 - i32.const 893 + i32.const 950 i32.const 3 call $~lib/builtins/abort unreachable @@ -4757,7 +5092,7 @@ if i32.const 0 i32.const 160 - i32.const 894 + i32.const 951 i32.const 3 call $~lib/builtins/abort unreachable @@ -4773,7 +5108,7 @@ if i32.const 0 i32.const 160 - i32.const 895 + i32.const 952 i32.const 3 call $~lib/builtins/abort unreachable @@ -4831,7 +5166,7 @@ if i32.const 0 i32.const 160 - i32.const 914 + i32.const 971 i32.const 3 call $~lib/builtins/abort unreachable @@ -4849,7 +5184,7 @@ if i32.const 0 i32.const 160 - i32.const 916 + i32.const 973 i32.const 3 call $~lib/builtins/abort unreachable @@ -4868,7 +5203,7 @@ if i32.const 0 i32.const 160 - i32.const 918 + i32.const 975 i32.const 3 call $~lib/builtins/abort unreachable @@ -4885,7 +5220,7 @@ if i32.const 0 i32.const 160 - i32.const 919 + i32.const 976 i32.const 3 call $~lib/builtins/abort unreachable @@ -4902,7 +5237,7 @@ if i32.const 0 i32.const 160 - i32.const 920 + i32.const 977 i32.const 3 call $~lib/builtins/abort unreachable @@ -4923,7 +5258,7 @@ if i32.const 0 i32.const 160 - i32.const 922 + i32.const 979 i32.const 3 call $~lib/builtins/abort unreachable @@ -4940,7 +5275,7 @@ if i32.const 0 i32.const 160 - i32.const 923 + i32.const 980 i32.const 3 call $~lib/builtins/abort unreachable @@ -4956,7 +5291,7 @@ if i32.const 0 i32.const 160 - i32.const 924 + i32.const 981 i32.const 3 call $~lib/builtins/abort unreachable @@ -4969,7 +5304,7 @@ if i32.const 0 i32.const 160 - i32.const 925 + i32.const 982 i32.const 3 call $~lib/builtins/abort unreachable @@ -4982,7 +5317,7 @@ if i32.const 0 i32.const 160 - i32.const 926 + i32.const 983 i32.const 3 call $~lib/builtins/abort unreachable @@ -4999,7 +5334,7 @@ if i32.const 0 i32.const 160 - i32.const 927 + i32.const 984 i32.const 3 call $~lib/builtins/abort unreachable @@ -5016,7 +5351,7 @@ if i32.const 0 i32.const 160 - i32.const 932 + i32.const 989 i32.const 3 call $~lib/builtins/abort unreachable @@ -5047,7 +5382,7 @@ if i32.const 0 i32.const 160 - i32.const 941 + i32.const 998 i32.const 3 call $~lib/builtins/abort unreachable @@ -5064,7 +5399,7 @@ if i32.const 0 i32.const 160 - i32.const 942 + i32.const 999 i32.const 3 call $~lib/builtins/abort unreachable @@ -5081,7 +5416,7 @@ if i32.const 0 i32.const 160 - i32.const 943 + i32.const 1000 i32.const 3 call $~lib/builtins/abort unreachable @@ -5098,7 +5433,7 @@ if i32.const 0 i32.const 160 - i32.const 944 + i32.const 1001 i32.const 3 call $~lib/builtins/abort unreachable @@ -5115,7 +5450,7 @@ if i32.const 0 i32.const 160 - i32.const 945 + i32.const 1002 i32.const 3 call $~lib/builtins/abort unreachable @@ -5132,7 +5467,7 @@ if i32.const 0 i32.const 160 - i32.const 946 + i32.const 1003 i32.const 3 call $~lib/builtins/abort unreachable @@ -5149,7 +5484,7 @@ if i32.const 0 i32.const 160 - i32.const 947 + i32.const 1004 i32.const 3 call $~lib/builtins/abort unreachable @@ -5166,7 +5501,7 @@ if i32.const 0 i32.const 160 - i32.const 948 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -5182,7 +5517,7 @@ if i32.const 0 i32.const 160 - i32.const 949 + i32.const 1006 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index dd60ac569c..0aa9454e00 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -853,6 +853,63 @@ function test_i64x2(): void { i64x2.extmul_low_i32x4_u(a, a); i64x2.extmul_high_i32x4_s(a, a); i64x2.extmul_high_i32x4_u(a, a); + assert(i64x2.eq(i64x2(12, 12),i64x2(12, 12)) == i64x2(-1, -1)); + assert(i64x2.eq(i64x2(12, 12),i64x2(12, 13)) == i64x2(-1, 0)); + assert(i64x2.ne(i64x2(12, 12),i64x2(12, 13)) == i64x2(0, -1)); + assert(i64x2.ne(i64x2(11, 12),i64x2(12, 13)) == i64x2(-1, -1)); + assert(i64x2.lt_s(i64x2(1, 0), i64x2(2, 0)) == i64x2(-1, 0)); + assert(i64x2.lt_s(i64x2(1, 0), i64x2(2, 1)) == i64x2(-1, -1)); + assert(i64x2.le_s(i64x2(1, 0), i64x2(2, 0)) == i64x2(-1, -1)); + assert(i64x2.le_s(i64x2(1, 0), i64x2(2, 1)) == i64x2(-1, -1)); + assert(i64x2.gt_s(i64x2(2, 0), i64x2(1, 0)) == i64x2(-1, 0)); + assert(i64x2.gt_s(i64x2(2, 1), i64x2(1, 0)) == i64x2(-1, -1)); + assert(i64x2.ge_s(i64x2(2, 0), i64x2(1, 0)) == i64x2(-1, -1)); + assert(i64x2.ge_s(i64x2(2, 1), i64x2(1, 0)) == i64x2(-1, -1)); + assert(i64x2.extend_low_i32x4_s(i32x4(-1, 1, 1, -1)) == i64x2(-1, 1)); + assert(i64x2.extend_low_i32x4_s(i32x4(0, 0, 1, -1)) == i64x2(0, 0)); + assert(i64x2.extend_low_i32x4_s(i32x4(1, 1, 0, 0)) == i64x2(1, 1)); + assert(i64x2.extend_low_i32x4_s(i32x4(1, 0, 1, 0)) == i64x2(1, 0)); + assert(i64x2.extend_low_i32x4_s(i32x4(-2147483648, -2147483648, 2147483647, 2147483647)) == i64x2(-2147483648, -2147483648)); + assert(i64x2.extend_low_i32x4_s(i32x4(-1, -1, 2147483647, 2147483647)) == i64x2(-1, -1)); + assert(i64x2.extend_low_i32x4_u(i32x4(0, 0, 0, 0)) == i64x2(0, 0)); + assert(i64x2.extend_low_i32x4_u(i32x4(0, 0, 1, -1)) == i64x2(0, 0)); + assert(i64x2.extend_low_i32x4_u(i32x4(1, 1, 0, 0)) == i64x2(1, 1)); + assert(i64x2.extend_low_i32x4_u(i32x4(-1, -1, 0, 0)) == i64x2(4294967295, 4294967295)); + assert(i64x2.extend_low_i32x4_u(i32x4(-2147483648, -2147483648, -2147483648, -2147483648)) + == + i64x2(2147483648, 2147483648) + ); + assert(i64x2.extend_low_i32x4_u(i32x4(-1, -1, 2147483647, 2147483647)) + == + i64x2(4294967295, 4294967295) + ); + assert(i64x2.extend_high_i32x4_s(i32x4(-1, 1, 1, -1)) == i64x2(1, -1)); + assert(i64x2.extend_high_i32x4_s(i32x4(0, 0, 1, -1)) == i64x2(1, -1)); + assert(i64x2.extend_high_i32x4_s(i32x4(1, 1, 0, 0)) == i64x2(0, 0)); + assert(i64x2.extend_high_i32x4_s(i32x4(1, 0, 1, 0)) == i64x2(1, 0)); + assert(i64x2.extend_high_i32x4_s(i32x4(-2147483648, -2147483648, 2147483647, 2147483647)) == i64x2(2147483647, 2147483647)); + assert(i64x2.extend_high_i32x4_s(i32x4(-1, -1, 2147483647, 2147483647)) == i64x2(2147483647, 2147483647)); + assert(i64x2.extend_high_i32x4_u(i32x4(0, 0, 0, 0)) == i64x2(0, 0)); + assert(i64x2.extend_high_i32x4_u(i32x4(0, 0, 1, -1)) == i64x2(1, 4294967295)); + assert(i64x2.extend_high_i32x4_u(i32x4(1, 1, 0, 0)) == i64x2(0, 0)); + assert(i64x2.extend_high_i32x4_u(i32x4(0, 0, -1, -1)) == i64x2(4294967295, 4294967295)); + assert(i64x2.extend_high_i32x4_u(i32x4(-2147483648, -2147483648, -2147483648, -2147483648)) + == + i64x2(2147483648, 2147483648) + ); + assert(i64x2.extend_high_i32x4_u(i32x4(2147483647, 2147483647, -1, -1)) + == + i64x2(4294967295, 4294967295) + ); + assert(i64x2.abs(i64x2(1, 1)) == i64x2(1, 1)); + assert(i64x2.abs(i64x2(u64.MAX_VALUE, u64.MAX_VALUE)) == i64x2(1, 1)); + assert(i64x2.abs(i64x2(-9223372036854775808, -9223372036854775808)) == i64x2(9223372036854775808, 9223372036854775808)); + assert( + i64x2.bitmask(i64x2(0xFFFFFFFF_FFFFFFFF, 0xFFFFFFFF_FFFFFFFF)) == 0x00000003 + ); + assert( + i64x2.bitmask(i64x2(-1, 0xF)) == 0x00000001 + ); } function test_f32x4(): void { From 7cfdf7126c5d35bcd4397dcfa2d6bdc630993ee3 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 14:58:58 +0800 Subject: [PATCH 06/16] fix: add tests for f32x4 --- tests/compiler/simd.debug.wat | 187 ++++++++++++++++++++++++++++++---- tests/compiler/simd.ts | 34 +++++++ 2 files changed, 200 insertions(+), 21 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 18174029d2..b2169d3540 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -4745,6 +4745,7 @@ (local $5 v128) (local $6 v128) (local $7 v128) + (local $8 v128) v128.const i32x4 0x3fc00000 0x40200000 0x40600000 0x40900000 local.set $0 local.get $0 @@ -5144,6 +5145,150 @@ local.get $0 f32x4.demote_f64x2_zero drop + v128.const i32x4 0x3f800000 0xbf800000 0x3f800000 0xbf800000 + v128.const i32x4 0xbf800000 0x3f800000 0xbf800000 0x3f800000 + f32x4.pmin + v128.const i32x4 0xbf800000 0xbf800000 0xbf800000 0xbf800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x3f800000 0xbf800000 0x3f800000 0xbf800000 + v128.const i32x4 0xbf800000 0x3f800000 0xbf800000 0x3f800000 + f32x4.pmax + v128.const i32x4 0x3f800000 0x3f800000 0x3f800000 0x3f800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x3f8ccccd 0xbe800000 0x428c051f 0x40800000 + f32x4.ceil + local.set $8 + local.get $8 + f32x4.extract_lane 0 + f32.const 2 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 979 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 1 + f32.const 0 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 980 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 2 + f32.const 71 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 981 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 3 + f32.const 4 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 982 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0x3f8ccccd 0xbe800000 0x428c051f 0x40800000 + f32x4.floor + local.set $8 + local.get $8 + f32x4.extract_lane 0 + f32.const 1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 986 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 1 + f32.const -1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 987 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 2 + f32.const 70 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 988 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f32x4.extract_lane 3 + f32.const 4 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 989 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0x3f8ccccd 0x40200000 0x4079999a 0x40800000 + f32x4.trunc + v128.const i32x4 0x3f800000 0x40000000 0x40400000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x3f8ccccd 0x40200000 0x4060a3d7 0x40800000 + f32x4.nearest + v128.const i32x4 0x3f800000 0x40000000 0x40800000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop ) (func $simd/test_f64x2 (local $0 v128) @@ -5166,7 +5311,7 @@ if i32.const 0 i32.const 160 - i32.const 971 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -5184,7 +5329,7 @@ if i32.const 0 i32.const 160 - i32.const 973 + i32.const 1007 i32.const 3 call $~lib/builtins/abort unreachable @@ -5203,7 +5348,7 @@ if i32.const 0 i32.const 160 - i32.const 975 + i32.const 1009 i32.const 3 call $~lib/builtins/abort unreachable @@ -5220,7 +5365,7 @@ if i32.const 0 i32.const 160 - i32.const 976 + i32.const 1010 i32.const 3 call $~lib/builtins/abort unreachable @@ -5237,7 +5382,7 @@ if i32.const 0 i32.const 160 - i32.const 977 + i32.const 1011 i32.const 3 call $~lib/builtins/abort unreachable @@ -5258,7 +5403,7 @@ if i32.const 0 i32.const 160 - i32.const 979 + i32.const 1013 i32.const 3 call $~lib/builtins/abort unreachable @@ -5275,7 +5420,7 @@ if i32.const 0 i32.const 160 - i32.const 980 + i32.const 1014 i32.const 3 call $~lib/builtins/abort unreachable @@ -5291,7 +5436,7 @@ if i32.const 0 i32.const 160 - i32.const 981 + i32.const 1015 i32.const 3 call $~lib/builtins/abort unreachable @@ -5304,7 +5449,7 @@ if i32.const 0 i32.const 160 - i32.const 982 + i32.const 1016 i32.const 3 call $~lib/builtins/abort unreachable @@ -5317,7 +5462,7 @@ if i32.const 0 i32.const 160 - i32.const 983 + i32.const 1017 i32.const 3 call $~lib/builtins/abort unreachable @@ -5334,7 +5479,7 @@ if i32.const 0 i32.const 160 - i32.const 984 + i32.const 1018 i32.const 3 call $~lib/builtins/abort unreachable @@ -5351,7 +5496,7 @@ if i32.const 0 i32.const 160 - i32.const 989 + i32.const 1023 i32.const 3 call $~lib/builtins/abort unreachable @@ -5382,7 +5527,7 @@ if i32.const 0 i32.const 160 - i32.const 998 + i32.const 1032 i32.const 3 call $~lib/builtins/abort unreachable @@ -5399,7 +5544,7 @@ if i32.const 0 i32.const 160 - i32.const 999 + i32.const 1033 i32.const 3 call $~lib/builtins/abort unreachable @@ -5416,7 +5561,7 @@ if i32.const 0 i32.const 160 - i32.const 1000 + i32.const 1034 i32.const 3 call $~lib/builtins/abort unreachable @@ -5433,7 +5578,7 @@ if i32.const 0 i32.const 160 - i32.const 1001 + i32.const 1035 i32.const 3 call $~lib/builtins/abort unreachable @@ -5450,7 +5595,7 @@ if i32.const 0 i32.const 160 - i32.const 1002 + i32.const 1036 i32.const 3 call $~lib/builtins/abort unreachable @@ -5467,7 +5612,7 @@ if i32.const 0 i32.const 160 - i32.const 1003 + i32.const 1037 i32.const 3 call $~lib/builtins/abort unreachable @@ -5484,7 +5629,7 @@ if i32.const 0 i32.const 160 - i32.const 1004 + i32.const 1038 i32.const 3 call $~lib/builtins/abort unreachable @@ -5501,7 +5646,7 @@ if i32.const 0 i32.const 160 - i32.const 1005 + i32.const 1039 i32.const 3 call $~lib/builtins/abort unreachable @@ -5517,7 +5662,7 @@ if i32.const 0 i32.const 160 - i32.const 1006 + i32.const 1040 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 0aa9454e00..f030c8fd9b 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -964,6 +964,40 @@ function test_f32x4(): void { // TODO: unimp in Binaryen's interpreter f32x4.demote_f64x2_zero(a); + assert( + f32x4.pmin(f32x4(1, -1, 1, -1), f32x4(-1, 1, -1, 1)) + == + f32x4(-1, -1, -1, -1) + ); + assert( + f32x4.pmax(f32x4(1, -1, 1, -1), f32x4(-1, 1, -1, 1)) + == + f32x4(1, 1, 1, 1) + ); + { + let v: v128 = f32x4.ceil(f32x4(1.1, -0.25, 70.01, 4.0)); + assert(v128.extract_lane(v, 0) == 2.0); + assert(v128.extract_lane(v, 1) == 0.0); + assert(v128.extract_lane(v, 2) == 71.0); + assert(v128.extract_lane(v, 3) == 4.0); + } + { + let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + assert(v128.extract_lane(v, 0) == 1.0); + assert(v128.extract_lane(v, 1) == -1); + assert(v128.extract_lane(v, 2) == 70.0); + assert(v128.extract_lane(v, 3) == 4.0); + } + assert( + f32x4.trunc(f32x4(1.1, 2.5, 3.9, 4.0)) + == + f32x4(1.0, 2.0, 3.0, 4.0) + ); + assert( + f32x4.nearest(f32x4(1.1, 2.5, 3.51, 4.0)) + == + f32x4(1.0, 2.0, 4.0, 4.0) + ); } function test_f64x2(): void { From 0e322ffe24890246e7ccde74f0f96e4e65ef0375 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 15:00:53 +0800 Subject: [PATCH 07/16] fix: add tests for f64x2 --- tests/compiler/simd.debug.wat | 93 +++++++++++++++++++++++++++++++++++ tests/compiler/simd.ts | 30 +++++++++++ 2 files changed, 123 insertions(+) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index b2169d3540..202764aa05 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -5299,6 +5299,7 @@ (local $5 v128) (local $6 v128) (local $7 v128) + (local $8 v128) v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x40040000 local.set $0 local.get $0 @@ -5684,6 +5685,98 @@ local.get $0 f64x2.promote_low_f32x4 drop + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0xbff00000 + v128.const i32x4 0x00000000 0xbff00000 0x00000000 0x3ff00000 + f64x2.pmin + v128.const i32x4 0x00000000 0xbff00000 0x00000000 0xbff00000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0xbff00000 + v128.const i32x4 0x00000000 0xbff00000 0x00000000 0x3ff00000 + f64x2.pmax + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x3ff00000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x9999999a 0x3ff19999 0x00000000 0xbfd00000 + f64x2.ceil + local.set $8 + local.get $8 + f64x2.extract_lane 0 + f64.const 2 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 1059 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f64x2.extract_lane 1 + f64.const 0 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 1060 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0x9999999a 0x3ff19999 0x00000000 0xbfd00000 + f64x2.floor + local.set $8 + local.get $8 + f64x2.extract_lane 0 + f64.const 1 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 1064 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $8 + f64x2.extract_lane 1 + f64.const -1 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 160 + i32.const 1065 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + v128.const i32x4 0x9999999a 0x3ff19999 0x33333333 0x400f3333 + f64x2.trunc + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x40080000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop + v128.const i32x4 0x9999999a 0x3ff19999 0xe147ae14 0x400c147a + f64x2.nearest + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x40100000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + drop ) (func $simd/test_const (result v128) (local $0 v128) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index f030c8fd9b..4c563f53d9 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -1044,6 +1044,36 @@ function test_f64x2(): void { f64x2.convert_low_i32x4_s(a); f64x2.convert_low_i32x4_u(a); f64x2.promote_low_f32x4(a); + assert( + f64x2.pmin(f64x2(1, -1), f64x2(-1, 1)) + == + f64x2(-1, -1) + ); + assert( + f64x2.pmax(f64x2(1, -1), f64x2(-1, 1)) + == + f64x2(1, 1) + ); + { + let v: v128 = f64x2.ceil(f64x2(1.1, -0.25)); + assert(v128.extract_lane(v, 0) == 2.0); + assert(v128.extract_lane(v, 1) == 0.0); + } + { + let v: v128 =f64x2.floor(f64x2(1.1, -0.25)) + assert(v128.extract_lane(v, 0) == 1.0); + assert(v128.extract_lane(v, 1) == -1); + } + assert( + f64x2.trunc(f64x2(1.1, 3.9)) + == + f64x2(1.0, 3.0) + ); + assert( + f64x2.nearest(f64x2(1.1, 3.51)) + == + f64x2(1.0, 4.0) + ); } function test_const(): v128 { From 90ab72afd364fd96485366df8d176ef634dbfbdd Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 16:28:49 +0800 Subject: [PATCH 08/16] fix format issue --- tests/compiler/simd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 4c563f53d9..cdc908d25c 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -212,7 +212,7 @@ function test_v128(): void { assert(v128.extract_lane(v, 3) == 4.0); } { - let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)); assert(v128.extract_lane(v, 0) == 1.0); assert(v128.extract_lane(v, 1) == -1); assert(v128.extract_lane(v, 2) == 70.0); From 688db3a86f47beddcd5e3282e821f69ea50c64d6 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Mon, 8 Aug 2022 16:39:24 +0800 Subject: [PATCH 09/16] fix missing semicolon issue --- tests/compiler/simd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index cdc908d25c..bd034e4df9 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -982,7 +982,7 @@ function test_f32x4(): void { assert(v128.extract_lane(v, 3) == 4.0); } { - let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)); assert(v128.extract_lane(v, 0) == 1.0); assert(v128.extract_lane(v, 1) == -1); assert(v128.extract_lane(v, 2) == 70.0); @@ -1060,7 +1060,7 @@ function test_f64x2(): void { assert(v128.extract_lane(v, 1) == 0.0); } { - let v: v128 =f64x2.floor(f64x2(1.1, -0.25)) + let v: v128 =f64x2.floor(f64x2(1.1, -0.25)); assert(v128.extract_lane(v, 0) == 1.0); assert(v128.extract_lane(v, 1) == -1); } From 931ef239aa55fc63bde80d2ce11e1bb6367ab057 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 10:18:42 +0800 Subject: [PATCH 10/16] fix for review suggestions --- tests/compiler/simd.debug.wat | 309 ++++++++++++++------------------ tests/compiler/simd.release.wat | 12 +- tests/compiler/simd.ts | 96 +++++----- 3 files changed, 187 insertions(+), 230 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 202764aa05..abdaeaa5d5 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -2165,7 +2165,7 @@ if i32.const 0 i32.const 160 - i32.const 291 + i32.const 288 i32.const 3 call $~lib/builtins/abort unreachable @@ -2183,7 +2183,7 @@ if i32.const 0 i32.const 160 - i32.const 293 + i32.const 290 i32.const 3 call $~lib/builtins/abort unreachable @@ -2202,7 +2202,7 @@ if i32.const 0 i32.const 160 - i32.const 295 + i32.const 292 i32.const 3 call $~lib/builtins/abort unreachable @@ -2219,7 +2219,7 @@ if i32.const 0 i32.const 160 - i32.const 296 + i32.const 293 i32.const 3 call $~lib/builtins/abort unreachable @@ -2280,7 +2280,7 @@ if i32.const 0 i32.const 160 - i32.const 337 + i32.const 334 i32.const 3 call $~lib/builtins/abort unreachable @@ -2294,7 +2294,7 @@ if i32.const 0 i32.const 160 - i32.const 342 + i32.const 339 i32.const 3 call $~lib/builtins/abort unreachable @@ -2308,7 +2308,7 @@ if i32.const 0 i32.const 160 - i32.const 343 + i32.const 340 i32.const 3 call $~lib/builtins/abort unreachable @@ -2323,7 +2323,7 @@ if i32.const 0 i32.const 160 - i32.const 344 + i32.const 341 i32.const 3 call $~lib/builtins/abort unreachable @@ -2340,7 +2340,7 @@ if i32.const 0 i32.const 160 - i32.const 345 + i32.const 342 i32.const 3 call $~lib/builtins/abort unreachable @@ -2357,7 +2357,7 @@ if i32.const 0 i32.const 160 - i32.const 350 + i32.const 347 i32.const 3 call $~lib/builtins/abort unreachable @@ -2481,7 +2481,7 @@ if i32.const 0 i32.const 160 - i32.const 388 + i32.const 385 i32.const 3 call $~lib/builtins/abort unreachable @@ -2498,7 +2498,7 @@ if i32.const 0 i32.const 160 - i32.const 389 + i32.const 386 i32.const 3 call $~lib/builtins/abort unreachable @@ -2515,7 +2515,7 @@ if i32.const 0 i32.const 160 - i32.const 390 + i32.const 387 i32.const 3 call $~lib/builtins/abort unreachable @@ -2532,7 +2532,7 @@ if i32.const 0 i32.const 160 - i32.const 391 + i32.const 388 i32.const 3 call $~lib/builtins/abort unreachable @@ -2549,7 +2549,7 @@ if i32.const 0 i32.const 160 - i32.const 392 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable @@ -2566,7 +2566,7 @@ if i32.const 0 i32.const 160 - i32.const 393 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable @@ -2583,7 +2583,7 @@ if i32.const 0 i32.const 160 - i32.const 394 + i32.const 391 i32.const 3 call $~lib/builtins/abort unreachable @@ -2600,7 +2600,7 @@ if i32.const 0 i32.const 160 - i32.const 395 + i32.const 392 i32.const 3 call $~lib/builtins/abort unreachable @@ -2617,7 +2617,7 @@ if i32.const 0 i32.const 160 - i32.const 396 + i32.const 393 i32.const 3 call $~lib/builtins/abort unreachable @@ -2634,7 +2634,7 @@ if i32.const 0 i32.const 160 - i32.const 397 + i32.const 394 i32.const 3 call $~lib/builtins/abort unreachable @@ -2679,7 +2679,7 @@ if i32.const 0 i32.const 160 - i32.const 403 + i32.const 400 i32.const 5 call $~lib/builtins/abort unreachable @@ -2698,7 +2698,7 @@ if i32.const 0 i32.const 160 - i32.const 409 + i32.const 406 i32.const 5 call $~lib/builtins/abort unreachable @@ -2714,7 +2714,7 @@ if i32.const 0 i32.const 160 - i32.const 414 + i32.const 411 i32.const 5 call $~lib/builtins/abort unreachable @@ -2783,7 +2783,7 @@ if i32.const 0 i32.const 160 - i32.const 469 + i32.const 466 i32.const 3 call $~lib/builtins/abort unreachable @@ -2801,7 +2801,7 @@ if i32.const 0 i32.const 160 - i32.const 471 + i32.const 468 i32.const 3 call $~lib/builtins/abort unreachable @@ -2820,7 +2820,7 @@ if i32.const 0 i32.const 160 - i32.const 473 + i32.const 470 i32.const 3 call $~lib/builtins/abort unreachable @@ -2837,7 +2837,7 @@ if i32.const 0 i32.const 160 - i32.const 474 + i32.const 471 i32.const 3 call $~lib/builtins/abort unreachable @@ -2854,7 +2854,7 @@ if i32.const 0 i32.const 160 - i32.const 475 + i32.const 472 i32.const 3 call $~lib/builtins/abort unreachable @@ -2915,7 +2915,7 @@ if i32.const 0 i32.const 160 - i32.const 516 + i32.const 513 i32.const 3 call $~lib/builtins/abort unreachable @@ -2929,7 +2929,7 @@ if i32.const 0 i32.const 160 - i32.const 521 + i32.const 518 i32.const 3 call $~lib/builtins/abort unreachable @@ -2943,7 +2943,7 @@ if i32.const 0 i32.const 160 - i32.const 522 + i32.const 519 i32.const 3 call $~lib/builtins/abort unreachable @@ -2958,7 +2958,7 @@ if i32.const 0 i32.const 160 - i32.const 523 + i32.const 520 i32.const 3 call $~lib/builtins/abort unreachable @@ -2975,7 +2975,7 @@ if i32.const 0 i32.const 160 - i32.const 524 + i32.const 521 i32.const 3 call $~lib/builtins/abort unreachable @@ -2992,7 +2992,7 @@ if i32.const 0 i32.const 160 - i32.const 529 + i32.const 526 i32.const 3 call $~lib/builtins/abort unreachable @@ -3116,7 +3116,7 @@ if i32.const 0 i32.const 160 - i32.const 567 + i32.const 564 i32.const 3 call $~lib/builtins/abort unreachable @@ -3133,7 +3133,7 @@ if i32.const 0 i32.const 160 - i32.const 568 + i32.const 565 i32.const 3 call $~lib/builtins/abort unreachable @@ -3150,7 +3150,7 @@ if i32.const 0 i32.const 160 - i32.const 569 + i32.const 566 i32.const 3 call $~lib/builtins/abort unreachable @@ -3167,7 +3167,7 @@ if i32.const 0 i32.const 160 - i32.const 570 + i32.const 567 i32.const 3 call $~lib/builtins/abort unreachable @@ -3184,7 +3184,7 @@ if i32.const 0 i32.const 160 - i32.const 571 + i32.const 568 i32.const 3 call $~lib/builtins/abort unreachable @@ -3201,7 +3201,7 @@ if i32.const 0 i32.const 160 - i32.const 572 + i32.const 569 i32.const 3 call $~lib/builtins/abort unreachable @@ -3218,7 +3218,7 @@ if i32.const 0 i32.const 160 - i32.const 573 + i32.const 570 i32.const 3 call $~lib/builtins/abort unreachable @@ -3235,7 +3235,7 @@ if i32.const 0 i32.const 160 - i32.const 574 + i32.const 571 i32.const 3 call $~lib/builtins/abort unreachable @@ -3252,7 +3252,7 @@ if i32.const 0 i32.const 160 - i32.const 575 + i32.const 572 i32.const 3 call $~lib/builtins/abort unreachable @@ -3269,7 +3269,7 @@ if i32.const 0 i32.const 160 - i32.const 576 + i32.const 573 i32.const 3 call $~lib/builtins/abort unreachable @@ -3384,7 +3384,7 @@ if i32.const 0 i32.const 160 - i32.const 593 + i32.const 590 i32.const 5 call $~lib/builtins/abort unreachable @@ -3400,7 +3400,7 @@ if i32.const 0 i32.const 160 - i32.const 598 + i32.const 595 i32.const 5 call $~lib/builtins/abort unreachable @@ -3502,7 +3502,7 @@ if i32.const 0 i32.const 160 - i32.const 664 + i32.const 661 i32.const 3 call $~lib/builtins/abort unreachable @@ -3520,7 +3520,7 @@ if i32.const 0 i32.const 160 - i32.const 666 + i32.const 663 i32.const 3 call $~lib/builtins/abort unreachable @@ -3539,7 +3539,7 @@ if i32.const 0 i32.const 160 - i32.const 668 + i32.const 665 i32.const 3 call $~lib/builtins/abort unreachable @@ -3556,7 +3556,7 @@ if i32.const 0 i32.const 160 - i32.const 669 + i32.const 666 i32.const 3 call $~lib/builtins/abort unreachable @@ -3573,7 +3573,7 @@ if i32.const 0 i32.const 160 - i32.const 670 + i32.const 667 i32.const 3 call $~lib/builtins/abort unreachable @@ -3634,7 +3634,7 @@ if i32.const 0 i32.const 160 - i32.const 711 + i32.const 708 i32.const 3 call $~lib/builtins/abort unreachable @@ -3647,7 +3647,7 @@ if i32.const 0 i32.const 160 - i32.const 716 + i32.const 713 i32.const 3 call $~lib/builtins/abort unreachable @@ -3660,7 +3660,7 @@ if i32.const 0 i32.const 160 - i32.const 717 + i32.const 714 i32.const 3 call $~lib/builtins/abort unreachable @@ -3677,7 +3677,7 @@ if i32.const 0 i32.const 160 - i32.const 718 + i32.const 715 i32.const 3 call $~lib/builtins/abort unreachable @@ -3694,7 +3694,7 @@ if i32.const 0 i32.const 160 - i32.const 723 + i32.const 720 i32.const 3 call $~lib/builtins/abort unreachable @@ -3774,7 +3774,7 @@ if i32.const 0 i32.const 160 - i32.const 737 + i32.const 734 i32.const 3 call $~lib/builtins/abort unreachable @@ -3791,7 +3791,7 @@ if i32.const 0 i32.const 160 - i32.const 738 + i32.const 735 i32.const 3 call $~lib/builtins/abort unreachable @@ -3808,7 +3808,7 @@ if i32.const 0 i32.const 160 - i32.const 739 + i32.const 736 i32.const 3 call $~lib/builtins/abort unreachable @@ -3825,7 +3825,7 @@ if i32.const 0 i32.const 160 - i32.const 740 + i32.const 737 i32.const 3 call $~lib/builtins/abort unreachable @@ -3842,7 +3842,7 @@ if i32.const 0 i32.const 160 - i32.const 741 + i32.const 738 i32.const 3 call $~lib/builtins/abort unreachable @@ -3859,7 +3859,7 @@ if i32.const 0 i32.const 160 - i32.const 742 + i32.const 739 i32.const 3 call $~lib/builtins/abort unreachable @@ -3876,7 +3876,7 @@ if i32.const 0 i32.const 160 - i32.const 743 + i32.const 740 i32.const 3 call $~lib/builtins/abort unreachable @@ -3893,7 +3893,7 @@ if i32.const 0 i32.const 160 - i32.const 744 + i32.const 741 i32.const 3 call $~lib/builtins/abort unreachable @@ -3910,7 +3910,7 @@ if i32.const 0 i32.const 160 - i32.const 745 + i32.const 742 i32.const 3 call $~lib/builtins/abort unreachable @@ -3927,7 +3927,7 @@ if i32.const 0 i32.const 160 - i32.const 746 + i32.const 743 i32.const 3 call $~lib/builtins/abort unreachable @@ -4026,7 +4026,7 @@ if i32.const 0 i32.const 160 - i32.const 767 + i32.const 764 i32.const 5 call $~lib/builtins/abort unreachable @@ -4042,7 +4042,7 @@ if i32.const 0 i32.const 160 - i32.const 772 + i32.const 769 i32.const 5 call $~lib/builtins/abort unreachable @@ -4142,7 +4142,7 @@ if i32.const 0 i32.const 160 - i32.const 806 + i32.const 803 i32.const 3 call $~lib/builtins/abort unreachable @@ -4160,7 +4160,7 @@ if i32.const 0 i32.const 160 - i32.const 808 + i32.const 805 i32.const 3 call $~lib/builtins/abort unreachable @@ -4179,7 +4179,7 @@ if i32.const 0 i32.const 160 - i32.const 810 + i32.const 807 i32.const 3 call $~lib/builtins/abort unreachable @@ -4196,7 +4196,7 @@ if i32.const 0 i32.const 160 - i32.const 811 + i32.const 808 i32.const 3 call $~lib/builtins/abort unreachable @@ -4213,7 +4213,7 @@ if i32.const 0 i32.const 160 - i32.const 812 + i32.const 809 i32.const 3 call $~lib/builtins/abort unreachable @@ -4229,7 +4229,7 @@ if i32.const 0 i32.const 160 - i32.const 813 + i32.const 810 i32.const 3 call $~lib/builtins/abort unreachable @@ -4242,7 +4242,7 @@ if i32.const 0 i32.const 160 - i32.const 818 + i32.const 815 i32.const 3 call $~lib/builtins/abort unreachable @@ -4255,7 +4255,7 @@ if i32.const 0 i32.const 160 - i32.const 819 + i32.const 816 i32.const 3 call $~lib/builtins/abort unreachable @@ -4272,7 +4272,7 @@ if i32.const 0 i32.const 160 - i32.const 820 + i32.const 817 i32.const 3 call $~lib/builtins/abort unreachable @@ -4289,7 +4289,7 @@ if i32.const 0 i32.const 160 - i32.const 825 + i32.const 822 i32.const 3 call $~lib/builtins/abort unreachable @@ -4362,7 +4362,7 @@ if i32.const 0 i32.const 160 - i32.const 839 + i32.const 836 i32.const 5 call $~lib/builtins/abort unreachable @@ -4378,7 +4378,7 @@ if i32.const 0 i32.const 160 - i32.const 844 + i32.const 841 i32.const 5 call $~lib/builtins/abort unreachable @@ -4758,7 +4758,7 @@ if i32.const 0 i32.const 160 - i32.const 917 + i32.const 914 i32.const 3 call $~lib/builtins/abort unreachable @@ -4776,7 +4776,7 @@ if i32.const 0 i32.const 160 - i32.const 919 + i32.const 916 i32.const 3 call $~lib/builtins/abort unreachable @@ -4795,7 +4795,7 @@ if i32.const 0 i32.const 160 - i32.const 921 + i32.const 918 i32.const 3 call $~lib/builtins/abort unreachable @@ -4812,7 +4812,7 @@ if i32.const 0 i32.const 160 - i32.const 922 + i32.const 919 i32.const 3 call $~lib/builtins/abort unreachable @@ -4829,7 +4829,7 @@ if i32.const 0 i32.const 160 - i32.const 923 + i32.const 920 i32.const 3 call $~lib/builtins/abort unreachable @@ -4850,7 +4850,7 @@ if i32.const 0 i32.const 160 - i32.const 925 + i32.const 922 i32.const 3 call $~lib/builtins/abort unreachable @@ -4867,7 +4867,7 @@ if i32.const 0 i32.const 160 - i32.const 926 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -4883,7 +4883,7 @@ if i32.const 0 i32.const 160 - i32.const 927 + i32.const 924 i32.const 3 call $~lib/builtins/abort unreachable @@ -4896,7 +4896,7 @@ if i32.const 0 i32.const 160 - i32.const 928 + i32.const 925 i32.const 3 call $~lib/builtins/abort unreachable @@ -4909,7 +4909,7 @@ if i32.const 0 i32.const 160 - i32.const 929 + i32.const 926 i32.const 3 call $~lib/builtins/abort unreachable @@ -4926,7 +4926,7 @@ if i32.const 0 i32.const 160 - i32.const 930 + i32.const 927 i32.const 3 call $~lib/builtins/abort unreachable @@ -4943,7 +4943,7 @@ if i32.const 0 i32.const 160 - i32.const 935 + i32.const 932 i32.const 3 call $~lib/builtins/abort unreachable @@ -4974,7 +4974,7 @@ if i32.const 0 i32.const 160 - i32.const 944 + i32.const 941 i32.const 3 call $~lib/builtins/abort unreachable @@ -4991,7 +4991,7 @@ if i32.const 0 i32.const 160 - i32.const 945 + i32.const 942 i32.const 3 call $~lib/builtins/abort unreachable @@ -5008,7 +5008,7 @@ if i32.const 0 i32.const 160 - i32.const 946 + i32.const 943 i32.const 3 call $~lib/builtins/abort unreachable @@ -5025,7 +5025,7 @@ if i32.const 0 i32.const 160 - i32.const 947 + i32.const 944 i32.const 3 call $~lib/builtins/abort unreachable @@ -5042,7 +5042,7 @@ if i32.const 0 i32.const 160 - i32.const 948 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -5059,7 +5059,7 @@ if i32.const 0 i32.const 160 - i32.const 949 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -5076,7 +5076,7 @@ if i32.const 0 i32.const 160 - i32.const 950 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -5093,7 +5093,7 @@ if i32.const 0 i32.const 160 - i32.const 951 + i32.const 948 i32.const 3 call $~lib/builtins/abort unreachable @@ -5109,7 +5109,7 @@ if i32.const 0 i32.const 160 - i32.const 952 + i32.const 949 i32.const 3 call $~lib/builtins/abort unreachable @@ -5174,7 +5174,7 @@ if i32.const 0 i32.const 160 - i32.const 979 + i32.const 976 i32.const 5 call $~lib/builtins/abort unreachable @@ -5187,7 +5187,7 @@ if i32.const 0 i32.const 160 - i32.const 980 + i32.const 977 i32.const 5 call $~lib/builtins/abort unreachable @@ -5200,7 +5200,7 @@ if i32.const 0 i32.const 160 - i32.const 981 + i32.const 978 i32.const 5 call $~lib/builtins/abort unreachable @@ -5213,7 +5213,7 @@ if i32.const 0 i32.const 160 - i32.const 982 + i32.const 979 i32.const 5 call $~lib/builtins/abort unreachable @@ -5222,53 +5222,16 @@ f32x4.floor local.set $8 local.get $8 - f32x4.extract_lane 0 - f32.const 1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 986 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 1 - f32.const -1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 987 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 2 - f32.const 70 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 988 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 3 - f32.const 4 - f32.eq + v128.const i32x4 0x3f800000 0xbf800000 0x428c0000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 i32.const 160 - i32.const 989 + i32.const 983 i32.const 5 call $~lib/builtins/abort unreachable @@ -5312,7 +5275,7 @@ if i32.const 0 i32.const 160 - i32.const 1005 + i32.const 999 i32.const 3 call $~lib/builtins/abort unreachable @@ -5330,7 +5293,7 @@ if i32.const 0 i32.const 160 - i32.const 1007 + i32.const 1001 i32.const 3 call $~lib/builtins/abort unreachable @@ -5349,7 +5312,7 @@ if i32.const 0 i32.const 160 - i32.const 1009 + i32.const 1003 i32.const 3 call $~lib/builtins/abort unreachable @@ -5366,7 +5329,7 @@ if i32.const 0 i32.const 160 - i32.const 1010 + i32.const 1004 i32.const 3 call $~lib/builtins/abort unreachable @@ -5383,7 +5346,7 @@ if i32.const 0 i32.const 160 - i32.const 1011 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -5404,7 +5367,7 @@ if i32.const 0 i32.const 160 - i32.const 1013 + i32.const 1007 i32.const 3 call $~lib/builtins/abort unreachable @@ -5421,7 +5384,7 @@ if i32.const 0 i32.const 160 - i32.const 1014 + i32.const 1008 i32.const 3 call $~lib/builtins/abort unreachable @@ -5437,7 +5400,7 @@ if i32.const 0 i32.const 160 - i32.const 1015 + i32.const 1009 i32.const 3 call $~lib/builtins/abort unreachable @@ -5450,7 +5413,7 @@ if i32.const 0 i32.const 160 - i32.const 1016 + i32.const 1010 i32.const 3 call $~lib/builtins/abort unreachable @@ -5463,7 +5426,7 @@ if i32.const 0 i32.const 160 - i32.const 1017 + i32.const 1011 i32.const 3 call $~lib/builtins/abort unreachable @@ -5480,7 +5443,7 @@ if i32.const 0 i32.const 160 - i32.const 1018 + i32.const 1012 i32.const 3 call $~lib/builtins/abort unreachable @@ -5497,7 +5460,7 @@ if i32.const 0 i32.const 160 - i32.const 1023 + i32.const 1017 i32.const 3 call $~lib/builtins/abort unreachable @@ -5528,7 +5491,7 @@ if i32.const 0 i32.const 160 - i32.const 1032 + i32.const 1026 i32.const 3 call $~lib/builtins/abort unreachable @@ -5545,7 +5508,7 @@ if i32.const 0 i32.const 160 - i32.const 1033 + i32.const 1027 i32.const 3 call $~lib/builtins/abort unreachable @@ -5562,7 +5525,7 @@ if i32.const 0 i32.const 160 - i32.const 1034 + i32.const 1028 i32.const 3 call $~lib/builtins/abort unreachable @@ -5579,7 +5542,7 @@ if i32.const 0 i32.const 160 - i32.const 1035 + i32.const 1029 i32.const 3 call $~lib/builtins/abort unreachable @@ -5596,7 +5559,7 @@ if i32.const 0 i32.const 160 - i32.const 1036 + i32.const 1030 i32.const 3 call $~lib/builtins/abort unreachable @@ -5613,7 +5576,7 @@ if i32.const 0 i32.const 160 - i32.const 1037 + i32.const 1031 i32.const 3 call $~lib/builtins/abort unreachable @@ -5630,7 +5593,7 @@ if i32.const 0 i32.const 160 - i32.const 1038 + i32.const 1032 i32.const 3 call $~lib/builtins/abort unreachable @@ -5647,7 +5610,7 @@ if i32.const 0 i32.const 160 - i32.const 1039 + i32.const 1033 i32.const 3 call $~lib/builtins/abort unreachable @@ -5663,7 +5626,7 @@ if i32.const 0 i32.const 160 - i32.const 1040 + i32.const 1034 i32.const 3 call $~lib/builtins/abort unreachable @@ -5714,7 +5677,7 @@ if i32.const 0 i32.const 160 - i32.const 1059 + i32.const 1053 i32.const 5 call $~lib/builtins/abort unreachable @@ -5727,7 +5690,7 @@ if i32.const 0 i32.const 160 - i32.const 1060 + i32.const 1054 i32.const 5 call $~lib/builtins/abort unreachable @@ -5743,7 +5706,7 @@ if i32.const 0 i32.const 160 - i32.const 1064 + i32.const 1058 i32.const 5 call $~lib/builtins/abort unreachable @@ -5756,7 +5719,7 @@ if i32.const 0 i32.const 160 - i32.const 1065 + i32.const 1059 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 3fa6092278..3349025832 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -1491,7 +1491,7 @@ if i32.const 0 i32.const 1184 - i32.const 593 + i32.const 590 i32.const 5 call $~lib/builtins/abort unreachable @@ -1505,7 +1505,7 @@ if i32.const 0 i32.const 1184 - i32.const 598 + i32.const 595 i32.const 5 call $~lib/builtins/abort unreachable @@ -1543,7 +1543,7 @@ if i32.const 0 i32.const 1184 - i32.const 767 + i32.const 764 i32.const 5 call $~lib/builtins/abort unreachable @@ -1557,7 +1557,7 @@ if i32.const 0 i32.const 1184 - i32.const 772 + i32.const 769 i32.const 5 call $~lib/builtins/abort unreachable @@ -1589,7 +1589,7 @@ if i32.const 0 i32.const 1184 - i32.const 839 + i32.const 836 i32.const 5 call $~lib/builtins/abort unreachable @@ -1603,7 +1603,7 @@ if i32.const 0 i32.const 1184 - i32.const 844 + i32.const 841 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index bd034e4df9..562ea6ae3c 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -212,7 +212,7 @@ function test_v128(): void { assert(v128.extract_lane(v, 3) == 4.0); } { - let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)); + let v: v128 = v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)); assert(v128.extract_lane(v, 0) == 1.0); assert(v128.extract_lane(v, 1) == -1); assert(v128.extract_lane(v, 2) == 70.0); @@ -220,24 +220,23 @@ function test_v128(): void { } { assert( - v128.bitmask(i8x16(u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE)) - == - 0x0000FFFF + v128.bitmask(i8x16( + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE)) == 0x0000FFFF ); assert( v128.bitmask(i8x16(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 @@ -250,9 +249,7 @@ function test_v128(): void { u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, - u16.MAX_VALUE)) - == - 0x000000FF + u16.MAX_VALUE)) == 0x000000FF ); assert( v128.bitmask(i16x8(-1, 0, 1, 2, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 @@ -416,7 +413,8 @@ function test_i8x16(): void { assert(i8x16.abs(i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)) == i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); assert(i8x16.abs(i8x16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)) == i8x16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); - assert(i8x16.abs(i8x16(u8.MAX_VALUE, + assert(i8x16.abs(i8x16( + u8.MAX_VALUE, u8.MAX_VALUE, u8.MAX_VALUE, u8.MAX_VALUE, @@ -440,24 +438,23 @@ function test_i8x16(): void { i8x16(i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128), i8(128)) ); assert( - i8x16.bitmask(i8x16(u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE - ,u8.MAX_VALUE)) - == - 0x0000FFFF + i8x16.bitmask(i8x16( + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE, + u8.MAX_VALUE)) == 0x0000FFFF ); assert( i8x16.bitmask(i8x16(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 @@ -633,7 +630,8 @@ function test_i16x8(): void { -32768, -32768)) == - i16x8(i16(32768), + i16x8( + i16(32768), i16(32768), i16(32768), i16(32768), @@ -643,16 +641,15 @@ function test_i16x8(): void { i16(32768)) ); assert( - i16x8.bitmask(i16x8(u16.MAX_VALUE, + i16x8.bitmask(i16x8( u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, - u16.MAX_VALUE)) - == - 0x000000FF + u16.MAX_VALUE, + u16.MAX_VALUE)) == 0x000000FF ); assert( i16x8.bitmask(i16x8(-1, 0, 1, 2, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 @@ -982,11 +979,8 @@ function test_f32x4(): void { assert(v128.extract_lane(v, 3) == 4.0); } { - let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)); - assert(v128.extract_lane(v, 0) == 1.0); - assert(v128.extract_lane(v, 1) == -1); - assert(v128.extract_lane(v, 2) == 70.0); - assert(v128.extract_lane(v, 3) == 4.0); + let v: v128 = f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)); + assert(v == f32x4(1, -1, 70, 4)); } assert( f32x4.trunc(f32x4(1.1, 2.5, 3.9, 4.0)) From 56d2fc10cb66affe0b3a6807695c33c0b26e2af8 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 10:25:14 +0800 Subject: [PATCH 11/16] fix: add static array literal test for v128 --- tests/compiler/simd.debug.wat | 1750 ++++++++++++++++++++++++------- tests/compiler/simd.release.wat | 1435 +++++++++++++++++++------ tests/compiler/simd.ts | 6 +- 3 files changed, 2460 insertions(+), 731 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index abdaeaa5d5..dbb34e392c 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -1,13 +1,15 @@ (module - (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_v128 (func (param i32 i32 i32) (result v128))) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_v128 (func (param i32 i32 i32) (result v128))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_v128 (func (param i32 i32) (result v128))) (type $none_=>_v128 (func (result v128))) (type $i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result v128))) (type $i32_i32_i32_i32_i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32 i32 i32 i32 i32) (result v128))) @@ -18,10 +20,23 @@ (type $f32_f32_f32_f32_=>_v128 (func (param f32 f32 f32 f32) (result v128))) (type $f64_=>_v128 (func (param f64) (result v128))) (type $f64_f64_=>_v128 (func (param f64 f64) (result v128))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (global $~lib/native/ASC_FEATURE_SIMD i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) + (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) + (global $~lib/native/ASC_FEATURE_SIMD i32 (i32.const 1)) (global $~lib/builtins/u8.MAX_VALUE i32 (i32.const 255)) (global $~lib/builtins/u16.MAX_VALUE i32 (i32.const 65535)) (global $~lib/builtins/i16.MAX_VALUE i32 (i32.const 32767)) @@ -29,13 +44,23 @@ (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/u64.MAX_VALUE i64 (i64.const -1)) - (global $~lib/memory/__data_end i32 (i32.const 188)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16572)) - (global $~lib/memory/__heap_base i32 (i32.const 16572)) + (global $~lib/rt/__rtti_base i32 (i32.const 560)) + (global $~lib/memory/__data_end i32 (i32.const 604)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16988)) + (global $~lib/memory/__heap_base i32 (i32.const 16988)) (memory $0 1) - (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") - (data (i32.const 140) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 60) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") + (data (i32.const 124) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 192) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 224) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 252) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") + (data (i32.const 316) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") + (data (i32.const 368) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 396) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") + (data (i32.const 508) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 560) "\05\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\04\00\00\00\00\00\00\02\t\00\00\00\00\00\00") (table $0 1 1 funcref) (elem $0 (i32.const 1)) (export "test_vars_i8x16_partial" (func $simd/test_vars_i8x16_partial)) @@ -52,6 +77,322 @@ (export "test_vars_f64x2_full" (func $simd/test_vars_f64x2_full)) (export "memory" (memory $0)) (start $~start) + (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/rt/itcms/Object#set:prev (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=8 + ) + (func $~lib/rt/itcms/initLazy (param $0 i32) (result i32) + local.get $0 + local.get $0 + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + local.get $0 + call $~lib/rt/itcms/Object#set:prev + local.get $0 + ) + (func $~lib/rt/itcms/Object#get:next (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + ) + (func $~lib/rt/itcms/Object#get:color (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + ) + (func $~lib/rt/itcms/visitRoots (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/__visit_globals + global.get $~lib/rt/itcms/pinSpace + local.set $1 + local.get $1 + call $~lib/rt/itcms/Object#get:next + local.set $2 + loop $while-continue|0 + local.get $2 + local.get $1 + i32.ne + local.set $3 + local.get $3 + if + i32.const 1 + drop + local.get $2 + call $~lib/rt/itcms/Object#get:color + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 159 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 20 + i32.add + local.get $0 + call $~lib/rt/__visit_members + local.get $2 + call $~lib/rt/itcms/Object#get:next + local.set $2 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#set:color (param $0 i32) (param $1 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#set:next (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#unlink (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $1 + local.get $1 + i32.const 0 + i32.eq + if + i32.const 1 + drop + local.get $0 + i32.load offset=8 + i32.const 0 + i32.eq + if (result i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 127 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + return + end + local.get $0 + i32.load offset=8 + local.set $2 + i32.const 1 + drop + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 131 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + call $~lib/rt/itcms/Object#set:prev + local.get $2 + local.get $1 + call $~lib/rt/itcms/Object#set:next + ) + (func $~lib/rt/__typeinfo (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 272 + i32.const 336 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/itcms/Object#get:isPointerfree (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $1 + call $~lib/rt/__typeinfo + i32.const 32 + i32.and + i32.const 0 + i32.ne + end + ) + (func $~lib/rt/itcms/Object#linkTo (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $1 + i32.load offset=8 + local.set $3 + local.get $0 + local.get $1 + local.get $2 + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + local.get $3 + call $~lib/rt/itcms/Object#set:prev + local.get $3 + local.get $0 + call $~lib/rt/itcms/Object#set:next + local.get $1 + local.get $0 + call $~lib/rt/itcms/Object#set:prev + ) + (func $~lib/rt/itcms/Object#makeGray (param $0 i32) + (local $1 i32) + local.get $0 + global.get $~lib/rt/itcms/iter + i32.eq + if + local.get $0 + i32.load offset=8 + local.tee $1 + i32.eqz + if (result i32) + i32.const 0 + i32.const 144 + i32.const 147 + i32.const 30 + call $~lib/builtins/abort + unreachable + else + local.get $1 + end + global.set $~lib/rt/itcms/iter + end + local.get $0 + call $~lib/rt/itcms/Object#unlink + local.get $0 + global.get $~lib/rt/itcms/toSpace + local.get $0 + call $~lib/rt/itcms/Object#get:isPointerfree + if (result i32) + global.get $~lib/rt/itcms/white + i32.eqz + else + i32.const 2 + end + call $~lib/rt/itcms/Object#linkTo + ) + (func $~lib/rt/itcms/__visit (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + return + end + local.get $0 + i32.const 20 + i32.sub + local.set $2 + i32.const 0 + drop + local.get $2 + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eq + if + local.get $2 + call $~lib/rt/itcms/Object#makeGray + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.add + global.set $~lib/rt/itcms/visitCount + end + ) + (func $~lib/rt/itcms/visitStack (param $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + local.set $1 + loop $while-continue|0 + local.get $1 + global.get $~lib/memory/__heap_base + i32.lt_u + local.set $2 + local.get $2 + if + local.get $1 + i32.load + local.get $0 + call $~lib/rt/itcms/__visit + local.get $1 + i32.const 4 + i32.add + local.set $1 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#get:size (param $0 i32) (result i32) + i32.const 4 + local.get $0 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + ) (func $~lib/rt/tlsf/Root#set:flMap (param $0 i32) (param $1 i32) local.get $0 local.get $1 @@ -94,7 +435,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 268 i32.const 14 call $~lib/builtins/abort @@ -114,7 +455,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 270 i32.const 14 call $~lib/builtins/abort @@ -177,7 +518,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 284 i32.const 14 call $~lib/builtins/abort @@ -309,7 +650,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 201 i32.const 14 call $~lib/builtins/abort @@ -326,7 +667,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 203 i32.const 14 call $~lib/builtins/abort @@ -406,7 +747,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 221 i32.const 16 call $~lib/builtins/abort @@ -449,7 +790,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 233 i32.const 14 call $~lib/builtins/abort @@ -467,7 +808,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 234 i32.const 14 call $~lib/builtins/abort @@ -535,7 +876,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 251 i32.const 14 call $~lib/builtins/abort @@ -640,7 +981,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 377 i32.const 14 call $~lib/builtins/abort @@ -683,7 +1024,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 384 i32.const 16 call $~lib/builtins/abort @@ -716,7 +1057,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 397 i32.const 5 call $~lib/builtins/abort @@ -930,6 +1271,338 @@ local.get $3 global.set $~lib/rt/tlsf/ROOT ) + (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 4 + i32.sub + local.set $1 + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 416 + i32.const 559 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + i32.const 0 + drop + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/__free (param $0 i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + if + return + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/checkUsedBlock + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/itcms/free (param $0 i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + if + local.get $0 + i32.const 0 + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + i32.const 0 + call $~lib/rt/itcms/Object#set:prev + else + global.get $~lib/rt/itcms/total + local.get $0 + call $~lib/rt/itcms/Object#get:size + i32.sub + global.set $~lib/rt/itcms/total + i32.const 0 + drop + local.get $0 + i32.const 4 + i32.add + call $~lib/rt/tlsf/__free + end + ) + (func $~lib/rt/itcms/step (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + block $break|0 + block $case2|0 + block $case1|0 + block $case0|0 + global.get $~lib/rt/itcms/state + local.set $1 + local.get $1 + i32.const 0 + i32.eq + br_if $case0|0 + local.get $1 + i32.const 1 + i32.eq + br_if $case1|0 + local.get $1 + i32.const 2 + i32.eq + br_if $case2|0 + br $break|0 + end + i32.const 1 + global.set $~lib/rt/itcms/state + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/white + i32.eqz + local.set $1 + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + loop $while-continue|1 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $2 + local.get $2 + if + local.get $0 + global.set $~lib/rt/itcms/iter + local.get $0 + call $~lib/rt/itcms/Object#get:color + local.get $1 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/itcms/Object#set:color + i32.const 0 + global.set $~lib/rt/itcms/visitCount + local.get $0 + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $0 + br $while-continue|1 + end + end + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.eq + if + i32.const 0 + call $~lib/rt/itcms/visitStack + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + loop $while-continue|2 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $2 + local.get $2 + if + local.get $0 + call $~lib/rt/itcms/Object#get:color + local.get $1 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/itcms/Object#set:color + local.get $0 + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + end + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $0 + br $while-continue|2 + end + end + global.get $~lib/rt/itcms/fromSpace + local.set $2 + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/fromSpace + local.get $2 + global.set $~lib/rt/itcms/toSpace + local.get $1 + global.set $~lib/rt/itcms/white + local.get $2 + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 2 + global.set $~lib/rt/itcms/state + end + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/iter + local.set $0 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 1 + drop + local.get $0 + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eqz + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 228 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/itcms/free + i32.const 10 + return + end + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:nextWithColor + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:prev + i32.const 0 + global.set $~lib/rt/itcms/state + br $break|0 + end + i32.const 0 + ) + (func $~lib/rt/itcms/interrupt + (local $0 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1024 + i32.const 200 + i32.mul + i32.const 100 + i32.div_u + local.set $0 + loop $do-loop|0 + local.get $0 + call $~lib/rt/itcms/step + i32.sub + local.set $0 + global.get $~lib/rt/itcms/state + i32.const 0 + i32.eq + if + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i32.const 200 + i64.extend_i32_u + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + return + end + local.get $0 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i32.const 1024 + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.mul + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + ) (func $~lib/rt/tlsf/computeSize (param $0 i32) (result i32) local.get $0 i32.const 12 @@ -955,8 +1628,8 @@ i32.const 1073741820 i32.gt_u if - i32.const 96 - i32.const 32 + i32.const 80 + i32.const 416 i32.const 458 i32.const 29 call $~lib/builtins/abort @@ -1040,7 +1713,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 330 i32.const 14 call $~lib/builtins/abort @@ -1105,7 +1778,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 343 i32.const 18 call $~lib/builtins/abort @@ -1256,7 +1929,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 357 i32.const 14 call $~lib/builtins/abort @@ -1365,7 +2038,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 496 i32.const 16 call $~lib/builtins/abort @@ -1385,7 +2058,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 416 i32.const 498 i32.const 14 call $~lib/builtins/abort @@ -1414,72 +2087,176 @@ i32.const 4 i32.add ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/itcms/Object#set:rtId (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=12 + ) + (func $~lib/rt/itcms/Object#set:rtSize (param $0 i32) (param $1 i32) local.get $0 + local.get $1 + i32.store offset=16 + ) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 80 + i32.const 144 + i32.const 260 + i32.const 31 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + call $~lib/rt/itcms/interrupt + end + i32.const 16 + local.get $0 + i32.add + call $~lib/rt/tlsf/__alloc i32.const 4 i32.sub - local.set $1 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/itcms/Object#set:rtId + local.get $2 local.get $0 + call $~lib/rt/itcms/Object#set:rtSize + local.get $2 + global.get $~lib/rt/itcms/fromSpace + global.get $~lib/rt/itcms/white + call $~lib/rt/itcms/Object#linkTo + global.get $~lib/rt/itcms/total + local.get $2 + call $~lib/rt/itcms/Object#get:size + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.set $3 + local.get $3 i32.const 0 - i32.ne - if (result i32) + local.get $0 + memory.fill + local.get $3 + ) + (func $~lib/rt/__newBuffer (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/itcms/__new + local.set $3 + local.get $2 + if + local.get $3 + local.get $2 local.get $0 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 + memory.copy end - if (result i32) - local.get $1 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 + local.get $3 + ) + (func $~lib/rt/itcms/__link (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.eqz + if + return end + i32.const 1 + drop + local.get $0 i32.eqz if i32.const 0 - i32.const 32 - i32.const 559 - i32.const 3 + i32.const 144 + i32.const 294 + i32.const 14 call $~lib/builtins/abort unreachable end local.get $1 - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - i32.const 0 - drop - local.get $1 - local.get $1 - i32.load - i32.const 1 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/__free (param $0 i32) - local.get $0 - global.get $~lib/memory/__heap_base - i32.lt_u + i32.const 20 + i32.sub + local.set $3 + local.get $3 + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eq if - return + local.get $0 + i32.const 20 + i32.sub + local.set $4 + local.get $4 + call $~lib/rt/itcms/Object#get:color + local.set $5 + local.get $5 + global.get $~lib/rt/itcms/white + i32.eqz + i32.eq + if + local.get $2 + if + local.get $4 + call $~lib/rt/itcms/Object#makeGray + else + local.get $3 + call $~lib/rt/itcms/Object#makeGray + end + else + local.get $5 + i32.const 3 + i32.eq + if (result i32) + global.get $~lib/rt/itcms/state + i32.const 1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + call $~lib/rt/itcms/Object#makeGray + end + end end - global.get $~lib/rt/tlsf/ROOT - i32.eqz + ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result v128) + (local $2 v128) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u if - call $~lib/rt/tlsf/initialize + i32.const 272 + i32.const 480 + i32.const 114 + i32.const 42 + call $~lib/builtins/abort + unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/checkUsedBlock - call $~lib/rt/tlsf/freeBlock + i32.load offset=4 + local.get $1 + i32.const 4 + i32.shl + i32.add + v128.load + local.set $2 + i32.const 0 + drop + local.get $2 ) (func $simd/test_v128 (local $0 i32) @@ -1591,8 +2368,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 67 + i32.const 528 + i32.const 71 i32.const 5 call $~lib/builtins/abort unreachable @@ -1615,8 +2392,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 77 + i32.const 528 + i32.const 81 i32.const 5 call $~lib/builtins/abort unreachable @@ -1639,8 +2416,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 87 + i32.const 528 + i32.const 91 i32.const 5 call $~lib/builtins/abort unreachable @@ -1663,8 +2440,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 97 + i32.const 528 + i32.const 101 i32.const 5 call $~lib/builtins/abort unreachable @@ -1687,8 +2464,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 107 + i32.const 528 + i32.const 111 i32.const 5 call $~lib/builtins/abort unreachable @@ -1711,8 +2488,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 117 + i32.const 528 + i32.const 121 i32.const 5 call $~lib/builtins/abort unreachable @@ -1792,8 +2569,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 173 + i32.const 528 + i32.const 177 i32.const 5 call $~lib/builtins/abort unreachable @@ -1810,8 +2587,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 175 + i32.const 528 + i32.const 179 i32.const 5 call $~lib/builtins/abort unreachable @@ -1828,8 +2605,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 179 + i32.const 528 + i32.const 183 i32.const 5 call $~lib/builtins/abort unreachable @@ -1846,8 +2623,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 181 + i32.const 528 + i32.const 185 i32.const 5 call $~lib/builtins/abort unreachable @@ -1873,8 +2650,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 188 + i32.const 528 + i32.const 192 i32.const 5 call $~lib/builtins/abort unreachable @@ -1902,8 +2679,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 196 + i32.const 528 + i32.const 200 i32.const 5 call $~lib/builtins/abort unreachable @@ -1921,8 +2698,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 198 + i32.const 528 + i32.const 202 i32.const 5 call $~lib/builtins/abort unreachable @@ -1940,8 +2717,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 200 + i32.const 528 + i32.const 204 i32.const 5 call $~lib/builtins/abort unreachable @@ -1959,8 +2736,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 202 + i32.const 528 + i32.const 206 i32.const 5 call $~lib/builtins/abort unreachable @@ -1978,8 +2755,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 204 + i32.const 528 + i32.const 208 i32.const 5 call $~lib/builtins/abort unreachable @@ -1996,8 +2773,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 209 + i32.const 528 + i32.const 213 i32.const 5 call $~lib/builtins/abort unreachable @@ -2009,8 +2786,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 210 + i32.const 528 + i32.const 214 i32.const 5 call $~lib/builtins/abort unreachable @@ -2022,8 +2799,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 211 + i32.const 528 + i32.const 215 i32.const 5 call $~lib/builtins/abort unreachable @@ -2035,8 +2812,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 212 + i32.const 528 + i32.const 216 i32.const 5 call $~lib/builtins/abort unreachable @@ -2051,8 +2828,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 216 + i32.const 528 + i32.const 220 i32.const 5 call $~lib/builtins/abort unreachable @@ -2064,8 +2841,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 217 + i32.const 528 + i32.const 221 i32.const 5 call $~lib/builtins/abort unreachable @@ -2077,8 +2854,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 218 + i32.const 528 + i32.const 222 i32.const 5 call $~lib/builtins/abort unreachable @@ -2090,8 +2867,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 219 + i32.const 528 + i32.const 223 i32.const 5 call $~lib/builtins/abort unreachable @@ -2164,8 +2941,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 288 + i32.const 528 + i32.const 292 i32.const 3 call $~lib/builtins/abort unreachable @@ -2182,8 +2959,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 290 + i32.const 528 + i32.const 294 i32.const 3 call $~lib/builtins/abort unreachable @@ -2201,8 +2978,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 292 + i32.const 528 + i32.const 296 i32.const 3 call $~lib/builtins/abort unreachable @@ -2218,8 +2995,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 293 + i32.const 528 + i32.const 297 i32.const 3 call $~lib/builtins/abort unreachable @@ -2279,8 +3056,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 334 + i32.const 528 + i32.const 338 i32.const 3 call $~lib/builtins/abort unreachable @@ -2293,8 +3070,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 339 + i32.const 528 + i32.const 343 i32.const 3 call $~lib/builtins/abort unreachable @@ -2307,8 +3084,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 340 + i32.const 528 + i32.const 344 i32.const 3 call $~lib/builtins/abort unreachable @@ -2322,8 +3099,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 341 + i32.const 528 + i32.const 345 i32.const 3 call $~lib/builtins/abort unreachable @@ -2339,8 +3116,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 342 + i32.const 528 + i32.const 346 i32.const 3 call $~lib/builtins/abort unreachable @@ -2356,8 +3133,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 347 + i32.const 528 + i32.const 351 i32.const 3 call $~lib/builtins/abort unreachable @@ -2480,8 +3257,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 385 + i32.const 528 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable @@ -2497,8 +3274,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 386 + i32.const 528 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable @@ -2514,8 +3291,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 387 + i32.const 528 + i32.const 391 i32.const 3 call $~lib/builtins/abort unreachable @@ -2531,8 +3308,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 388 + i32.const 528 + i32.const 392 i32.const 3 call $~lib/builtins/abort unreachable @@ -2548,8 +3325,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 389 + i32.const 528 + i32.const 393 i32.const 3 call $~lib/builtins/abort unreachable @@ -2565,8 +3342,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 390 + i32.const 528 + i32.const 394 i32.const 3 call $~lib/builtins/abort unreachable @@ -2582,8 +3359,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 391 + i32.const 528 + i32.const 395 i32.const 3 call $~lib/builtins/abort unreachable @@ -2599,8 +3376,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 392 + i32.const 528 + i32.const 396 i32.const 3 call $~lib/builtins/abort unreachable @@ -2616,8 +3393,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 393 + i32.const 528 + i32.const 397 i32.const 3 call $~lib/builtins/abort unreachable @@ -2633,8 +3410,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 394 + i32.const 528 + i32.const 398 i32.const 3 call $~lib/builtins/abort unreachable @@ -2678,8 +3455,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 400 + i32.const 528 + i32.const 404 i32.const 5 call $~lib/builtins/abort unreachable @@ -2697,8 +3474,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 406 + i32.const 528 + i32.const 410 i32.const 5 call $~lib/builtins/abort unreachable @@ -2713,8 +3490,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 411 + i32.const 528 + i32.const 415 i32.const 5 call $~lib/builtins/abort unreachable @@ -2782,8 +3559,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 466 + i32.const 528 + i32.const 470 i32.const 3 call $~lib/builtins/abort unreachable @@ -2800,8 +3577,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 468 + i32.const 528 + i32.const 472 i32.const 3 call $~lib/builtins/abort unreachable @@ -2819,8 +3596,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 470 + i32.const 528 + i32.const 474 i32.const 3 call $~lib/builtins/abort unreachable @@ -2836,8 +3613,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 471 + i32.const 528 + i32.const 475 i32.const 3 call $~lib/builtins/abort unreachable @@ -2853,8 +3630,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 472 + i32.const 528 + i32.const 476 i32.const 3 call $~lib/builtins/abort unreachable @@ -2914,8 +3691,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 513 + i32.const 528 + i32.const 517 i32.const 3 call $~lib/builtins/abort unreachable @@ -2928,8 +3705,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 518 + i32.const 528 + i32.const 522 i32.const 3 call $~lib/builtins/abort unreachable @@ -2942,8 +3719,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 519 + i32.const 528 + i32.const 523 i32.const 3 call $~lib/builtins/abort unreachable @@ -2957,8 +3734,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 520 + i32.const 528 + i32.const 524 i32.const 3 call $~lib/builtins/abort unreachable @@ -2974,8 +3751,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 521 + i32.const 528 + i32.const 525 i32.const 3 call $~lib/builtins/abort unreachable @@ -2991,8 +3768,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 526 + i32.const 528 + i32.const 530 i32.const 3 call $~lib/builtins/abort unreachable @@ -3115,8 +3892,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 564 + i32.const 528 + i32.const 568 i32.const 3 call $~lib/builtins/abort unreachable @@ -3132,8 +3909,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 565 + i32.const 528 + i32.const 569 i32.const 3 call $~lib/builtins/abort unreachable @@ -3149,8 +3926,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 566 + i32.const 528 + i32.const 570 i32.const 3 call $~lib/builtins/abort unreachable @@ -3166,8 +3943,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 567 + i32.const 528 + i32.const 571 i32.const 3 call $~lib/builtins/abort unreachable @@ -3183,8 +3960,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 568 + i32.const 528 + i32.const 572 i32.const 3 call $~lib/builtins/abort unreachable @@ -3200,8 +3977,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 569 + i32.const 528 + i32.const 573 i32.const 3 call $~lib/builtins/abort unreachable @@ -3217,8 +3994,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 570 + i32.const 528 + i32.const 574 i32.const 3 call $~lib/builtins/abort unreachable @@ -3234,8 +4011,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 571 + i32.const 528 + i32.const 575 i32.const 3 call $~lib/builtins/abort unreachable @@ -3251,8 +4028,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 572 + i32.const 528 + i32.const 576 i32.const 3 call $~lib/builtins/abort unreachable @@ -3268,8 +4045,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 573 + i32.const 528 + i32.const 577 i32.const 3 call $~lib/builtins/abort unreachable @@ -3383,8 +4160,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 590 + i32.const 528 + i32.const 594 i32.const 5 call $~lib/builtins/abort unreachable @@ -3399,8 +4176,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 595 + i32.const 528 + i32.const 599 i32.const 5 call $~lib/builtins/abort unreachable @@ -3501,8 +4278,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 661 + i32.const 528 + i32.const 665 i32.const 3 call $~lib/builtins/abort unreachable @@ -3519,8 +4296,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 663 + i32.const 528 + i32.const 667 i32.const 3 call $~lib/builtins/abort unreachable @@ -3538,8 +4315,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 665 + i32.const 528 + i32.const 669 i32.const 3 call $~lib/builtins/abort unreachable @@ -3555,8 +4332,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 666 + i32.const 528 + i32.const 670 i32.const 3 call $~lib/builtins/abort unreachable @@ -3572,8 +4349,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 667 + i32.const 528 + i32.const 671 i32.const 3 call $~lib/builtins/abort unreachable @@ -3633,8 +4410,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 708 + i32.const 528 + i32.const 712 i32.const 3 call $~lib/builtins/abort unreachable @@ -3646,8 +4423,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 713 + i32.const 528 + i32.const 717 i32.const 3 call $~lib/builtins/abort unreachable @@ -3659,8 +4436,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 714 + i32.const 528 + i32.const 718 i32.const 3 call $~lib/builtins/abort unreachable @@ -3676,8 +4453,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 715 + i32.const 528 + i32.const 719 i32.const 3 call $~lib/builtins/abort unreachable @@ -3693,8 +4470,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 720 + i32.const 528 + i32.const 724 i32.const 3 call $~lib/builtins/abort unreachable @@ -3773,8 +4550,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 734 + i32.const 528 + i32.const 738 i32.const 3 call $~lib/builtins/abort unreachable @@ -3790,8 +4567,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 735 + i32.const 528 + i32.const 739 i32.const 3 call $~lib/builtins/abort unreachable @@ -3807,8 +4584,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 736 + i32.const 528 + i32.const 740 i32.const 3 call $~lib/builtins/abort unreachable @@ -3824,8 +4601,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 737 + i32.const 528 + i32.const 741 i32.const 3 call $~lib/builtins/abort unreachable @@ -3841,8 +4618,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 738 + i32.const 528 + i32.const 742 i32.const 3 call $~lib/builtins/abort unreachable @@ -3858,8 +4635,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 739 + i32.const 528 + i32.const 743 i32.const 3 call $~lib/builtins/abort unreachable @@ -3875,8 +4652,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 740 + i32.const 528 + i32.const 744 i32.const 3 call $~lib/builtins/abort unreachable @@ -3892,8 +4669,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 741 + i32.const 528 + i32.const 745 i32.const 3 call $~lib/builtins/abort unreachable @@ -3909,8 +4686,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 742 + i32.const 528 + i32.const 746 i32.const 3 call $~lib/builtins/abort unreachable @@ -3926,8 +4703,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 743 + i32.const 528 + i32.const 747 i32.const 3 call $~lib/builtins/abort unreachable @@ -4025,8 +4802,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 764 + i32.const 528 + i32.const 768 i32.const 5 call $~lib/builtins/abort unreachable @@ -4041,8 +4818,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 769 + i32.const 528 + i32.const 773 i32.const 5 call $~lib/builtins/abort unreachable @@ -4141,8 +4918,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 803 + i32.const 528 + i32.const 807 i32.const 3 call $~lib/builtins/abort unreachable @@ -4159,8 +4936,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 805 + i32.const 528 + i32.const 809 i32.const 3 call $~lib/builtins/abort unreachable @@ -4178,8 +4955,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 807 + i32.const 528 + i32.const 811 i32.const 3 call $~lib/builtins/abort unreachable @@ -4195,8 +4972,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 808 + i32.const 528 + i32.const 812 i32.const 3 call $~lib/builtins/abort unreachable @@ -4212,8 +4989,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 809 + i32.const 528 + i32.const 813 i32.const 3 call $~lib/builtins/abort unreachable @@ -4228,8 +5005,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 810 + i32.const 528 + i32.const 814 i32.const 3 call $~lib/builtins/abort unreachable @@ -4241,8 +5018,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 815 + i32.const 528 + i32.const 819 i32.const 3 call $~lib/builtins/abort unreachable @@ -4254,8 +5031,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 816 + i32.const 528 + i32.const 820 i32.const 3 call $~lib/builtins/abort unreachable @@ -4271,8 +5048,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 817 + i32.const 528 + i32.const 821 i32.const 3 call $~lib/builtins/abort unreachable @@ -4288,8 +5065,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 822 + i32.const 528 + i32.const 826 i32.const 3 call $~lib/builtins/abort unreachable @@ -4361,8 +5138,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 836 + i32.const 528 + i32.const 840 i32.const 5 call $~lib/builtins/abort unreachable @@ -4377,8 +5154,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 841 + i32.const 528 + i32.const 845 i32.const 5 call $~lib/builtins/abort unreachable @@ -4757,8 +5534,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 914 + i32.const 528 + i32.const 918 i32.const 3 call $~lib/builtins/abort unreachable @@ -4775,8 +5552,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 916 + i32.const 528 + i32.const 920 i32.const 3 call $~lib/builtins/abort unreachable @@ -4794,8 +5571,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 918 + i32.const 528 + i32.const 922 i32.const 3 call $~lib/builtins/abort unreachable @@ -4811,8 +5588,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 919 + i32.const 528 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -4828,8 +5605,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 920 + i32.const 528 + i32.const 924 i32.const 3 call $~lib/builtins/abort unreachable @@ -4849,8 +5626,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 922 + i32.const 528 + i32.const 926 i32.const 3 call $~lib/builtins/abort unreachable @@ -4866,8 +5643,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 923 + i32.const 528 + i32.const 927 i32.const 3 call $~lib/builtins/abort unreachable @@ -4882,8 +5659,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 924 + i32.const 528 + i32.const 928 i32.const 3 call $~lib/builtins/abort unreachable @@ -4895,8 +5672,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 925 + i32.const 528 + i32.const 929 i32.const 3 call $~lib/builtins/abort unreachable @@ -4908,8 +5685,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 926 + i32.const 528 + i32.const 930 i32.const 3 call $~lib/builtins/abort unreachable @@ -4925,8 +5702,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 927 + i32.const 528 + i32.const 931 i32.const 3 call $~lib/builtins/abort unreachable @@ -4942,8 +5719,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 932 + i32.const 528 + i32.const 936 i32.const 3 call $~lib/builtins/abort unreachable @@ -4973,8 +5750,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 941 + i32.const 528 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -4990,8 +5767,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 942 + i32.const 528 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -5007,8 +5784,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 943 + i32.const 528 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -5024,8 +5801,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 944 + i32.const 528 + i32.const 948 i32.const 3 call $~lib/builtins/abort unreachable @@ -5041,8 +5818,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 945 + i32.const 528 + i32.const 949 i32.const 3 call $~lib/builtins/abort unreachable @@ -5058,8 +5835,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 946 + i32.const 528 + i32.const 950 i32.const 3 call $~lib/builtins/abort unreachable @@ -5075,8 +5852,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 947 + i32.const 528 + i32.const 951 i32.const 3 call $~lib/builtins/abort unreachable @@ -5092,8 +5869,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 948 + i32.const 528 + i32.const 952 i32.const 3 call $~lib/builtins/abort unreachable @@ -5108,8 +5885,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 949 + i32.const 528 + i32.const 953 i32.const 3 call $~lib/builtins/abort unreachable @@ -5173,8 +5950,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 976 + i32.const 528 + i32.const 980 i32.const 5 call $~lib/builtins/abort unreachable @@ -5186,8 +5963,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 977 + i32.const 528 + i32.const 981 i32.const 5 call $~lib/builtins/abort unreachable @@ -5199,8 +5976,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 978 + i32.const 528 + i32.const 982 i32.const 5 call $~lib/builtins/abort unreachable @@ -5212,8 +5989,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 979 + i32.const 528 + i32.const 983 i32.const 5 call $~lib/builtins/abort unreachable @@ -5230,8 +6007,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 983 + i32.const 528 + i32.const 987 i32.const 5 call $~lib/builtins/abort unreachable @@ -5274,8 +6051,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 999 + i32.const 528 + i32.const 1003 i32.const 3 call $~lib/builtins/abort unreachable @@ -5292,8 +6069,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1001 + i32.const 528 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -5311,8 +6088,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1003 + i32.const 528 + i32.const 1007 i32.const 3 call $~lib/builtins/abort unreachable @@ -5328,8 +6105,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1004 + i32.const 528 + i32.const 1008 i32.const 3 call $~lib/builtins/abort unreachable @@ -5345,8 +6122,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1005 + i32.const 528 + i32.const 1009 i32.const 3 call $~lib/builtins/abort unreachable @@ -5366,8 +6143,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1007 + i32.const 528 + i32.const 1011 i32.const 3 call $~lib/builtins/abort unreachable @@ -5383,8 +6160,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1008 + i32.const 528 + i32.const 1012 i32.const 3 call $~lib/builtins/abort unreachable @@ -5399,8 +6176,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1009 + i32.const 528 + i32.const 1013 i32.const 3 call $~lib/builtins/abort unreachable @@ -5412,8 +6189,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1010 + i32.const 528 + i32.const 1014 i32.const 3 call $~lib/builtins/abort unreachable @@ -5425,8 +6202,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1011 + i32.const 528 + i32.const 1015 i32.const 3 call $~lib/builtins/abort unreachable @@ -5442,8 +6219,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1012 + i32.const 528 + i32.const 1016 i32.const 3 call $~lib/builtins/abort unreachable @@ -5459,8 +6236,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1017 + i32.const 528 + i32.const 1021 i32.const 3 call $~lib/builtins/abort unreachable @@ -5490,8 +6267,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1026 + i32.const 528 + i32.const 1030 i32.const 3 call $~lib/builtins/abort unreachable @@ -5507,8 +6284,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1027 + i32.const 528 + i32.const 1031 i32.const 3 call $~lib/builtins/abort unreachable @@ -5524,8 +6301,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1028 + i32.const 528 + i32.const 1032 i32.const 3 call $~lib/builtins/abort unreachable @@ -5541,8 +6318,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1029 + i32.const 528 + i32.const 1033 i32.const 3 call $~lib/builtins/abort unreachable @@ -5558,8 +6335,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1030 + i32.const 528 + i32.const 1034 i32.const 3 call $~lib/builtins/abort unreachable @@ -5575,8 +6352,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1031 + i32.const 528 + i32.const 1035 i32.const 3 call $~lib/builtins/abort unreachable @@ -5592,8 +6369,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1032 + i32.const 528 + i32.const 1036 i32.const 3 call $~lib/builtins/abort unreachable @@ -5609,8 +6386,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1033 + i32.const 528 + i32.const 1037 i32.const 3 call $~lib/builtins/abort unreachable @@ -5625,8 +6402,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1034 + i32.const 528 + i32.const 1038 i32.const 3 call $~lib/builtins/abort unreachable @@ -5676,8 +6453,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1053 + i32.const 528 + i32.const 1057 i32.const 5 call $~lib/builtins/abort unreachable @@ -5689,8 +6466,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1054 + i32.const 528 + i32.const 1058 i32.const 5 call $~lib/builtins/abort unreachable @@ -5705,8 +6482,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1058 + i32.const 528 + i32.const 1062 i32.const 5 call $~lib/builtins/abort unreachable @@ -5718,8 +6495,8 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 1059 + i32.const 528 + i32.const 1063 i32.const 5 call $~lib/builtins/abort unreachable @@ -5748,6 +6525,56 @@ local.get $0 ) (func $start:simd + (local $0 i32) + (local $1 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + memory.size + i32.const 16 + i32.shl + global.get $~lib/memory/__heap_base + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 192 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/pinSpace + i32.const 224 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/toSpace + i32.const 368 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/fromSpace + global.get $~lib/memory/__stack_pointer + i32.const 1 + i32.const 4 + i32.const 3 + i32.const 32 + call $~lib/rt/__newArray + local.tee $1 + i32.store + local.get $1 + i32.const 0 + call $~lib/array/Array#__get + i32x4.extract_lane 0 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 5 + i32.const 3 + call $~lib/builtins/abort + unreachable + end i32.const 1 drop i32.const 1 @@ -5769,6 +6596,10 @@ call $simd/test_f64x2 call $simd/test_const drop + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer ) (func $simd/test_vars_i8x16_partial (param $0 i32) (param $1 i32) (param $2 i32) (result v128) v128.const i32x4 0x03000100 0x07000504 0x0b0a0908 0x000e0d0c @@ -5900,7 +6731,152 @@ local.get $1 f64x2.replace_lane 1 ) + (func $~lib/rt/__visit_globals (param $0 i32) + (local $1 i32) + i32.const 272 + local.get $0 + call $~lib/rt/itcms/__visit + i32.const 80 + local.get $0 + call $~lib/rt/itcms/__visit + ) + (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/itcms/__visit + end + ) + (func $~lib/array/Array#__visit (param $0 i32) (param $1 i32) + i32.const 0 + drop + local.get $0 + i32.load + local.get $1 + call $~lib/rt/itcms/__visit + ) + (func $~lib/array/Array~visit (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + call $~lib/array/Array#__visit + ) + (func $~lib/array/Array#__visit (param $0 i32) (param $1 i32) + i32.const 0 + drop + local.get $0 + i32.load + local.get $1 + call $~lib/rt/itcms/__visit + ) + (func $~lib/array/Array~visit (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + call $~lib/array/Array#__visit + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + block $invalid + block $~lib/array/Array + block $~lib/array/Array + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/array/Array $~lib/array/Array $invalid + end + return + end + return + end + local.get $0 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView~visit + return + end + local.get $0 + local.get $1 + call $~lib/array/Array~visit + return + end + local.get $0 + local.get $1 + call $~lib/array/Array~visit + return + end + unreachable + ) (func $~start call $start:simd ) + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s + if + i32.const 17008 + i32.const 17056 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__newArray (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.shl + local.set $4 + global.get $~lib/memory/__stack_pointer + local.get $4 + i32.const 0 + local.get $3 + call $~lib/rt/__newBuffer + local.tee $5 + i32.store + i32.const 16 + local.get $2 + call $~lib/rt/itcms/__new + local.set $6 + local.get $6 + local.get $5 + i32.store + local.get $6 + local.get $5 + i32.const 0 + call $~lib/rt/itcms/__link + local.get $6 + local.get $5 + i32.store offset=4 + local.get $6 + local.get $4 + i32.store offset=8 + local.get $6 + local.get $0 + i32.store offset=12 + local.get $6 + local.set $7 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $7 + ) ) diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 3349025832..8088f7be22 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -1,11 +1,13 @@ (module (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_v128 (func (param i32 i32 i32) (result v128))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_none (func (param i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result v128))) (type $i32_i32_i32_i32_i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32 i32 i32 i32 i32) (result v128))) (type $i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32) (result v128))) @@ -16,14 +18,36 @@ (type $f64_=>_v128 (func (param f64) (result v128))) (type $f64_f64_=>_v128 (func (param f64 f64) (result v128))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 18012)) (memory $0 1) - (data (i32.const 1036) "<") - (data (i32.const 1048) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 1100) "<") - (data (i32.const 1112) "\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") - (data (i32.const 1164) ",") - (data (i32.const 1176) "\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s") + (data (i32.const 1036) ",") + (data (i32.const 1052) "\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04") + (data (i32.const 1084) "<") + (data (i32.const 1096) "\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 1148) "<") + (data (i32.const 1160) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s") + (data (i32.const 1276) "<") + (data (i32.const 1288) "\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1340) ",") + (data (i32.const 1352) "\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 1420) "<") + (data (i32.const 1432) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 1484) ",") + (data (i32.const 1496) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1532) ",") + (data (i32.const 1544) "\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s") + (data (i32.const 1584) "\05\00\00\00 \00\00\00\00\00\00\00 ") + (data (i32.const 1612) "\02\04\00\00\00\00\00\00\02\t") (export "test_vars_i8x16_partial" (func $simd/test_vars_i8x16_partial)) (export "test_vars_i8x16_full" (func $simd/test_vars_i8x16_full)) (export "test_vars_i16x8_partial" (func $simd/test_vars_i16x8_partial)) @@ -38,6 +62,183 @@ (export "test_vars_f64x2_full" (func $simd/test_vars_f64x2_full)) (export "memory" (memory $0)) (start $~start) + (func $~lib/rt/itcms/visitRoots + (local $0 i32) + (local $1 i32) + i32.const 1296 + call $byn-split-outlined-A$~lib/rt/itcms/__visit + i32.const 1104 + call $byn-split-outlined-A$~lib/rt/itcms/__visit + global.get $~lib/rt/itcms/pinSpace + local.tee $1 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|0 + local.get $0 + local.get $1 + i32.ne + if + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.const 3 + i32.ne + if + i32.const 0 + i32.const 1168 + i32.const 159 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#makeGray (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/rt/itcms/iter + i32.eq + if + local.get $0 + i32.load offset=8 + local.tee $1 + i32.eqz + if + i32.const 0 + i32.const 1168 + i32.const 147 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.set $~lib/rt/itcms/iter + end + block $__inlined_func$~lib/rt/itcms/Object#unlink + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.tee $1 + i32.eqz + if + i32.const 0 + local.get $0 + i32.const 18012 + i32.lt_u + local.get $0 + i32.load offset=8 + select + i32.eqz + if + i32.const 0 + i32.const 1168 + i32.const 127 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + br $__inlined_func$~lib/rt/itcms/Object#unlink + end + local.get $0 + i32.load offset=8 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 1168 + i32.const 131 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.store offset=8 + local.get $2 + local.get $1 + local.get $2 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + end + global.get $~lib/rt/itcms/toSpace + local.set $2 + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 1584 + i32.load + i32.gt_u + if + i32.const 1296 + i32.const 1360 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 3 + i32.shl + i32.const 1588 + i32.add + i32.load + i32.const 32 + i32.and + end + local.set $3 + local.get $2 + i32.load offset=8 + local.set $1 + local.get $0 + global.get $~lib/rt/itcms/white + i32.eqz + i32.const 2 + local.get $3 + select + local.get $2 + i32.or + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $1 + local.get $0 + local.get $1 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + local.get $2 + local.get $0 + i32.store offset=8 + ) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -51,7 +252,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 268 i32.const 14 call $~lib/builtins/abort @@ -65,7 +266,7 @@ i32.lt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 270 i32.const 14 call $~lib/builtins/abort @@ -111,7 +312,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 284 i32.const 14 call $~lib/builtins/abort @@ -201,7 +402,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 201 i32.const 14 call $~lib/builtins/abort @@ -215,7 +416,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 203 i32.const 14 call $~lib/builtins/abort @@ -276,7 +477,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 221 i32.const 16 call $~lib/builtins/abort @@ -309,7 +510,7 @@ i32.lt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 233 i32.const 14 call $~lib/builtins/abort @@ -324,7 +525,7 @@ i32.ne if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 234 i32.const 14 call $~lib/builtins/abort @@ -375,7 +576,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 251 i32.const 14 call $~lib/builtins/abort @@ -445,7 +646,7 @@ i32.gt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 377 i32.const 14 call $~lib/builtins/abort @@ -470,7 +671,7 @@ i32.gt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 384 i32.const 16 call $~lib/builtins/abort @@ -498,7 +699,7 @@ i32.gt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 397 i32.const 5 call $~lib/builtins/abort @@ -569,10 +770,10 @@ if unreachable end - i32.const 17600 + i32.const 18016 i32.const 0 i32.store - i32.const 19168 + i32.const 19584 i32.const 0 i32.store loop $for-loop|0 @@ -583,7 +784,7 @@ local.get $0 i32.const 2 i32.shl - i32.const 17600 + i32.const 18016 i32.add i32.const 0 i32.store offset=4 @@ -601,7 +802,7 @@ i32.add i32.const 2 i32.shl - i32.const 17600 + i32.const 18016 i32.add i32.const 0 i32.store offset=96 @@ -619,127 +820,398 @@ br $for-loop|0 end end - i32.const 17600 - i32.const 19172 + i32.const 18016 + i32.const 19588 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 17600 + i32.const 18016 global.set $~lib/rt/tlsf/ROOT ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__free (param $0 i32) + (local $1 i32) (local $2 i32) - (local $3 i32) - local.get $1 - i32.const 256 + local.get $0 + i32.const 18012 i32.lt_u - if (result i32) - local.get $1 - i32.const 4 - i32.shr_u - else - i32.const 31 - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - local.get $1 - local.get $1 - i32.const 536870910 - i32.lt_u - select - local.tee $1 - i32.clz - i32.sub - local.tee $3 - i32.const 7 - i32.sub - local.set $2 - local.get $1 - local.get $3 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor + if + return end - local.tee $1 - i32.const 16 - i32.lt_u - local.get $2 - i32.const 23 - i32.lt_u - i32.and + global.get $~lib/rt/tlsf/ROOT i32.eqz if - i32.const 0 - i32.const 1056 - i32.const 330 - i32.const 14 - call $~lib/builtins/abort - unreachable + call $~lib/rt/tlsf/initialize end + global.get $~lib/rt/tlsf/ROOT local.get $0 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const -1 - local.get $1 - i32.shl + i32.const 4 + i32.sub + local.set $1 + local.get $0 + i32.const 15 i32.and - local.tee $1 + i32.const 1 + local.get $0 + select if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.get $2 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 + i32.const 1 else - local.get $0 + local.get $1 i32.load - i32.const -1 - local.get $2 i32.const 1 - i32.add - i32.shl i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.tee $2 - i32.eqz - if - i32.const 0 - i32.const 1056 - i32.const 343 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 + end + if + i32.const 0 + i32.const 1440 + i32.const 559 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/itcms/step (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + block $break|0 + block $case2|0 + block $case1|0 + block $case0|0 + global.get $~lib/rt/itcms/state + br_table $case0|0 $case1|0 $case2|0 $break|0 + end + i32.const 1 + global.set $~lib/rt/itcms/state + i32.const 0 + global.set $~lib/rt/itcms/visitCount + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/visitCount + return + end + global.get $~lib/rt/itcms/white + i32.eqz + local.set $1 + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|1 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + global.set $~lib/rt/itcms/iter + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.ne + if + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.get $1 + i32.or + i32.store offset=4 + i32.const 0 + global.set $~lib/rt/itcms/visitCount + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + global.get $~lib/rt/itcms/visitCount + return + end + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|1 + end + end + i32.const 0 + global.set $~lib/rt/itcms/visitCount + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + i32.eq + if + global.get $~lib/memory/__stack_pointer + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 18012 + i32.lt_u + if + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + call $byn-split-outlined-A$~lib/rt/itcms/__visit + end + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $while-continue|0 + end + end + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|2 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.ne + if + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.get $1 + i32.or + i32.store offset=4 + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + end + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|2 + end + end + global.get $~lib/rt/itcms/fromSpace + local.set $0 + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/fromSpace + local.get $0 + global.set $~lib/rt/itcms/toSpace + local.get $1 + global.set $~lib/rt/itcms/white + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + global.set $~lib/rt/itcms/iter + i32.const 2 + global.set $~lib/rt/itcms/state + end + global.get $~lib/rt/itcms/visitCount + return + end + global.get $~lib/rt/itcms/iter + local.tee $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -4 + i32.and + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/white + i32.eqz + local.get $1 + i32.const 3 + i32.and + i32.ne + if + i32.const 0 + i32.const 1168 + i32.const 228 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 18012 + i32.lt_u + if + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + else + global.get $~lib/rt/itcms/total + local.get $0 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.sub + global.set $~lib/rt/itcms/total + local.get $0 + i32.const 4 + i32.add + call $~lib/rt/tlsf/__free + end + i32.const 10 + return + end + global.get $~lib/rt/itcms/toSpace + local.tee $0 + local.get $0 + i32.store offset=4 + local.get $0 + local.get $0 + i32.store offset=8 + i32.const 0 + global.set $~lib/rt/itcms/state + end + i32.const 0 + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + else + i32.const 31 + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + local.get $1 + local.get $1 + i32.const 536870910 + i32.lt_u + select + local.tee $1 + i32.clz + i32.sub + local.tee $3 + i32.const 7 + i32.sub + local.set $2 + local.get $1 + local.get $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + end + local.tee $1 + i32.const 16 + i32.lt_u + local.get $2 + i32.const 23 + i32.lt_u + i32.and + i32.eqz + if + i32.const 0 + i32.const 1440 + i32.const 330 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 1440 + i32.const 343 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 i32.ctz local.get $1 i32.const 4 @@ -762,8 +1234,8 @@ i32.const 1073741820 i32.gt_u if - i32.const 1120 - i32.const 1056 + i32.const 1104 + i32.const 1440 i32.const 458 i32.const 29 call $~lib/builtins/abort @@ -853,7 +1325,7 @@ i32.eqz if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 496 i32.const 16 call $~lib/builtins/abort @@ -868,7 +1340,7 @@ i32.gt_u if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 498 i32.const 14 call $~lib/builtins/abort @@ -887,7 +1359,7 @@ i32.and if i32.const 0 - i32.const 1056 + i32.const 1440 i32.const 357 i32.const 14 call $~lib/builtins/abort @@ -947,14 +1419,53 @@ end local.get $1 ) - (func $~lib/rt/tlsf/__free (param $0 i32) + (func $~lib/rt/itcms/__new (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - local.get $0 - i32.const 17596 - i32.lt_u + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u if - return + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $1 + loop $do-loop|0 + local.get $1 + call $~lib/rt/itcms/step + i32.sub + local.set $1 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $1 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + global.get $~lib/rt/itcms/total + local.tee $1 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + local.get $1 + i32.add + global.set $~lib/rt/itcms/threshold + end end global.get $~lib/rt/tlsf/ROOT i32.eqz @@ -962,40 +1473,53 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT + i32.const 32 + call $~lib/rt/tlsf/allocateBlock + local.tee $1 local.get $0 - i32.const 4 - i32.sub - local.set $1 - local.get $0 - i32.const 15 - i32.and - i32.const 1 - local.get $0 - select - if (result i32) - i32.const 1 - else - local.get $1 - i32.load - i32.const 1 - i32.and - end - if - i32.const 0 - i32.const 1056 - i32.const 559 - i32.const 3 - call $~lib/builtins/abort - unreachable - end + i32.store offset=12 local.get $1 + i32.const 16 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $2 + i32.load offset=8 + local.set $0 local.get $1 - i32.load - i32.const 1 + local.get $2 + global.get $~lib/rt/itcms/white i32.or - i32.store + i32.store offset=4 local.get $1 - call $~lib/rt/tlsf/insertBlock + local.get $0 + i32.store offset=8 + local.get $0 + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $1 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $1 + i32.const 20 + i32.add + local.tee $0 + v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 + v128.store align=1 + local.get $0 ) (func $simd/test_v128 (local $0 i32) @@ -1037,8 +1561,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 67 + i32.const 1552 + i32.const 71 i32.const 5 call $~lib/builtins/abort unreachable @@ -1066,8 +1590,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 77 + i32.const 1552 + i32.const 81 i32.const 5 call $~lib/builtins/abort unreachable @@ -1095,8 +1619,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 87 + i32.const 1552 + i32.const 91 i32.const 5 call $~lib/builtins/abort unreachable @@ -1124,8 +1648,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 97 + i32.const 1552 + i32.const 101 i32.const 5 call $~lib/builtins/abort unreachable @@ -1153,8 +1677,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 107 + i32.const 1552 + i32.const 111 i32.const 5 call $~lib/builtins/abort unreachable @@ -1182,8 +1706,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 117 + i32.const 1552 + i32.const 121 i32.const 5 call $~lib/builtins/abort unreachable @@ -1212,8 +1736,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 188 + i32.const 1552 + i32.const 192 i32.const 5 call $~lib/builtins/abort unreachable @@ -1243,8 +1767,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 196 + i32.const 1552 + i32.const 200 i32.const 5 call $~lib/builtins/abort unreachable @@ -1259,8 +1783,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 198 + i32.const 1552 + i32.const 202 i32.const 5 call $~lib/builtins/abort unreachable @@ -1275,8 +1799,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 200 + i32.const 1552 + i32.const 204 i32.const 5 call $~lib/builtins/abort unreachable @@ -1291,8 +1815,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 202 + i32.const 1552 + i32.const 206 i32.const 5 call $~lib/builtins/abort unreachable @@ -1306,8 +1830,8 @@ i32.eqz if i32.const 0 - i32.const 1184 - i32.const 204 + i32.const 1552 + i32.const 208 i32.const 5 call $~lib/builtins/abort unreachable @@ -1315,6 +1839,350 @@ local.get $0 call $~lib/rt/tlsf/__free ) + (func $start:simd + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + block $folding-inner0 + global.get $~lib/memory/__stack_pointer + i32.const 1628 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 0 + i32.store + memory.size + i32.const 16 + i32.shl + i32.const 18012 + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 1220 + i32.const 1216 + i32.store + i32.const 1224 + i32.const 1216 + i32.store + i32.const 1216 + global.set $~lib/rt/itcms/pinSpace + i32.const 1252 + i32.const 1248 + i32.store + i32.const 1256 + i32.const 1248 + i32.store + i32.const 1248 + global.set $~lib/rt/itcms/toSpace + i32.const 1396 + i32.const 1392 + i32.store + i32.const 1400 + i32.const 1392 + i32.store + i32.const 1392 + global.set $~lib/rt/itcms/fromSpace + local.get $0 + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1628 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $1 + i32.const 0 + i32.store + i32.const 0 + call $~lib/rt/itcms/__new + local.tee $3 + i32.const 1056 + v128.load align=1 + v128.store align=1 + local.get $1 + local.get $3 + i32.store + i32.const 3 + call $~lib/rt/itcms/__new + local.tee $2 + local.get $3 + i32.store + local.get $3 + if + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 1168 + i32.const 294 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/itcms/white + local.get $3 + i32.const 20 + i32.sub + local.tee $4 + i32.load offset=4 + i32.const 3 + i32.and + i32.eq + if + local.get $2 + i32.const 20 + i32.sub + i32.load offset=4 + i32.const 3 + i32.and + local.tee $1 + global.get $~lib/rt/itcms/white + i32.eqz + i32.eq + if + local.get $4 + call $~lib/rt/itcms/Object#makeGray + else + global.get $~lib/rt/itcms/state + i32.const 1 + i32.eq + local.get $1 + i32.const 3 + i32.eq + i32.and + if + local.get $4 + call $~lib/rt/itcms/Object#makeGray + end + end + end + end + local.get $2 + local.get $3 + i32.store offset=4 + local.get $2 + i32.const 16 + i32.store offset=8 + local.get $2 + i32.const 1 + i32.store offset=12 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $0 + local.get $2 + i32.store + local.get $2 + i32.load offset=12 + i32.eqz + if + i32.const 1296 + i32.const 1504 + i32.const 114 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.load offset=4 + v128.load + i32x4.extract_lane 0 + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1552 + i32.const 5 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + call $simd/test_v128 + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + i32.const 16 + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + local.tee $0 + i32.const 1 + i32.store8 + local.get $0 + i32.const 2 + i32.store8 offset=1 + local.get $0 + i32.const 3 + i32.store8 offset=2 + local.get $0 + i32.const 4 + i32.store8 offset=3 + local.get $0 + i32.const 5 + i32.store8 offset=4 + local.get $0 + i32.const 6 + i32.store8 offset=5 + local.get $0 + i32.const 7 + i32.store8 offset=6 + local.get $0 + i32.const 255 + i32.store8 offset=7 + local.get $0 + v128.load8x8_s align=1 + v128.const i32x4 0x00020001 0x00040003 0x00060005 0xffff0007 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 594 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + v128.load8x8_u align=1 + v128.const i32x4 0x00020001 0x00040003 0x00060005 0x00ff0007 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 599 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/__free + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + i32.const 16 + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + local.tee $0 + i32.const 1 + i32.store16 + local.get $0 + i32.const 2 + i32.store16 offset=2 + local.get $0 + i32.const 3 + i32.store16 offset=4 + local.get $0 + i32.const 65535 + i32.store16 offset=6 + local.get $0 + v128.load16x4_s align=2 + v128.const i32x4 0x00000001 0x00000002 0x00000003 0xffffffff + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 768 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + v128.load16x4_u align=2 + v128.const i32x4 0x00000001 0x00000002 0x00000003 0x0000ffff + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 773 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/__free + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + i32.const 16 + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + local.tee $0 + i32.const 1 + i32.store + local.get $0 + i32.const -1 + i32.store offset=4 + local.get $0 + v128.load32x2_s align=4 + v128.const i32x4 0x00000001 0x00000000 0xffffffff 0xffffffff + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 840 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + v128.load32x2_u align=4 + v128.const i32x4 0x00000001 0x00000000 0xffffffff 0x00000000 + i8x16.eq + i8x16.all_true + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 845 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/__free + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + return + end + i32.const 18032 + i32.const 18080 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + ) (func $simd/test_vars_i8x16_partial (param $0 i32) (param $1 i32) (param $2 i32) (result v128) v128.const i32x4 0x03000100 0x07000504 0x0b0a0908 0x000e0d0c local.get $0 @@ -1445,170 +2313,51 @@ local.get $1 f64x2.replace_lane 1 ) - (func $~start - (local $0 i32) - call $simd/test_v128 - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - i32.const 16 - call $~lib/rt/tlsf/allocateBlock - i32.const 4 - i32.add - local.tee $0 - i32.const 1 - i32.store8 - local.get $0 - i32.const 2 - i32.store8 offset=1 - local.get $0 - i32.const 3 - i32.store8 offset=2 - local.get $0 - i32.const 4 - i32.store8 offset=3 - local.get $0 - i32.const 5 - i32.store8 offset=4 - local.get $0 - i32.const 6 - i32.store8 offset=5 - local.get $0 - i32.const 7 - i32.store8 offset=6 - local.get $0 - i32.const 255 - i32.store8 offset=7 - local.get $0 - v128.load8x8_s align=1 - v128.const i32x4 0x00020001 0x00040003 0x00060005 0xffff0007 - i8x16.eq - i8x16.all_true - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 590 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - v128.load8x8_u align=1 - v128.const i32x4 0x00020001 0x00040003 0x00060005 0x00ff0007 - i8x16.eq - i8x16.all_true - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 595 - i32.const 5 - call $~lib/builtins/abort + (func $~lib/rt/__visit_members (param $0 i32) + block $folding-inner0 + block $invalid + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $folding-inner0 $folding-inner0 $folding-inner0 $invalid + end + return + end + return + end unreachable end local.get $0 - call $~lib/rt/tlsf/__free - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - i32.const 16 - call $~lib/rt/tlsf/allocateBlock - i32.const 4 - i32.add + i32.load local.tee $0 - i32.const 1 - i32.store16 - local.get $0 - i32.const 2 - i32.store16 offset=2 - local.get $0 - i32.const 3 - i32.store16 offset=4 - local.get $0 - i32.const 65535 - i32.store16 offset=6 - local.get $0 - v128.load16x4_s align=2 - v128.const i32x4 0x00000001 0x00000002 0x00000003 0xffffffff - i8x16.eq - i8x16.all_true - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 764 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - v128.load16x4_u align=2 - v128.const i32x4 0x00000001 0x00000002 0x00000003 0x0000ffff - i8x16.eq - i8x16.all_true - i32.eqz if - i32.const 0 - i32.const 1184 - i32.const 769 - i32.const 5 - call $~lib/builtins/abort - unreachable + local.get $0 + call $byn-split-outlined-A$~lib/rt/itcms/__visit end + ) + (func $~start + call $start:simd + ) + (func $byn-split-outlined-A$~lib/rt/itcms/__visit (param $0 i32) + global.get $~lib/rt/itcms/white local.get $0 - call $~lib/rt/tlsf/__free - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - i32.const 16 - call $~lib/rt/tlsf/allocateBlock - i32.const 4 - i32.add + i32.const 20 + i32.sub local.tee $0 - i32.const 1 - i32.store - local.get $0 - i32.const -1 - i32.store offset=4 - local.get $0 - v128.load32x2_s align=4 - v128.const i32x4 0x00000001 0x00000000 0xffffffff 0xffffffff - i8x16.eq - i8x16.all_true - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 836 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - v128.load32x2_u align=4 - v128.const i32x4 0x00000001 0x00000000 0xffffffff 0x00000000 - i8x16.eq - i8x16.all_true - i32.eqz + i32.load offset=4 + i32.const 3 + i32.and + i32.eq if - i32.const 0 - i32.const 1184 - i32.const 841 - i32.const 5 - call $~lib/builtins/abort - unreachable + local.get $0 + call $~lib/rt/itcms/Object#makeGray + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.add + global.set $~lib/rt/itcms/visitCount end - local.get $0 - call $~lib/rt/tlsf/__free ) ) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 562ea6ae3c..b66a45d628 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -1,5 +1,9 @@ // hint: asc tests/compiler/simd --enable simd - +{ + //test static array literal + let arr = [i32x4(1, 2, 3, 4)]; + assert(v128.extract_lane(arr[0], 0) == 1); +} function test_v128(): void { // check trueish // @ts-ignore From cf9219f77b857ad388a91c12d815a2ff018d98f9 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 10:31:44 +0800 Subject: [PATCH 12/16] fix format check issue --- tests/compiler/simd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index b66a45d628..2ef82efb47 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -1,6 +1,6 @@ // hint: asc tests/compiler/simd --enable simd { - //test static array literal + // test static array literal let arr = [i32x4(1, 2, 3, 4)]; assert(v128.extract_lane(arr[0], 0) == 1); } From fd83015dc6e0690b5710a2451d621dd9563b5146 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 12:56:26 +0800 Subject: [PATCH 13/16] fix: use directly compare instead of extrace_lane --- tests/compiler/simd.debug.wat | 437 +++++++++++--------------------- tests/compiler/simd.release.wat | 12 +- tests/compiler/simd.ts | 25 +- 3 files changed, 165 insertions(+), 309 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index dbb34e392c..9902639b95 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -2767,9 +2767,11 @@ f32x4.ceil local.set $1 local.get $1 - f32x4.extract_lane 0 - f32.const 2 - f32.eq + v128.const i32x4 0x40000000 0x80000000 0x428e0000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -2779,96 +2781,20 @@ call $~lib/builtins/abort unreachable end - local.get $1 - f32x4.extract_lane 1 - f32.const 0 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 214 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f32x4.extract_lane 2 - f32.const 71 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 215 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f32x4.extract_lane 3 - f32.const 4 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 216 - i32.const 5 - call $~lib/builtins/abort - unreachable - end v128.const i32x4 0x3f8ccccd 0xbe800000 0x428c051f 0x40800000 f32x4.floor local.set $1 local.get $1 - f32x4.extract_lane 0 - f32.const 1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 220 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f32x4.extract_lane 1 - f32.const -1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 221 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f32x4.extract_lane 2 - f32.const 70 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 222 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f32x4.extract_lane 3 - f32.const 4 - f32.eq + v128.const i32x4 0x3f800000 0xbf800000 0x428c0000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 i32.const 528 - i32.const 223 + i32.const 217 i32.const 5 call $~lib/builtins/abort unreachable @@ -2942,7 +2868,7 @@ if i32.const 0 i32.const 528 - i32.const 292 + i32.const 286 i32.const 3 call $~lib/builtins/abort unreachable @@ -2960,7 +2886,7 @@ if i32.const 0 i32.const 528 - i32.const 294 + i32.const 288 i32.const 3 call $~lib/builtins/abort unreachable @@ -2979,7 +2905,7 @@ if i32.const 0 i32.const 528 - i32.const 296 + i32.const 290 i32.const 3 call $~lib/builtins/abort unreachable @@ -2996,7 +2922,7 @@ if i32.const 0 i32.const 528 - i32.const 297 + i32.const 291 i32.const 3 call $~lib/builtins/abort unreachable @@ -3057,7 +2983,7 @@ if i32.const 0 i32.const 528 - i32.const 338 + i32.const 332 i32.const 3 call $~lib/builtins/abort unreachable @@ -3071,7 +2997,7 @@ if i32.const 0 i32.const 528 - i32.const 343 + i32.const 337 i32.const 3 call $~lib/builtins/abort unreachable @@ -3085,7 +3011,7 @@ if i32.const 0 i32.const 528 - i32.const 344 + i32.const 338 i32.const 3 call $~lib/builtins/abort unreachable @@ -3100,7 +3026,7 @@ if i32.const 0 i32.const 528 - i32.const 345 + i32.const 339 i32.const 3 call $~lib/builtins/abort unreachable @@ -3117,7 +3043,7 @@ if i32.const 0 i32.const 528 - i32.const 346 + i32.const 340 i32.const 3 call $~lib/builtins/abort unreachable @@ -3134,7 +3060,7 @@ if i32.const 0 i32.const 528 - i32.const 351 + i32.const 345 i32.const 3 call $~lib/builtins/abort unreachable @@ -3258,7 +3184,7 @@ if i32.const 0 i32.const 528 - i32.const 389 + i32.const 383 i32.const 3 call $~lib/builtins/abort unreachable @@ -3275,7 +3201,7 @@ if i32.const 0 i32.const 528 - i32.const 390 + i32.const 384 i32.const 3 call $~lib/builtins/abort unreachable @@ -3292,7 +3218,7 @@ if i32.const 0 i32.const 528 - i32.const 391 + i32.const 385 i32.const 3 call $~lib/builtins/abort unreachable @@ -3309,7 +3235,7 @@ if i32.const 0 i32.const 528 - i32.const 392 + i32.const 386 i32.const 3 call $~lib/builtins/abort unreachable @@ -3326,7 +3252,7 @@ if i32.const 0 i32.const 528 - i32.const 393 + i32.const 387 i32.const 3 call $~lib/builtins/abort unreachable @@ -3343,7 +3269,7 @@ if i32.const 0 i32.const 528 - i32.const 394 + i32.const 388 i32.const 3 call $~lib/builtins/abort unreachable @@ -3360,7 +3286,7 @@ if i32.const 0 i32.const 528 - i32.const 395 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable @@ -3377,7 +3303,7 @@ if i32.const 0 i32.const 528 - i32.const 396 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable @@ -3394,7 +3320,7 @@ if i32.const 0 i32.const 528 - i32.const 397 + i32.const 391 i32.const 3 call $~lib/builtins/abort unreachable @@ -3411,7 +3337,7 @@ if i32.const 0 i32.const 528 - i32.const 398 + i32.const 392 i32.const 3 call $~lib/builtins/abort unreachable @@ -3456,7 +3382,7 @@ if i32.const 0 i32.const 528 - i32.const 404 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -3475,7 +3401,7 @@ if i32.const 0 i32.const 528 - i32.const 410 + i32.const 404 i32.const 5 call $~lib/builtins/abort unreachable @@ -3491,7 +3417,7 @@ if i32.const 0 i32.const 528 - i32.const 415 + i32.const 409 i32.const 5 call $~lib/builtins/abort unreachable @@ -3560,7 +3486,7 @@ if i32.const 0 i32.const 528 - i32.const 470 + i32.const 464 i32.const 3 call $~lib/builtins/abort unreachable @@ -3578,7 +3504,7 @@ if i32.const 0 i32.const 528 - i32.const 472 + i32.const 466 i32.const 3 call $~lib/builtins/abort unreachable @@ -3597,7 +3523,7 @@ if i32.const 0 i32.const 528 - i32.const 474 + i32.const 468 i32.const 3 call $~lib/builtins/abort unreachable @@ -3614,7 +3540,7 @@ if i32.const 0 i32.const 528 - i32.const 475 + i32.const 469 i32.const 3 call $~lib/builtins/abort unreachable @@ -3631,7 +3557,7 @@ if i32.const 0 i32.const 528 - i32.const 476 + i32.const 470 i32.const 3 call $~lib/builtins/abort unreachable @@ -3692,7 +3618,7 @@ if i32.const 0 i32.const 528 - i32.const 517 + i32.const 511 i32.const 3 call $~lib/builtins/abort unreachable @@ -3706,7 +3632,7 @@ if i32.const 0 i32.const 528 - i32.const 522 + i32.const 516 i32.const 3 call $~lib/builtins/abort unreachable @@ -3720,7 +3646,7 @@ if i32.const 0 i32.const 528 - i32.const 523 + i32.const 517 i32.const 3 call $~lib/builtins/abort unreachable @@ -3735,7 +3661,7 @@ if i32.const 0 i32.const 528 - i32.const 524 + i32.const 518 i32.const 3 call $~lib/builtins/abort unreachable @@ -3752,7 +3678,7 @@ if i32.const 0 i32.const 528 - i32.const 525 + i32.const 519 i32.const 3 call $~lib/builtins/abort unreachable @@ -3769,7 +3695,7 @@ if i32.const 0 i32.const 528 - i32.const 530 + i32.const 524 i32.const 3 call $~lib/builtins/abort unreachable @@ -3893,7 +3819,7 @@ if i32.const 0 i32.const 528 - i32.const 568 + i32.const 562 i32.const 3 call $~lib/builtins/abort unreachable @@ -3910,7 +3836,7 @@ if i32.const 0 i32.const 528 - i32.const 569 + i32.const 563 i32.const 3 call $~lib/builtins/abort unreachable @@ -3927,7 +3853,7 @@ if i32.const 0 i32.const 528 - i32.const 570 + i32.const 564 i32.const 3 call $~lib/builtins/abort unreachable @@ -3944,7 +3870,7 @@ if i32.const 0 i32.const 528 - i32.const 571 + i32.const 565 i32.const 3 call $~lib/builtins/abort unreachable @@ -3961,7 +3887,7 @@ if i32.const 0 i32.const 528 - i32.const 572 + i32.const 566 i32.const 3 call $~lib/builtins/abort unreachable @@ -3978,7 +3904,7 @@ if i32.const 0 i32.const 528 - i32.const 573 + i32.const 567 i32.const 3 call $~lib/builtins/abort unreachable @@ -3995,7 +3921,7 @@ if i32.const 0 i32.const 528 - i32.const 574 + i32.const 568 i32.const 3 call $~lib/builtins/abort unreachable @@ -4012,7 +3938,7 @@ if i32.const 0 i32.const 528 - i32.const 575 + i32.const 569 i32.const 3 call $~lib/builtins/abort unreachable @@ -4029,7 +3955,7 @@ if i32.const 0 i32.const 528 - i32.const 576 + i32.const 570 i32.const 3 call $~lib/builtins/abort unreachable @@ -4046,7 +3972,7 @@ if i32.const 0 i32.const 528 - i32.const 577 + i32.const 571 i32.const 3 call $~lib/builtins/abort unreachable @@ -4161,7 +4087,7 @@ if i32.const 0 i32.const 528 - i32.const 594 + i32.const 588 i32.const 5 call $~lib/builtins/abort unreachable @@ -4177,7 +4103,7 @@ if i32.const 0 i32.const 528 - i32.const 599 + i32.const 593 i32.const 5 call $~lib/builtins/abort unreachable @@ -4279,7 +4205,7 @@ if i32.const 0 i32.const 528 - i32.const 665 + i32.const 659 i32.const 3 call $~lib/builtins/abort unreachable @@ -4297,7 +4223,7 @@ if i32.const 0 i32.const 528 - i32.const 667 + i32.const 661 i32.const 3 call $~lib/builtins/abort unreachable @@ -4316,7 +4242,7 @@ if i32.const 0 i32.const 528 - i32.const 669 + i32.const 663 i32.const 3 call $~lib/builtins/abort unreachable @@ -4333,7 +4259,7 @@ if i32.const 0 i32.const 528 - i32.const 670 + i32.const 664 i32.const 3 call $~lib/builtins/abort unreachable @@ -4350,7 +4276,7 @@ if i32.const 0 i32.const 528 - i32.const 671 + i32.const 665 i32.const 3 call $~lib/builtins/abort unreachable @@ -4411,7 +4337,7 @@ if i32.const 0 i32.const 528 - i32.const 712 + i32.const 706 i32.const 3 call $~lib/builtins/abort unreachable @@ -4424,7 +4350,7 @@ if i32.const 0 i32.const 528 - i32.const 717 + i32.const 711 i32.const 3 call $~lib/builtins/abort unreachable @@ -4437,7 +4363,7 @@ if i32.const 0 i32.const 528 - i32.const 718 + i32.const 712 i32.const 3 call $~lib/builtins/abort unreachable @@ -4454,7 +4380,7 @@ if i32.const 0 i32.const 528 - i32.const 719 + i32.const 713 i32.const 3 call $~lib/builtins/abort unreachable @@ -4471,7 +4397,7 @@ if i32.const 0 i32.const 528 - i32.const 724 + i32.const 718 i32.const 3 call $~lib/builtins/abort unreachable @@ -4551,7 +4477,7 @@ if i32.const 0 i32.const 528 - i32.const 738 + i32.const 732 i32.const 3 call $~lib/builtins/abort unreachable @@ -4568,7 +4494,7 @@ if i32.const 0 i32.const 528 - i32.const 739 + i32.const 733 i32.const 3 call $~lib/builtins/abort unreachable @@ -4585,7 +4511,7 @@ if i32.const 0 i32.const 528 - i32.const 740 + i32.const 734 i32.const 3 call $~lib/builtins/abort unreachable @@ -4602,7 +4528,7 @@ if i32.const 0 i32.const 528 - i32.const 741 + i32.const 735 i32.const 3 call $~lib/builtins/abort unreachable @@ -4619,7 +4545,7 @@ if i32.const 0 i32.const 528 - i32.const 742 + i32.const 736 i32.const 3 call $~lib/builtins/abort unreachable @@ -4636,7 +4562,7 @@ if i32.const 0 i32.const 528 - i32.const 743 + i32.const 737 i32.const 3 call $~lib/builtins/abort unreachable @@ -4653,7 +4579,7 @@ if i32.const 0 i32.const 528 - i32.const 744 + i32.const 738 i32.const 3 call $~lib/builtins/abort unreachable @@ -4670,7 +4596,7 @@ if i32.const 0 i32.const 528 - i32.const 745 + i32.const 739 i32.const 3 call $~lib/builtins/abort unreachable @@ -4687,7 +4613,7 @@ if i32.const 0 i32.const 528 - i32.const 746 + i32.const 740 i32.const 3 call $~lib/builtins/abort unreachable @@ -4704,7 +4630,7 @@ if i32.const 0 i32.const 528 - i32.const 747 + i32.const 741 i32.const 3 call $~lib/builtins/abort unreachable @@ -4803,7 +4729,7 @@ if i32.const 0 i32.const 528 - i32.const 768 + i32.const 762 i32.const 5 call $~lib/builtins/abort unreachable @@ -4819,7 +4745,7 @@ if i32.const 0 i32.const 528 - i32.const 773 + i32.const 767 i32.const 5 call $~lib/builtins/abort unreachable @@ -4919,7 +4845,7 @@ if i32.const 0 i32.const 528 - i32.const 807 + i32.const 801 i32.const 3 call $~lib/builtins/abort unreachable @@ -4937,7 +4863,7 @@ if i32.const 0 i32.const 528 - i32.const 809 + i32.const 803 i32.const 3 call $~lib/builtins/abort unreachable @@ -4956,7 +4882,7 @@ if i32.const 0 i32.const 528 - i32.const 811 + i32.const 805 i32.const 3 call $~lib/builtins/abort unreachable @@ -4973,7 +4899,7 @@ if i32.const 0 i32.const 528 - i32.const 812 + i32.const 806 i32.const 3 call $~lib/builtins/abort unreachable @@ -4990,7 +4916,7 @@ if i32.const 0 i32.const 528 - i32.const 813 + i32.const 807 i32.const 3 call $~lib/builtins/abort unreachable @@ -5006,7 +4932,7 @@ if i32.const 0 i32.const 528 - i32.const 814 + i32.const 808 i32.const 3 call $~lib/builtins/abort unreachable @@ -5019,7 +4945,7 @@ if i32.const 0 i32.const 528 - i32.const 819 + i32.const 813 i32.const 3 call $~lib/builtins/abort unreachable @@ -5032,7 +4958,7 @@ if i32.const 0 i32.const 528 - i32.const 820 + i32.const 814 i32.const 3 call $~lib/builtins/abort unreachable @@ -5049,7 +4975,7 @@ if i32.const 0 i32.const 528 - i32.const 821 + i32.const 815 i32.const 3 call $~lib/builtins/abort unreachable @@ -5066,7 +4992,7 @@ if i32.const 0 i32.const 528 - i32.const 826 + i32.const 820 i32.const 3 call $~lib/builtins/abort unreachable @@ -5139,7 +5065,7 @@ if i32.const 0 i32.const 528 - i32.const 840 + i32.const 834 i32.const 5 call $~lib/builtins/abort unreachable @@ -5155,7 +5081,7 @@ if i32.const 0 i32.const 528 - i32.const 845 + i32.const 839 i32.const 5 call $~lib/builtins/abort unreachable @@ -5535,7 +5461,7 @@ if i32.const 0 i32.const 528 - i32.const 918 + i32.const 912 i32.const 3 call $~lib/builtins/abort unreachable @@ -5553,7 +5479,7 @@ if i32.const 0 i32.const 528 - i32.const 920 + i32.const 914 i32.const 3 call $~lib/builtins/abort unreachable @@ -5572,7 +5498,7 @@ if i32.const 0 i32.const 528 - i32.const 922 + i32.const 916 i32.const 3 call $~lib/builtins/abort unreachable @@ -5589,7 +5515,7 @@ if i32.const 0 i32.const 528 - i32.const 923 + i32.const 917 i32.const 3 call $~lib/builtins/abort unreachable @@ -5606,7 +5532,7 @@ if i32.const 0 i32.const 528 - i32.const 924 + i32.const 918 i32.const 3 call $~lib/builtins/abort unreachable @@ -5627,7 +5553,7 @@ if i32.const 0 i32.const 528 - i32.const 926 + i32.const 920 i32.const 3 call $~lib/builtins/abort unreachable @@ -5644,7 +5570,7 @@ if i32.const 0 i32.const 528 - i32.const 927 + i32.const 921 i32.const 3 call $~lib/builtins/abort unreachable @@ -5660,7 +5586,7 @@ if i32.const 0 i32.const 528 - i32.const 928 + i32.const 922 i32.const 3 call $~lib/builtins/abort unreachable @@ -5673,7 +5599,7 @@ if i32.const 0 i32.const 528 - i32.const 929 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -5686,7 +5612,7 @@ if i32.const 0 i32.const 528 - i32.const 930 + i32.const 924 i32.const 3 call $~lib/builtins/abort unreachable @@ -5703,7 +5629,7 @@ if i32.const 0 i32.const 528 - i32.const 931 + i32.const 925 i32.const 3 call $~lib/builtins/abort unreachable @@ -5720,7 +5646,7 @@ if i32.const 0 i32.const 528 - i32.const 936 + i32.const 930 i32.const 3 call $~lib/builtins/abort unreachable @@ -5751,7 +5677,7 @@ if i32.const 0 i32.const 528 - i32.const 945 + i32.const 939 i32.const 3 call $~lib/builtins/abort unreachable @@ -5768,7 +5694,7 @@ if i32.const 0 i32.const 528 - i32.const 946 + i32.const 940 i32.const 3 call $~lib/builtins/abort unreachable @@ -5785,7 +5711,7 @@ if i32.const 0 i32.const 528 - i32.const 947 + i32.const 941 i32.const 3 call $~lib/builtins/abort unreachable @@ -5802,7 +5728,7 @@ if i32.const 0 i32.const 528 - i32.const 948 + i32.const 942 i32.const 3 call $~lib/builtins/abort unreachable @@ -5819,7 +5745,7 @@ if i32.const 0 i32.const 528 - i32.const 949 + i32.const 943 i32.const 3 call $~lib/builtins/abort unreachable @@ -5836,7 +5762,7 @@ if i32.const 0 i32.const 528 - i32.const 950 + i32.const 944 i32.const 3 call $~lib/builtins/abort unreachable @@ -5853,7 +5779,7 @@ if i32.const 0 i32.const 528 - i32.const 951 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -5870,7 +5796,7 @@ if i32.const 0 i32.const 528 - i32.const 952 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -5886,7 +5812,7 @@ if i32.const 0 i32.const 528 - i32.const 953 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -5944,53 +5870,16 @@ f32x4.ceil local.set $8 local.get $8 - f32x4.extract_lane 0 - f32.const 2 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 980 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 1 - f32.const 0 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 981 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 2 - f32.const 71 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 982 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f32x4.extract_lane 3 - f32.const 4 - f32.eq + v128.const i32x4 0x40000000 0x80000000 0x428e0000 0x40800000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 i32.const 528 - i32.const 983 + i32.const 974 i32.const 5 call $~lib/builtins/abort unreachable @@ -6008,7 +5897,7 @@ if i32.const 0 i32.const 528 - i32.const 987 + i32.const 978 i32.const 5 call $~lib/builtins/abort unreachable @@ -6052,7 +5941,7 @@ if i32.const 0 i32.const 528 - i32.const 1003 + i32.const 994 i32.const 3 call $~lib/builtins/abort unreachable @@ -6070,7 +5959,7 @@ if i32.const 0 i32.const 528 - i32.const 1005 + i32.const 996 i32.const 3 call $~lib/builtins/abort unreachable @@ -6089,7 +5978,7 @@ if i32.const 0 i32.const 528 - i32.const 1007 + i32.const 998 i32.const 3 call $~lib/builtins/abort unreachable @@ -6106,7 +5995,7 @@ if i32.const 0 i32.const 528 - i32.const 1008 + i32.const 999 i32.const 3 call $~lib/builtins/abort unreachable @@ -6123,7 +6012,7 @@ if i32.const 0 i32.const 528 - i32.const 1009 + i32.const 1000 i32.const 3 call $~lib/builtins/abort unreachable @@ -6144,7 +6033,7 @@ if i32.const 0 i32.const 528 - i32.const 1011 + i32.const 1002 i32.const 3 call $~lib/builtins/abort unreachable @@ -6161,7 +6050,7 @@ if i32.const 0 i32.const 528 - i32.const 1012 + i32.const 1003 i32.const 3 call $~lib/builtins/abort unreachable @@ -6177,7 +6066,7 @@ if i32.const 0 i32.const 528 - i32.const 1013 + i32.const 1004 i32.const 3 call $~lib/builtins/abort unreachable @@ -6190,7 +6079,7 @@ if i32.const 0 i32.const 528 - i32.const 1014 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -6203,7 +6092,7 @@ if i32.const 0 i32.const 528 - i32.const 1015 + i32.const 1006 i32.const 3 call $~lib/builtins/abort unreachable @@ -6220,7 +6109,7 @@ if i32.const 0 i32.const 528 - i32.const 1016 + i32.const 1007 i32.const 3 call $~lib/builtins/abort unreachable @@ -6237,7 +6126,7 @@ if i32.const 0 i32.const 528 - i32.const 1021 + i32.const 1012 i32.const 3 call $~lib/builtins/abort unreachable @@ -6268,7 +6157,7 @@ if i32.const 0 i32.const 528 - i32.const 1030 + i32.const 1021 i32.const 3 call $~lib/builtins/abort unreachable @@ -6285,7 +6174,7 @@ if i32.const 0 i32.const 528 - i32.const 1031 + i32.const 1022 i32.const 3 call $~lib/builtins/abort unreachable @@ -6302,7 +6191,7 @@ if i32.const 0 i32.const 528 - i32.const 1032 + i32.const 1023 i32.const 3 call $~lib/builtins/abort unreachable @@ -6319,7 +6208,7 @@ if i32.const 0 i32.const 528 - i32.const 1033 + i32.const 1024 i32.const 3 call $~lib/builtins/abort unreachable @@ -6336,7 +6225,7 @@ if i32.const 0 i32.const 528 - i32.const 1034 + i32.const 1025 i32.const 3 call $~lib/builtins/abort unreachable @@ -6353,7 +6242,7 @@ if i32.const 0 i32.const 528 - i32.const 1035 + i32.const 1026 i32.const 3 call $~lib/builtins/abort unreachable @@ -6370,7 +6259,7 @@ if i32.const 0 i32.const 528 - i32.const 1036 + i32.const 1027 i32.const 3 call $~lib/builtins/abort unreachable @@ -6387,7 +6276,7 @@ if i32.const 0 i32.const 528 - i32.const 1037 + i32.const 1028 i32.const 3 call $~lib/builtins/abort unreachable @@ -6403,7 +6292,7 @@ if i32.const 0 i32.const 528 - i32.const 1038 + i32.const 1029 i32.const 3 call $~lib/builtins/abort unreachable @@ -6447,27 +6336,16 @@ f64x2.ceil local.set $8 local.get $8 - f64x2.extract_lane 0 - f64.const 2 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 1057 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f64x2.extract_lane 1 - f64.const 0 - f64.eq + v128.const i32x4 0x00000000 0x40000000 0x00000000 0x80000000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 i32.const 528 - i32.const 1058 + i32.const 1048 i32.const 5 call $~lib/builtins/abort unreachable @@ -6476,27 +6354,16 @@ f64x2.floor local.set $8 local.get $8 - f64x2.extract_lane 0 - f64.const 1 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 1062 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $8 - f64x2.extract_lane 1 - f64.const -1 - f64.eq + v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0xbff00000 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne i32.eqz if i32.const 0 i32.const 528 - i32.const 1063 + i32.const 1052 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 8088f7be22..c0df6f16e6 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -2051,7 +2051,7 @@ if i32.const 0 i32.const 1552 - i32.const 594 + i32.const 588 i32.const 5 call $~lib/builtins/abort unreachable @@ -2065,7 +2065,7 @@ if i32.const 0 i32.const 1552 - i32.const 599 + i32.const 593 i32.const 5 call $~lib/builtins/abort unreachable @@ -2103,7 +2103,7 @@ if i32.const 0 i32.const 1552 - i32.const 768 + i32.const 762 i32.const 5 call $~lib/builtins/abort unreachable @@ -2117,7 +2117,7 @@ if i32.const 0 i32.const 1552 - i32.const 773 + i32.const 767 i32.const 5 call $~lib/builtins/abort unreachable @@ -2149,7 +2149,7 @@ if i32.const 0 i32.const 1552 - i32.const 840 + i32.const 834 i32.const 5 call $~lib/builtins/abort unreachable @@ -2163,7 +2163,7 @@ if i32.const 0 i32.const 1552 - i32.const 845 + i32.const 839 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 2ef82efb47..081f848723 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -210,17 +210,11 @@ function test_v128(): void { } { let v: v128 = v128.ceil(f32x4(1.1, -0.25, 70.01, 4.0)); - assert(v128.extract_lane(v, 0) == 2.0); - assert(v128.extract_lane(v, 1) == 0.0); - assert(v128.extract_lane(v, 2) == 71.0); - assert(v128.extract_lane(v, 3) == 4.0); + assert(v == f32x4(2, -0.0, 71, 4)); } { - let v: v128 = v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)); - assert(v128.extract_lane(v, 0) == 1.0); - assert(v128.extract_lane(v, 1) == -1); - assert(v128.extract_lane(v, 2) == 70.0); - assert(v128.extract_lane(v, 3) == 4.0); + let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + assert(v == f32x4(1, -1, 70, 4)); } { assert( @@ -977,13 +971,10 @@ function test_f32x4(): void { ); { let v: v128 = f32x4.ceil(f32x4(1.1, -0.25, 70.01, 4.0)); - assert(v128.extract_lane(v, 0) == 2.0); - assert(v128.extract_lane(v, 1) == 0.0); - assert(v128.extract_lane(v, 2) == 71.0); - assert(v128.extract_lane(v, 3) == 4.0); + assert(v == f32x4(2, -0.0, 71, 4)); } { - let v: v128 = f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)); + let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)) assert(v == f32x4(1, -1, 70, 4)); } assert( @@ -1054,13 +1045,11 @@ function test_f64x2(): void { ); { let v: v128 = f64x2.ceil(f64x2(1.1, -0.25)); - assert(v128.extract_lane(v, 0) == 2.0); - assert(v128.extract_lane(v, 1) == 0.0); + assert(v == f64x2(2, -0.0)); } { let v: v128 =f64x2.floor(f64x2(1.1, -0.25)); - assert(v128.extract_lane(v, 0) == 1.0); - assert(v128.extract_lane(v, 1) == -1); + assert(v == f64x2(1, -1)); } assert( f64x2.trunc(f64x2(1.1, 3.9)) From de76fcc5911e1fb12b6df78a35b8f5d735b06e5d Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 13:01:16 +0800 Subject: [PATCH 14/16] pretty format for changes --- tests/compiler/simd.debug.wat | 252 ++++++++++++++++---------------- tests/compiler/simd.release.wat | 12 +- tests/compiler/simd.ts | 9 +- 3 files changed, 138 insertions(+), 135 deletions(-) diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index 9902639b95..9c34856ad8 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -2868,7 +2868,7 @@ if i32.const 0 i32.const 528 - i32.const 286 + i32.const 287 i32.const 3 call $~lib/builtins/abort unreachable @@ -2886,7 +2886,7 @@ if i32.const 0 i32.const 528 - i32.const 288 + i32.const 289 i32.const 3 call $~lib/builtins/abort unreachable @@ -2905,7 +2905,7 @@ if i32.const 0 i32.const 528 - i32.const 290 + i32.const 291 i32.const 3 call $~lib/builtins/abort unreachable @@ -2922,7 +2922,7 @@ if i32.const 0 i32.const 528 - i32.const 291 + i32.const 292 i32.const 3 call $~lib/builtins/abort unreachable @@ -2983,7 +2983,7 @@ if i32.const 0 i32.const 528 - i32.const 332 + i32.const 333 i32.const 3 call $~lib/builtins/abort unreachable @@ -2997,7 +2997,7 @@ if i32.const 0 i32.const 528 - i32.const 337 + i32.const 338 i32.const 3 call $~lib/builtins/abort unreachable @@ -3011,7 +3011,7 @@ if i32.const 0 i32.const 528 - i32.const 338 + i32.const 339 i32.const 3 call $~lib/builtins/abort unreachable @@ -3026,7 +3026,7 @@ if i32.const 0 i32.const 528 - i32.const 339 + i32.const 340 i32.const 3 call $~lib/builtins/abort unreachable @@ -3043,7 +3043,7 @@ if i32.const 0 i32.const 528 - i32.const 340 + i32.const 341 i32.const 3 call $~lib/builtins/abort unreachable @@ -3060,7 +3060,7 @@ if i32.const 0 i32.const 528 - i32.const 345 + i32.const 346 i32.const 3 call $~lib/builtins/abort unreachable @@ -3184,7 +3184,7 @@ if i32.const 0 i32.const 528 - i32.const 383 + i32.const 384 i32.const 3 call $~lib/builtins/abort unreachable @@ -3201,7 +3201,7 @@ if i32.const 0 i32.const 528 - i32.const 384 + i32.const 385 i32.const 3 call $~lib/builtins/abort unreachable @@ -3218,7 +3218,7 @@ if i32.const 0 i32.const 528 - i32.const 385 + i32.const 386 i32.const 3 call $~lib/builtins/abort unreachable @@ -3235,7 +3235,7 @@ if i32.const 0 i32.const 528 - i32.const 386 + i32.const 387 i32.const 3 call $~lib/builtins/abort unreachable @@ -3252,7 +3252,7 @@ if i32.const 0 i32.const 528 - i32.const 387 + i32.const 388 i32.const 3 call $~lib/builtins/abort unreachable @@ -3269,7 +3269,7 @@ if i32.const 0 i32.const 528 - i32.const 388 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable @@ -3286,7 +3286,7 @@ if i32.const 0 i32.const 528 - i32.const 389 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable @@ -3303,7 +3303,7 @@ if i32.const 0 i32.const 528 - i32.const 390 + i32.const 391 i32.const 3 call $~lib/builtins/abort unreachable @@ -3320,7 +3320,7 @@ if i32.const 0 i32.const 528 - i32.const 391 + i32.const 392 i32.const 3 call $~lib/builtins/abort unreachable @@ -3337,7 +3337,7 @@ if i32.const 0 i32.const 528 - i32.const 392 + i32.const 393 i32.const 3 call $~lib/builtins/abort unreachable @@ -3382,7 +3382,7 @@ if i32.const 0 i32.const 528 - i32.const 398 + i32.const 399 i32.const 5 call $~lib/builtins/abort unreachable @@ -3401,7 +3401,7 @@ if i32.const 0 i32.const 528 - i32.const 404 + i32.const 405 i32.const 5 call $~lib/builtins/abort unreachable @@ -3417,7 +3417,7 @@ if i32.const 0 i32.const 528 - i32.const 409 + i32.const 410 i32.const 5 call $~lib/builtins/abort unreachable @@ -3486,7 +3486,7 @@ if i32.const 0 i32.const 528 - i32.const 464 + i32.const 465 i32.const 3 call $~lib/builtins/abort unreachable @@ -3504,7 +3504,7 @@ if i32.const 0 i32.const 528 - i32.const 466 + i32.const 467 i32.const 3 call $~lib/builtins/abort unreachable @@ -3523,7 +3523,7 @@ if i32.const 0 i32.const 528 - i32.const 468 + i32.const 469 i32.const 3 call $~lib/builtins/abort unreachable @@ -3540,7 +3540,7 @@ if i32.const 0 i32.const 528 - i32.const 469 + i32.const 470 i32.const 3 call $~lib/builtins/abort unreachable @@ -3557,7 +3557,7 @@ if i32.const 0 i32.const 528 - i32.const 470 + i32.const 471 i32.const 3 call $~lib/builtins/abort unreachable @@ -3618,7 +3618,7 @@ if i32.const 0 i32.const 528 - i32.const 511 + i32.const 512 i32.const 3 call $~lib/builtins/abort unreachable @@ -3632,7 +3632,7 @@ if i32.const 0 i32.const 528 - i32.const 516 + i32.const 517 i32.const 3 call $~lib/builtins/abort unreachable @@ -3646,7 +3646,7 @@ if i32.const 0 i32.const 528 - i32.const 517 + i32.const 518 i32.const 3 call $~lib/builtins/abort unreachable @@ -3661,7 +3661,7 @@ if i32.const 0 i32.const 528 - i32.const 518 + i32.const 519 i32.const 3 call $~lib/builtins/abort unreachable @@ -3678,7 +3678,7 @@ if i32.const 0 i32.const 528 - i32.const 519 + i32.const 520 i32.const 3 call $~lib/builtins/abort unreachable @@ -3695,7 +3695,7 @@ if i32.const 0 i32.const 528 - i32.const 524 + i32.const 525 i32.const 3 call $~lib/builtins/abort unreachable @@ -3819,7 +3819,7 @@ if i32.const 0 i32.const 528 - i32.const 562 + i32.const 563 i32.const 3 call $~lib/builtins/abort unreachable @@ -3836,7 +3836,7 @@ if i32.const 0 i32.const 528 - i32.const 563 + i32.const 564 i32.const 3 call $~lib/builtins/abort unreachable @@ -3853,7 +3853,7 @@ if i32.const 0 i32.const 528 - i32.const 564 + i32.const 565 i32.const 3 call $~lib/builtins/abort unreachable @@ -3870,7 +3870,7 @@ if i32.const 0 i32.const 528 - i32.const 565 + i32.const 566 i32.const 3 call $~lib/builtins/abort unreachable @@ -3887,7 +3887,7 @@ if i32.const 0 i32.const 528 - i32.const 566 + i32.const 567 i32.const 3 call $~lib/builtins/abort unreachable @@ -3904,7 +3904,7 @@ if i32.const 0 i32.const 528 - i32.const 567 + i32.const 568 i32.const 3 call $~lib/builtins/abort unreachable @@ -3921,7 +3921,7 @@ if i32.const 0 i32.const 528 - i32.const 568 + i32.const 569 i32.const 3 call $~lib/builtins/abort unreachable @@ -3938,7 +3938,7 @@ if i32.const 0 i32.const 528 - i32.const 569 + i32.const 570 i32.const 3 call $~lib/builtins/abort unreachable @@ -3955,7 +3955,7 @@ if i32.const 0 i32.const 528 - i32.const 570 + i32.const 571 i32.const 3 call $~lib/builtins/abort unreachable @@ -3972,7 +3972,7 @@ if i32.const 0 i32.const 528 - i32.const 571 + i32.const 572 i32.const 3 call $~lib/builtins/abort unreachable @@ -4087,7 +4087,7 @@ if i32.const 0 i32.const 528 - i32.const 588 + i32.const 589 i32.const 5 call $~lib/builtins/abort unreachable @@ -4103,7 +4103,7 @@ if i32.const 0 i32.const 528 - i32.const 593 + i32.const 594 i32.const 5 call $~lib/builtins/abort unreachable @@ -4205,7 +4205,7 @@ if i32.const 0 i32.const 528 - i32.const 659 + i32.const 662 i32.const 3 call $~lib/builtins/abort unreachable @@ -4223,7 +4223,7 @@ if i32.const 0 i32.const 528 - i32.const 661 + i32.const 664 i32.const 3 call $~lib/builtins/abort unreachable @@ -4242,7 +4242,7 @@ if i32.const 0 i32.const 528 - i32.const 663 + i32.const 666 i32.const 3 call $~lib/builtins/abort unreachable @@ -4259,7 +4259,7 @@ if i32.const 0 i32.const 528 - i32.const 664 + i32.const 667 i32.const 3 call $~lib/builtins/abort unreachable @@ -4276,7 +4276,7 @@ if i32.const 0 i32.const 528 - i32.const 665 + i32.const 668 i32.const 3 call $~lib/builtins/abort unreachable @@ -4337,7 +4337,7 @@ if i32.const 0 i32.const 528 - i32.const 706 + i32.const 709 i32.const 3 call $~lib/builtins/abort unreachable @@ -4350,7 +4350,7 @@ if i32.const 0 i32.const 528 - i32.const 711 + i32.const 714 i32.const 3 call $~lib/builtins/abort unreachable @@ -4363,7 +4363,7 @@ if i32.const 0 i32.const 528 - i32.const 712 + i32.const 715 i32.const 3 call $~lib/builtins/abort unreachable @@ -4380,7 +4380,7 @@ if i32.const 0 i32.const 528 - i32.const 713 + i32.const 716 i32.const 3 call $~lib/builtins/abort unreachable @@ -4397,7 +4397,7 @@ if i32.const 0 i32.const 528 - i32.const 718 + i32.const 721 i32.const 3 call $~lib/builtins/abort unreachable @@ -4477,7 +4477,7 @@ if i32.const 0 i32.const 528 - i32.const 732 + i32.const 735 i32.const 3 call $~lib/builtins/abort unreachable @@ -4494,7 +4494,7 @@ if i32.const 0 i32.const 528 - i32.const 733 + i32.const 736 i32.const 3 call $~lib/builtins/abort unreachable @@ -4511,7 +4511,7 @@ if i32.const 0 i32.const 528 - i32.const 734 + i32.const 737 i32.const 3 call $~lib/builtins/abort unreachable @@ -4528,7 +4528,7 @@ if i32.const 0 i32.const 528 - i32.const 735 + i32.const 738 i32.const 3 call $~lib/builtins/abort unreachable @@ -4545,7 +4545,7 @@ if i32.const 0 i32.const 528 - i32.const 736 + i32.const 739 i32.const 3 call $~lib/builtins/abort unreachable @@ -4562,7 +4562,7 @@ if i32.const 0 i32.const 528 - i32.const 737 + i32.const 740 i32.const 3 call $~lib/builtins/abort unreachable @@ -4579,7 +4579,7 @@ if i32.const 0 i32.const 528 - i32.const 738 + i32.const 741 i32.const 3 call $~lib/builtins/abort unreachable @@ -4596,7 +4596,7 @@ if i32.const 0 i32.const 528 - i32.const 739 + i32.const 742 i32.const 3 call $~lib/builtins/abort unreachable @@ -4613,7 +4613,7 @@ if i32.const 0 i32.const 528 - i32.const 740 + i32.const 743 i32.const 3 call $~lib/builtins/abort unreachable @@ -4630,7 +4630,7 @@ if i32.const 0 i32.const 528 - i32.const 741 + i32.const 744 i32.const 3 call $~lib/builtins/abort unreachable @@ -4729,7 +4729,7 @@ if i32.const 0 i32.const 528 - i32.const 762 + i32.const 765 i32.const 5 call $~lib/builtins/abort unreachable @@ -4745,7 +4745,7 @@ if i32.const 0 i32.const 528 - i32.const 767 + i32.const 770 i32.const 5 call $~lib/builtins/abort unreachable @@ -4845,7 +4845,7 @@ if i32.const 0 i32.const 528 - i32.const 801 + i32.const 804 i32.const 3 call $~lib/builtins/abort unreachable @@ -4863,7 +4863,7 @@ if i32.const 0 i32.const 528 - i32.const 803 + i32.const 806 i32.const 3 call $~lib/builtins/abort unreachable @@ -4882,7 +4882,7 @@ if i32.const 0 i32.const 528 - i32.const 805 + i32.const 808 i32.const 3 call $~lib/builtins/abort unreachable @@ -4899,7 +4899,7 @@ if i32.const 0 i32.const 528 - i32.const 806 + i32.const 809 i32.const 3 call $~lib/builtins/abort unreachable @@ -4916,7 +4916,7 @@ if i32.const 0 i32.const 528 - i32.const 807 + i32.const 810 i32.const 3 call $~lib/builtins/abort unreachable @@ -4932,7 +4932,7 @@ if i32.const 0 i32.const 528 - i32.const 808 + i32.const 811 i32.const 3 call $~lib/builtins/abort unreachable @@ -4945,7 +4945,7 @@ if i32.const 0 i32.const 528 - i32.const 813 + i32.const 816 i32.const 3 call $~lib/builtins/abort unreachable @@ -4958,7 +4958,7 @@ if i32.const 0 i32.const 528 - i32.const 814 + i32.const 817 i32.const 3 call $~lib/builtins/abort unreachable @@ -4975,7 +4975,7 @@ if i32.const 0 i32.const 528 - i32.const 815 + i32.const 818 i32.const 3 call $~lib/builtins/abort unreachable @@ -4992,7 +4992,7 @@ if i32.const 0 i32.const 528 - i32.const 820 + i32.const 823 i32.const 3 call $~lib/builtins/abort unreachable @@ -5065,7 +5065,7 @@ if i32.const 0 i32.const 528 - i32.const 834 + i32.const 837 i32.const 5 call $~lib/builtins/abort unreachable @@ -5081,7 +5081,7 @@ if i32.const 0 i32.const 528 - i32.const 839 + i32.const 842 i32.const 5 call $~lib/builtins/abort unreachable @@ -5461,7 +5461,7 @@ if i32.const 0 i32.const 528 - i32.const 912 + i32.const 915 i32.const 3 call $~lib/builtins/abort unreachable @@ -5479,7 +5479,7 @@ if i32.const 0 i32.const 528 - i32.const 914 + i32.const 917 i32.const 3 call $~lib/builtins/abort unreachable @@ -5498,7 +5498,7 @@ if i32.const 0 i32.const 528 - i32.const 916 + i32.const 919 i32.const 3 call $~lib/builtins/abort unreachable @@ -5515,7 +5515,7 @@ if i32.const 0 i32.const 528 - i32.const 917 + i32.const 920 i32.const 3 call $~lib/builtins/abort unreachable @@ -5532,7 +5532,7 @@ if i32.const 0 i32.const 528 - i32.const 918 + i32.const 921 i32.const 3 call $~lib/builtins/abort unreachable @@ -5553,7 +5553,7 @@ if i32.const 0 i32.const 528 - i32.const 920 + i32.const 923 i32.const 3 call $~lib/builtins/abort unreachable @@ -5570,7 +5570,7 @@ if i32.const 0 i32.const 528 - i32.const 921 + i32.const 924 i32.const 3 call $~lib/builtins/abort unreachable @@ -5586,7 +5586,7 @@ if i32.const 0 i32.const 528 - i32.const 922 + i32.const 925 i32.const 3 call $~lib/builtins/abort unreachable @@ -5599,7 +5599,7 @@ if i32.const 0 i32.const 528 - i32.const 923 + i32.const 926 i32.const 3 call $~lib/builtins/abort unreachable @@ -5612,7 +5612,7 @@ if i32.const 0 i32.const 528 - i32.const 924 + i32.const 927 i32.const 3 call $~lib/builtins/abort unreachable @@ -5629,7 +5629,7 @@ if i32.const 0 i32.const 528 - i32.const 925 + i32.const 928 i32.const 3 call $~lib/builtins/abort unreachable @@ -5646,7 +5646,7 @@ if i32.const 0 i32.const 528 - i32.const 930 + i32.const 933 i32.const 3 call $~lib/builtins/abort unreachable @@ -5677,7 +5677,7 @@ if i32.const 0 i32.const 528 - i32.const 939 + i32.const 942 i32.const 3 call $~lib/builtins/abort unreachable @@ -5694,7 +5694,7 @@ if i32.const 0 i32.const 528 - i32.const 940 + i32.const 943 i32.const 3 call $~lib/builtins/abort unreachable @@ -5711,7 +5711,7 @@ if i32.const 0 i32.const 528 - i32.const 941 + i32.const 944 i32.const 3 call $~lib/builtins/abort unreachable @@ -5728,7 +5728,7 @@ if i32.const 0 i32.const 528 - i32.const 942 + i32.const 945 i32.const 3 call $~lib/builtins/abort unreachable @@ -5745,7 +5745,7 @@ if i32.const 0 i32.const 528 - i32.const 943 + i32.const 946 i32.const 3 call $~lib/builtins/abort unreachable @@ -5762,7 +5762,7 @@ if i32.const 0 i32.const 528 - i32.const 944 + i32.const 947 i32.const 3 call $~lib/builtins/abort unreachable @@ -5779,7 +5779,7 @@ if i32.const 0 i32.const 528 - i32.const 945 + i32.const 948 i32.const 3 call $~lib/builtins/abort unreachable @@ -5796,7 +5796,7 @@ if i32.const 0 i32.const 528 - i32.const 946 + i32.const 949 i32.const 3 call $~lib/builtins/abort unreachable @@ -5812,7 +5812,7 @@ if i32.const 0 i32.const 528 - i32.const 947 + i32.const 950 i32.const 3 call $~lib/builtins/abort unreachable @@ -5879,7 +5879,7 @@ if i32.const 0 i32.const 528 - i32.const 974 + i32.const 977 i32.const 5 call $~lib/builtins/abort unreachable @@ -5897,7 +5897,7 @@ if i32.const 0 i32.const 528 - i32.const 978 + i32.const 981 i32.const 5 call $~lib/builtins/abort unreachable @@ -5941,7 +5941,7 @@ if i32.const 0 i32.const 528 - i32.const 994 + i32.const 997 i32.const 3 call $~lib/builtins/abort unreachable @@ -5959,7 +5959,7 @@ if i32.const 0 i32.const 528 - i32.const 996 + i32.const 999 i32.const 3 call $~lib/builtins/abort unreachable @@ -5978,7 +5978,7 @@ if i32.const 0 i32.const 528 - i32.const 998 + i32.const 1001 i32.const 3 call $~lib/builtins/abort unreachable @@ -5995,7 +5995,7 @@ if i32.const 0 i32.const 528 - i32.const 999 + i32.const 1002 i32.const 3 call $~lib/builtins/abort unreachable @@ -6012,7 +6012,7 @@ if i32.const 0 i32.const 528 - i32.const 1000 + i32.const 1003 i32.const 3 call $~lib/builtins/abort unreachable @@ -6033,7 +6033,7 @@ if i32.const 0 i32.const 528 - i32.const 1002 + i32.const 1005 i32.const 3 call $~lib/builtins/abort unreachable @@ -6050,7 +6050,7 @@ if i32.const 0 i32.const 528 - i32.const 1003 + i32.const 1006 i32.const 3 call $~lib/builtins/abort unreachable @@ -6066,7 +6066,7 @@ if i32.const 0 i32.const 528 - i32.const 1004 + i32.const 1007 i32.const 3 call $~lib/builtins/abort unreachable @@ -6079,7 +6079,7 @@ if i32.const 0 i32.const 528 - i32.const 1005 + i32.const 1008 i32.const 3 call $~lib/builtins/abort unreachable @@ -6092,7 +6092,7 @@ if i32.const 0 i32.const 528 - i32.const 1006 + i32.const 1009 i32.const 3 call $~lib/builtins/abort unreachable @@ -6109,7 +6109,7 @@ if i32.const 0 i32.const 528 - i32.const 1007 + i32.const 1010 i32.const 3 call $~lib/builtins/abort unreachable @@ -6126,7 +6126,7 @@ if i32.const 0 i32.const 528 - i32.const 1012 + i32.const 1015 i32.const 3 call $~lib/builtins/abort unreachable @@ -6157,7 +6157,7 @@ if i32.const 0 i32.const 528 - i32.const 1021 + i32.const 1024 i32.const 3 call $~lib/builtins/abort unreachable @@ -6174,7 +6174,7 @@ if i32.const 0 i32.const 528 - i32.const 1022 + i32.const 1025 i32.const 3 call $~lib/builtins/abort unreachable @@ -6191,7 +6191,7 @@ if i32.const 0 i32.const 528 - i32.const 1023 + i32.const 1026 i32.const 3 call $~lib/builtins/abort unreachable @@ -6208,7 +6208,7 @@ if i32.const 0 i32.const 528 - i32.const 1024 + i32.const 1027 i32.const 3 call $~lib/builtins/abort unreachable @@ -6225,7 +6225,7 @@ if i32.const 0 i32.const 528 - i32.const 1025 + i32.const 1028 i32.const 3 call $~lib/builtins/abort unreachable @@ -6242,7 +6242,7 @@ if i32.const 0 i32.const 528 - i32.const 1026 + i32.const 1029 i32.const 3 call $~lib/builtins/abort unreachable @@ -6259,7 +6259,7 @@ if i32.const 0 i32.const 528 - i32.const 1027 + i32.const 1030 i32.const 3 call $~lib/builtins/abort unreachable @@ -6276,7 +6276,7 @@ if i32.const 0 i32.const 528 - i32.const 1028 + i32.const 1031 i32.const 3 call $~lib/builtins/abort unreachable @@ -6292,7 +6292,7 @@ if i32.const 0 i32.const 528 - i32.const 1029 + i32.const 1032 i32.const 3 call $~lib/builtins/abort unreachable @@ -6345,7 +6345,7 @@ if i32.const 0 i32.const 528 - i32.const 1048 + i32.const 1051 i32.const 5 call $~lib/builtins/abort unreachable @@ -6363,7 +6363,7 @@ if i32.const 0 i32.const 528 - i32.const 1052 + i32.const 1055 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index c0df6f16e6..8ba8db8d1e 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -2051,7 +2051,7 @@ if i32.const 0 i32.const 1552 - i32.const 588 + i32.const 589 i32.const 5 call $~lib/builtins/abort unreachable @@ -2065,7 +2065,7 @@ if i32.const 0 i32.const 1552 - i32.const 593 + i32.const 594 i32.const 5 call $~lib/builtins/abort unreachable @@ -2103,7 +2103,7 @@ if i32.const 0 i32.const 1552 - i32.const 762 + i32.const 765 i32.const 5 call $~lib/builtins/abort unreachable @@ -2117,7 +2117,7 @@ if i32.const 0 i32.const 1552 - i32.const 767 + i32.const 770 i32.const 5 call $~lib/builtins/abort unreachable @@ -2149,7 +2149,7 @@ if i32.const 0 i32.const 1552 - i32.const 834 + i32.const 837 i32.const 5 call $~lib/builtins/abort unreachable @@ -2163,7 +2163,7 @@ if i32.const 0 i32.const 1552 - i32.const 839 + i32.const 842 i32.const 5 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 081f848723..d55f69f609 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -240,7 +240,8 @@ function test_v128(): void { v128.bitmask(i8x16(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xF)) == 0x00000001 ); assert( - v128.bitmask(i16x8(u16.MAX_VALUE, + v128.bitmask(i16x8( + u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, @@ -611,7 +612,8 @@ function test_i16x8(): void { i16x8.extmul_high_i8x16_u(a, a); assert(i16x8.abs(i16x8(1, 1, 1, 1, 1, 1, 1, 1)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); assert(i16x8.abs(i16x8(-1, -1, -1, -1, -1, -1, -1, -1)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); - assert(i16x8.abs(i16x8(u16.MAX_VALUE, + assert(i16x8.abs(i16x8( + u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE, @@ -619,7 +621,8 @@ function test_i16x8(): void { u16.MAX_VALUE, u16.MAX_VALUE, u16.MAX_VALUE)) == i16x8(1, 1, 1, 1, 1, 1, 1, 1)); - assert(i16x8.abs(i16x8(-32768, + assert(i16x8.abs(i16x8( + -32768, -32768, -32768, -32768, From 598f35b73f0309fdca0d38d6484c0aff7308bc20 Mon Sep 17 00:00:00 2001 From: JesseCodeBones <56120624+JesseCodeBones@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:01:55 +0800 Subject: [PATCH 15/16] Update tests/compiler/simd.ts Co-authored-by: Max Graey --- tests/compiler/simd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index d55f69f609..0683a29567 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -213,7 +213,7 @@ function test_v128(): void { assert(v == f32x4(2, -0.0, 71, 4)); } { - let v: v128 =v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + let v: v128 = v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) assert(v == f32x4(1, -1, 70, 4)); } { From 865438d3afd3b55a401cd046fd299397afd81381 Mon Sep 17 00:00:00 2001 From: chen ruixiang Date: Tue, 9 Aug 2022 13:11:52 +0800 Subject: [PATCH 16/16] fix missing semicolon issue --- tests/compiler/simd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 0683a29567..e7c2acce90 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -213,7 +213,7 @@ function test_v128(): void { assert(v == f32x4(2, -0.0, 71, 4)); } { - let v: v128 = v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + let v: v128 = v128.floor(f32x4(1.1, -0.25, 70.01, 4.0)); assert(v == f32x4(1, -1, 70, 4)); } { @@ -977,7 +977,7 @@ function test_f32x4(): void { assert(v == f32x4(2, -0.0, 71, 4)); } { - let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)) + let v: v128 =f32x4.floor(f32x4(1.1, -0.25, 70.01, 4.0)); assert(v == f32x4(1, -1, 70, 4)); } assert(