diff --git a/package-lock.json b/package-lock.json index 1c9bdc64..a67c5047 100644 --- a/package-lock.json +++ b/package-lock.json @@ -549,9 +549,9 @@ "dev": true }, "binaryen": { - "version": "55.0.0-nightly.20181122", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-55.0.0-nightly.20181122.tgz", - "integrity": "sha512-sgI5FLlZ3RrRKXYfghQhUMBttfkXE41R37r2Agq5hWU3tMGw1xANVvKho8xPNlIdrNtM9jrRVPMt7HQ/236VnQ==" + "version": "55.0.0-nightly.20181130", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-55.0.0-nightly.20181130.tgz", + "integrity": "sha512-RfMiI0vavw7Sy7KX8h1xOs4D3zp9nehmtE87DSfY6nXyd2EAdMwJ97tWdepuhOc6JWZsntOfzUA2fqu/sYTTLg==" }, "bluebird": { "version": "3.5.3", diff --git a/package.json b/package.json index ff93c7e5..c6ebff9e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@protobufjs/utf8": "^1.1.0", - "binaryen": "55.0.0-nightly.20181122", + "binaryen": "55.0.0-nightly.20181130", "glob": "^7.1.3", "long": "^4.0.0" }, diff --git a/tests/compiler/binary.optimized.wat b/tests/compiler/binary.optimized.wat index 82ba2719..07c1ab8b 100644 --- a/tests/compiler/binary.optimized.wat +++ b/tests/compiler/binary.optimized.wat @@ -74,35 +74,35 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $folding-inner0 + get_local $0 + i32.reinterpret/f32 + tee_local $1 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + set_local $2 + get_local $1 + i32.const -2147483648 + i32.and + set_local $4 + get_local $2 + i32.const 255 + i32.eq + tee_local $3 + i32.eqz + if + i32.const 0 + set_local $3 + end + get_local $3 + if get_local $0 - i32.reinterpret/f32 - tee_local $1 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - set_local $2 - get_local $1 - i32.const -2147483648 - i32.and - set_local $4 - get_local $2 - i32.const 255 - i32.eq - tee_local $3 - i32.eqz - if - i32.const 0 - set_local $3 - end - get_local $3 - if - get_local $0 - get_local $0 - f32.div - return - end + get_local $0 + f32.div + return + end + block $folding-inner0 get_local $1 i32.const 1 i32.shl @@ -188,6 +188,7 @@ tee_local $3 i32.shl set_local $1 + get_local $4 get_local $2 get_local $3 i32.sub @@ -210,7 +211,6 @@ i32.shr_u end tee_local $1 - get_local $4 i32.or f32.reinterpret/i32 return @@ -225,35 +225,35 @@ (local $3 i64) (local $4 i32) (local $5 i64) - block $folding-inner0 + get_local $0 + i64.reinterpret/f64 + tee_local $1 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + set_local $2 + get_local $1 + i64.const 63 + i64.shr_u + set_local $5 + get_local $2 + i64.const 2047 + i64.eq + tee_local $4 + i32.eqz + if + i32.const 0 + set_local $4 + end + get_local $4 + if get_local $0 - i64.reinterpret/f64 - tee_local $1 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - set_local $2 - get_local $1 - i64.const 63 - i64.shr_u - set_local $5 - get_local $2 - i64.const 2047 - i64.eq - tee_local $4 - i32.eqz - if - i32.const 0 - set_local $4 - end - get_local $4 - if - get_local $0 - get_local $0 - f64.div - return - end + get_local $0 + f64.div + return + end + block $folding-inner0 get_local $1 i64.const 1 i64.shl @@ -601,20 +601,20 @@ get_global $binary/f call $~lib/math/NativeMathf.mod drop + get_global $binary/f + tee_local $0 + i32.reinterpret/f32 + i32.const 2147483647 + i32.and + i32.const 2139095040 + i32.gt_s + tee_local $1 + i32.eqz + if + i32.const 0 + set_local $1 + end block $__inlined_func$~lib/math/NativeMathf.pow - get_global $binary/f - tee_local $0 - i32.reinterpret/f32 - i32.const 2147483647 - i32.and - i32.const 2139095040 - i32.gt_s - tee_local $1 - i32.eqz - if - i32.const 0 - set_local $1 - end get_local $1 br_if $__inlined_func$~lib/math/NativeMathf.pow end diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 487cb739..d26df2a6 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -130,10 +130,10 @@ call $~lib/env/abort unreachable end - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 + i32.const 0 + set_local $0 + loop $repeat|0 + block $break|0 get_local $0 get_global $comma/a i32.ge_s @@ -147,9 +147,7 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end get_local $0 i32.const 1 diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index fb3a5b73..b5c51b49 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -13,10 +13,10 @@ (func $start (; 1 ;) (type $v) (local $0 i32) (local $1 i32) - block $break|0 - i32.const 0 - set_global $for/i - loop $repeat|0 + i32.const 0 + set_global $for/i + loop $repeat|0 + block $break|0 get_global $for/i i32.const 10 i32.ge_s @@ -26,9 +26,7 @@ i32.add set_global $for/i br $repeat|0 - unreachable end - unreachable end get_global $for/i i32.const 10 @@ -41,8 +39,8 @@ call $~lib/env/abort unreachable end - block $break|1 - loop $repeat|1 + loop $repeat|1 + block $break|1 get_local $0 i32.const 10 i32.ge_s @@ -52,9 +50,7 @@ i32.add set_local $0 br $repeat|1 - unreachable end - unreachable end loop $repeat|2 get_global $for/i @@ -99,10 +95,10 @@ get_global $for/i br_if $repeat|4 end - block $break|5 - i32.const 0 - set_local $0 - loop $repeat|5 + i32.const 0 + set_local $0 + loop $repeat|5 + block $break|5 get_local $0 i32.const 10 i32.ge_s @@ -112,9 +108,7 @@ i32.add set_local $0 br $repeat|5 - unreachable end - unreachable end get_local $0 i32.const 10 @@ -127,23 +121,23 @@ call $~lib/env/abort unreachable end - block $break|6 - i32.const 0 - set_local $0 - loop $repeat|6 + i32.const 0 + set_local $0 + loop $repeat|6 + block $break|6 get_local $0 i32.const 10 i32.ge_s br_if $break|6 - block $break|7 - i32.const 0 - set_local $1 - loop $repeat|7 + i32.const 0 + set_local $1 + loop $repeat|7 + block $break|7 + get_local $1 + i32.const 10 + i32.ge_s + br_if $break|7 block $continue|7 - get_local $1 - i32.const 10 - i32.ge_s - br_if $break|7 get_local $0 get_local $1 i32.eq @@ -154,18 +148,14 @@ i32.add set_local $1 br $repeat|7 - unreachable end - unreachable end get_local $0 i32.const 1 i32.add set_local $0 br $repeat|6 - unreachable end - unreachable end ) (func $null (; 2 ;) (type $v) diff --git a/tests/compiler/infer-type.optimized.wat b/tests/compiler/infer-type.optimized.wat index e0087b93..5e8b5370 100644 --- a/tests/compiler/infer-type.optimized.wat +++ b/tests/compiler/infer-type.optimized.wat @@ -24,8 +24,7 @@ loop $repeat|0 get_local $0 i32.const 10 - i32.ge_s - i32.eqz + i32.lt_s if get_local $0 i32.const 1 diff --git a/tests/compiler/mandelbrot.optimized.wat b/tests/compiler/mandelbrot.optimized.wat index d259edc1..0f76327a 100644 --- a/tests/compiler/mandelbrot.optimized.wat +++ b/tests/compiler/mandelbrot.optimized.wat @@ -97,7 +97,6 @@ end end end - get_local $3 get_local $1 i32.const 614242 i32.add @@ -106,8 +105,12 @@ i32.shr_s i32.const 1023 i32.sub + get_local $3 i32.add set_local $3 + get_local $4 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -116,9 +119,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $4 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -281,19 +281,17 @@ end end end - block $break|2 - f64.const 8 - get_local $3 + f64.const 8 + get_local $3 + f64.convert_u/i32 + f64.min + set_local $6 + loop $repeat|2 + get_local $2 f64.convert_u/i32 - f64.min - set_local $6 - loop $repeat|2 - get_local $2 - f64.convert_u/i32 - get_local $6 - f64.lt - i32.eqz - br_if $break|2 + get_local $6 + f64.lt + if get_local $4 get_local $4 f64.mul @@ -319,9 +317,7 @@ i32.add set_local $2 br $repeat|2 - unreachable end - unreachable end get_local $0 get_local $1 diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index 75400dc0..bef4da44 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -249,9 +249,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -259,14 +256,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -274,14 +271,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -289,14 +286,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -304,6 +301,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -358,9 +358,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -368,14 +365,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -383,14 +380,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -398,14 +395,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -413,6 +410,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -459,9 +459,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -469,14 +466,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -484,14 +481,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -499,14 +496,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -514,6 +511,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index bc616a41..55f26670 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -141,11 +141,11 @@ get_local $4 return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -160,11 +160,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -178,11 +178,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index 11af9173..539d5c63 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -15,17 +15,17 @@ (local $3 i32) (local $4 i32) (local $5 i64) + get_local $0 + set_local $3 block $folding-inner0 - get_local $0 - set_local $3 get_local $2 i32.eqz br_if $folding-inner0 get_local $3 get_local $1 i32.store8 - get_local $3 get_local $2 + get_local $3 i32.add i32.const 1 i32.sub @@ -45,8 +45,8 @@ i32.add get_local $1 i32.store8 - get_local $3 get_local $2 + get_local $3 i32.add tee_local $0 i32.const 2 @@ -67,8 +67,8 @@ i32.add get_local $1 i32.store8 - get_local $3 get_local $2 + get_local $3 i32.add i32.const 4 i32.sub @@ -98,11 +98,11 @@ i32.mul tee_local $1 i32.store - get_local $0 get_local $2 i32.const -4 i32.and tee_local $2 + get_local $0 i32.add i32.const 4 i32.sub @@ -183,12 +183,12 @@ get_local $1 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $4 + get_local $0 i32.add set_local $0 get_local $2 diff --git a/tests/compiler/retain-i32.optimized.wat b/tests/compiler/retain-i32.optimized.wat index e30bb22d..86a9b35b 100644 --- a/tests/compiler/retain-i32.optimized.wat +++ b/tests/compiler/retain-i32.optimized.wat @@ -13,22 +13,19 @@ (start $start) (func $start (; 1 ;) (type $v) (local $0 i32) - block $break|0 - i32.const -128 - set_local $0 - loop $repeat|0 - get_local $0 - i32.const 255 - i32.gt_s - br_if $break|0 + i32.const -128 + set_local $0 + loop $repeat|0 + get_local $0 + i32.const 255 + i32.le_s + if get_local $0 i32.const 1 i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end i32.const -1 set_global $retain-i32/si diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index ab3085b3..9f9701c6 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -11,8 +11,7 @@ loop $repeat|0 get_local $0 i32.const 1 - i32.ge_s - i32.eqz + i32.lt_s if get_local $0 i32.const 1 @@ -21,22 +20,19 @@ br $repeat|0 end end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 1 - i32.ge_s - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 1 + i32.lt_s + if get_local $0 i32.const 1 i32.add set_local $0 br $repeat|1 - unreachable end - unreachable end ) (func $null (; 1 ;) (type $v) diff --git a/tests/compiler/std/allocator_arena.optimized.wat b/tests/compiler/std/allocator_arena.optimized.wat index caa604e3..7e9ed42d 100644 --- a/tests/compiler/std/allocator_arena.optimized.wat +++ b/tests/compiler/std/allocator_arena.optimized.wat @@ -113,24 +113,24 @@ i32.sub i32.const 18 i32.store8 - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $1 + get_local $0 i32.add tee_local $0 i32.const 303174162 i32.store - get_local $0 i32.const 42 get_local $1 i32.sub i32.const -4 i32.and tee_local $2 + get_local $0 i32.add i32.const 4 i32.sub @@ -215,12 +215,12 @@ i32.const 303174162 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $1 + get_local $0 i32.add set_local $0 get_local $2 @@ -495,9 +495,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -505,14 +502,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -520,14 +517,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -535,14 +532,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -550,6 +547,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -604,9 +604,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -614,14 +611,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -629,14 +626,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -644,14 +641,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -659,6 +656,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -705,9 +705,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -715,14 +712,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -730,14 +727,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -745,14 +742,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -760,6 +757,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1316,11 +1316,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1335,11 +1335,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1353,11 +1353,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1445,14 +1445,13 @@ end get_global $std/allocator_arena/ptr1 call $~lib/internal/memory/memset - block $break|0 - i32.const 0 - set_global $std/allocator_arena/i - loop $repeat|0 - get_global $std/allocator_arena/i - i32.const 42 - i32.ge_u - br_if $break|0 + i32.const 0 + set_global $std/allocator_arena/i + loop $repeat|0 + get_global $std/allocator_arena/i + i32.const 42 + i32.lt_u + if get_global $std/allocator_arena/ptr1 get_global $std/allocator_arena/i i32.add @@ -1474,21 +1473,18 @@ br $repeat|0 end unreachable - unreachable end - unreachable end get_global $std/allocator_arena/ptr2 get_global $std/allocator_arena/ptr1 call $~lib/internal/memory/memmove - block $break|1 - i32.const 0 - set_global $std/allocator_arena/i - loop $repeat|1 - get_global $std/allocator_arena/i - i32.const 42 - i32.ge_u - br_if $break|1 + i32.const 0 + set_global $std/allocator_arena/i + loop $repeat|1 + get_global $std/allocator_arena/i + i32.const 42 + i32.lt_u + if get_global $std/allocator_arena/ptr2 get_global $std/allocator_arena/i i32.add @@ -1510,9 +1506,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_global $std/allocator_arena/ptr1 get_global $std/allocator_arena/ptr2 diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index 93cb1353..ea721a4a 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -70,10 +70,10 @@ ) (func $~lib/internal/string/compareUnsafe (; 3 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $1 loop $continue|0 @@ -122,9 +122,6 @@ call $~lib/env/abort unreachable end - i32.const 8 - i32.load - tee_local $2 i32.const 0 get_local $0 i32.load @@ -133,6 +130,9 @@ get_local $1 i32.lt_s select + tee_local $2 + i32.const 8 + i32.load tee_local $3 i32.add get_local $1 @@ -142,9 +142,9 @@ return end get_local $0 - get_local $3 - i32.const 8 get_local $2 + i32.const 8 + get_local $3 call $~lib/internal/string/compareUnsafe i32.eqz ) diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 090b7d29..6cdf6760 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -188,24 +188,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -290,12 +290,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index b54a8976..d2102f26 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -575,11 +575,11 @@ i32.mul tee_local $1 i32.store - get_local $0 get_local $2 i32.const -4 i32.and tee_local $2 + get_local $0 i32.add i32.const 4 i32.sub @@ -664,12 +664,12 @@ get_local $1 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $3 + get_local $0 i32.add set_local $0 get_local $2 @@ -776,8 +776,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $2 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -799,8 +799,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $3 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -820,8 +820,8 @@ tee_local $3 i32.lt_s if - get_local $6 get_local $2 + get_local $6 i32.add i32.const 8 i32.add @@ -837,7 +837,6 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) get_local $0 i32.load offset=4 tee_local $4 @@ -867,8 +866,8 @@ i32.load i32.lt_u if (result i32) - get_local $3 get_local $2 + get_local $3 i32.add i32.load8_u offset=8 else @@ -877,7 +876,6 @@ tee_local $3 i32.const 255 i32.and - set_local $5 get_local $2 tee_local $3 get_local $1 @@ -893,9 +891,7 @@ else unreachable end - set_local $2 - get_local $5 - get_local $2 + tee_local $2 i32.const 255 i32.and i32.ne @@ -953,8 +949,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $2 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -976,8 +972,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $3 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -1001,10 +997,10 @@ i32.ge_s i32.eqz if - get_local $6 get_local $2 i32.const 2 i32.shl + get_local $6 i32.add get_local $1 i32.store offset=8 @@ -1020,7 +1016,6 @@ (func $std/array/isArraysEqual (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 i32) get_local $2 i32.eqz if @@ -1056,17 +1051,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $4 get_local $3 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 else unreachable end tee_local $4 - set_local $5 get_local $3 tee_local $4 get_local $1 @@ -1077,18 +1071,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $3 get_local $4 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 else unreachable end - set_local $3 - get_local $5 - get_local $3 + tee_local $3 i32.ne if i32.const 0 @@ -1363,9 +1355,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -1373,14 +1362,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -1388,14 +1377,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -1403,14 +1392,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -1418,6 +1407,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -1472,9 +1464,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -1482,14 +1471,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -1497,14 +1486,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -1512,14 +1501,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -1527,6 +1516,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -1573,9 +1565,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -1583,14 +1572,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -1598,14 +1587,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -1613,14 +1602,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -1628,6 +1617,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -2181,11 +2173,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2200,11 +2192,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2218,11 +2210,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2293,8 +2285,8 @@ i32.add get_local $2 call $~lib/internal/memory/memmove - get_local $4 get_local $2 + get_local $4 i32.add i32.const 0 get_local $1 @@ -2369,10 +2361,10 @@ get_local $0 get_local $3 i32.store offset=4 - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add get_local $1 i32.store offset=8 @@ -2485,8 +2477,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $5 get_local $1 + get_local $5 i32.add tee_local $4 i32.const 0 @@ -2508,8 +2500,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $5 get_local $2 + get_local $5 i32.add tee_local $4 i32.const 0 @@ -2531,8 +2523,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $5 get_local $3 + get_local $5 i32.add tee_local $4 i32.const 0 @@ -2576,11 +2568,11 @@ end get_local $4 if - get_local $2 get_local $3 i32.const 1 i32.sub tee_local $4 + get_local $2 i32.add set_local $2 get_local $1 @@ -2590,15 +2582,15 @@ loop $continue|0 get_local $3 if - get_local $6 get_local $1 i32.const 2 i32.shl - i32.add get_local $6 + i32.add get_local $2 i32.const 2 i32.shl + get_local $6 i32.add i32.load offset=8 i32.store offset=8 @@ -2781,40 +2773,40 @@ get_local $0 i32.load set_local $3 - block $break|0 - get_local $0 - i32.load offset=4 - i32.const 1 - i32.sub - set_local $2 - loop $repeat|0 + get_local $0 + i32.load offset=4 + i32.const 1 + i32.sub + set_local $2 + loop $repeat|0 + block $break|0 get_local $1 get_local $2 i32.ge_s br_if $break|0 - get_local $3 get_local $1 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 set_local $4 - get_local $3 get_local $1 i32.const 2 i32.shl - i32.add get_local $3 + i32.add get_local $2 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 i32.store offset=8 - get_local $3 get_local $2 i32.const 2 i32.shl + get_local $3 i32.add get_local $4 i32.store offset=8 @@ -2827,9 +2819,7 @@ i32.sub set_local $2 br $repeat|0 - unreachable end - unreachable end get_local $0 ) @@ -2857,8 +2847,8 @@ i32.const 0 i32.lt_s if - get_local $4 get_local $2 + get_local $4 i32.add tee_local $3 i32.const 0 @@ -2876,10 +2866,10 @@ get_local $4 i32.lt_s if - get_local $0 get_local $2 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 get_local $1 @@ -2913,8 +2903,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $1 + get_local $4 i32.add tee_local $3 i32.const 0 @@ -2962,11 +2952,11 @@ i32.const 2 i32.shl call $~lib/internal/memory/memmove - get_local $4 get_local $1 get_local $2 i32.add tee_local $1 + get_local $4 i32.ne if get_local $3 @@ -3049,10 +3039,10 @@ get_local $4 i32.store offset=4 end - get_local $3 get_local $1 i32.const 2 i32.shl + get_local $3 i32.add get_local $2 i32.store offset=8 @@ -3069,11 +3059,11 @@ get_local $0 i32.load set_local $4 - block $break|0 - get_local $0 - i32.load offset=4 - set_local $5 - loop $repeat|0 + get_local $0 + i32.load offset=4 + set_local $5 + loop $repeat|0 + block $break|0 get_local $2 get_local $5 i32.lt_s @@ -3090,10 +3080,10 @@ br_if $break|0 i32.const 3 set_global $~argc - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3111,9 +3101,7 @@ br $repeat|0 end unreachable - unreachable end - unreachable end i32.const -1 ) @@ -3157,11 +3145,11 @@ get_local $0 i32.load set_local $4 - block $break|0 - get_local $0 - i32.load offset=4 - set_local $5 - loop $repeat|0 + get_local $0 + i32.load offset=4 + set_local $5 + loop $repeat|0 + block $break|0 get_local $2 get_local $5 i32.lt_s @@ -3178,10 +3166,10 @@ br_if $break|0 i32.const 3 set_global $~argc - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3199,9 +3187,7 @@ return end unreachable - unreachable end - unreachable end i32.const 1 ) @@ -3245,11 +3231,11 @@ get_local $0 i32.load set_local $4 - block $break|0 - get_local $0 - i32.load offset=4 - set_local $5 - loop $repeat|0 + get_local $0 + i32.load offset=4 + set_local $5 + loop $repeat|0 + block $break|0 get_local $2 get_local $5 i32.lt_s @@ -3266,10 +3252,10 @@ br_if $break|0 i32.const 3 set_global $~argc - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3287,9 +3273,7 @@ br $repeat|0 end unreachable - unreachable end - unreachable end i32.const 0 ) @@ -3334,11 +3318,11 @@ get_local $0 i32.load set_local $4 - block $break|0 - get_local $0 - i32.load offset=4 - set_local $5 - loop $repeat|0 + get_local $0 + i32.load offset=4 + set_local $5 + loop $repeat|0 + block $break|0 get_local $2 get_local $5 i32.lt_s @@ -3355,10 +3339,10 @@ br_if $break|0 i32.const 3 set_global $~argc - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3370,9 +3354,7 @@ i32.add set_local $2 br $repeat|0 - unreachable end - unreachable end ) (func $start~anonymous|18 (; 47 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) @@ -3431,14 +3413,14 @@ if i32.const 3 set_global $~argc - get_local $6 get_local $1 i32.const 2 i32.shl tee_local $2 + get_local $6 i32.add - get_local $3 get_local $2 + get_local $3 i32.add i32.load offset=8 get_local $1 @@ -3483,8 +3465,8 @@ tee_local $6 i32.load set_local $7 - block $break|0 - loop $repeat|0 + loop $repeat|0 + block $break|0 get_local $2 get_local $5 i32.lt_s @@ -3501,15 +3483,15 @@ br_if $break|0 i32.const 3 set_global $~argc + get_local $2 + i32.const 2 + i32.shl get_local $7 - get_local $2 - i32.const 2 - i32.shl i32.add - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3522,9 +3504,7 @@ i32.add set_local $2 br $repeat|0 - unreachable end - unreachable end get_local $6 ) @@ -3565,8 +3545,8 @@ i32.const 0 call $~lib/array/Array#constructor set_local $4 - block $break|0 - loop $repeat|0 + loop $repeat|0 + block $break|0 get_local $2 get_local $6 i32.lt_s @@ -3581,10 +3561,10 @@ get_local $3 i32.eqz br_if $break|0 - get_local $5 get_local $2 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 set_local $3 @@ -3606,9 +3586,7 @@ i32.add set_local $2 br $repeat|0 - unreachable end - unreachable end get_local $4 ) @@ -3659,11 +3637,11 @@ get_local $0 i32.load set_local $5 - block $break|0 - get_local $0 - i32.load offset=4 - set_local $6 - loop $repeat|0 + get_local $0 + i32.load offset=4 + set_local $6 + loop $repeat|0 + block $break|0 get_local $3 get_local $6 i32.lt_s @@ -3681,10 +3659,10 @@ i32.const 4 set_global $~argc get_local $2 - get_local $5 get_local $3 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 get_local $3 @@ -3697,9 +3675,7 @@ i32.add set_local $3 br $repeat|0 - unreachable end - unreachable end get_local $2 ) @@ -3746,13 +3722,13 @@ get_local $0 i32.load set_local $4 - block $break|0 - get_local $0 - i32.load offset=4 - i32.const 1 - i32.sub - set_local $3 - loop $repeat|0 + get_local $0 + i32.load offset=4 + i32.const 1 + i32.sub + set_local $3 + loop $repeat|0 + block $break|0 get_local $3 i32.const 0 i32.lt_s @@ -3760,10 +3736,10 @@ i32.const 4 set_global $~argc get_local $2 - get_local $4 get_local $3 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 get_local $3 @@ -3776,9 +3752,7 @@ i32.sub set_local $3 br $repeat|0 - unreachable end - unreachable end get_local $2 ) @@ -3797,15 +3771,15 @@ i32.mul tee_local $0 get_local $0 - get_local $0 + i32.const 61 + i32.or get_local $0 i32.const 7 i32.shr_u - i32.xor get_local $0 - i32.const 61 - i32.or + i32.xor i32.mul + get_local $0 i32.add i32.xor tee_local $0 @@ -3829,9 +3803,9 @@ i32.const 1 set_global $~lib/math/random_seeded get_local $0 - get_local $0 i64.const 33 i64.shr_u + get_local $0 i64.xor i64.const -49064778989728563 i64.mul @@ -3891,10 +3865,10 @@ i32.ge_s i32.eqz if - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add f32.load offset=8 set_local $5 @@ -3908,10 +3882,10 @@ i32.ge_s if block $break|1 - get_local $0 get_local $3 i32.const 2 i32.shl + get_local $0 i32.add f32.load offset=8 set_local $6 @@ -3929,12 +3903,12 @@ i32.const 1 i32.sub set_local $3 - get_local $0 get_local $7 i32.const 1 i32.add i32.const 2 i32.shl + get_local $0 i32.add get_local $6 f32.store offset=8 @@ -3942,12 +3916,12 @@ end end end - get_local $0 get_local $3 i32.const 1 i32.add i32.const 2 i32.shl + get_local $0 i32.add get_local $5 f32.store offset=8 @@ -3979,28 +3953,27 @@ i32.const 0 get_local $5 call $~lib/internal/memory/memset - block $break|0 - get_local $1 - i32.const 1 - i32.sub - set_local $3 - loop $repeat|0 - get_local $3 - i32.const 0 - i32.le_s - br_if $break|0 + get_local $1 + i32.const 1 + i32.sub + set_local $3 + loop $repeat|0 + get_local $3 + i32.const 0 + i32.gt_s + if get_local $3 set_local $5 loop $continue|1 get_local $5 i32.const 1 i32.and - get_local $8 get_local $5 i32.const 6 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add i32.load get_local $5 @@ -4020,20 +3993,20 @@ br $continue|1 end end - get_local $0 get_local $5 i32.const 1 i32.shr_s tee_local $4 i32.const 2 i32.shl + get_local $0 i32.add f32.load offset=8 set_local $7 - get_local $0 get_local $3 i32.const 2 i32.shl + get_local $0 i32.add f32.load offset=8 set_local $6 @@ -4046,12 +4019,12 @@ i32.const 0 i32.lt_s if - get_local $8 get_local $3 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add tee_local $5 get_local $5 @@ -4063,17 +4036,17 @@ i32.shl i32.xor i32.store - get_local $0 get_local $3 i32.const 2 i32.shl + get_local $0 i32.add get_local $7 f32.store offset=8 - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add get_local $6 f32.store offset=8 @@ -4083,47 +4056,43 @@ i32.sub set_local $3 br $repeat|0 - unreachable end - unreachable end - block $break|2 - get_local $1 - i32.const 1 - i32.sub - set_local $3 - loop $repeat|2 - get_local $3 - i32.const 2 - i32.lt_s - br_if $break|2 + get_local $1 + i32.const 1 + i32.sub + set_local $3 + loop $repeat|2 + get_local $3 + i32.const 2 + i32.ge_s + if get_local $0 f32.load offset=8 set_local $6 get_local $0 - get_local $0 get_local $3 i32.const 2 i32.shl - i32.add tee_local $1 + get_local $0 + i32.add f32.load offset=8 f32.store offset=8 + get_local $0 get_local $1 + i32.add get_local $6 f32.store offset=8 i32.const 1 set_local $4 loop $continue|3 - get_local $4 - i32.const 1 - i32.shl - get_local $8 get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add i32.load get_local $4 @@ -4132,6 +4101,9 @@ i32.shr_u i32.const 1 i32.and + get_local $4 + i32.const 1 + i32.shl i32.add tee_local $5 get_local $3 @@ -4150,10 +4122,10 @@ get_local $0 f32.load offset=8 set_local $6 - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add f32.load offset=8 set_local $7 @@ -4166,12 +4138,12 @@ i32.const 0 i32.lt_s if - get_local $8 get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add tee_local $1 get_local $1 @@ -4183,10 +4155,10 @@ i32.shl i32.xor i32.store - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add get_local $6 f32.store offset=8 @@ -4206,9 +4178,7 @@ i32.sub set_local $3 br $repeat|2 - unreachable end - unreachable end get_local $0 i32.const 4 @@ -4333,10 +4303,9 @@ (func $std/array/isArraysEqual (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - (local $3 f32) - (local $4 i32) + (local $3 i32) + (local $4 f32) (local $5 i32) - (local $6 f32) get_local $0 i32.load offset=4 tee_local $5 @@ -4355,80 +4324,76 @@ return end loop $repeat|0 - block $break|0 - block $continue|0 + get_local $1 + get_local $5 + i32.lt_s + if + get_local $1 + tee_local $2 + get_local $0 + i32.load + tee_local $3 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result f32) + get_local $2 + i32.const 2 + i32.shl + get_local $3 + i32.add + f32.load offset=8 + else + unreachable + end + tee_local $4 + get_local $4 + f32.ne + tee_local $3 + get_local $1 + i32.const 3160 + i32.load + tee_local $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result f32) get_local $1 - get_local $5 - i32.ge_s - br_if $break|0 + i32.const 2 + i32.shl + get_local $2 + i32.add + f32.load offset=8 + else + unreachable + end + tee_local $4 + get_local $4 + f32.ne + i32.ne + if get_local $1 tee_local $2 get_local $0 i32.load - tee_local $4 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - get_local $4 - get_local $2 - i32.const 2 - i32.shl - i32.add - f32.load offset=8 - else - unreachable - end tee_local $3 - get_local $3 - f32.ne - set_local $4 - get_local $1 - i32.const 3160 - i32.load - tee_local $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) get_local $2 - get_local $1 i32.const 2 i32.shl + get_local $3 i32.add f32.load offset=8 else unreachable end - set_local $3 - get_local $4 - get_local $3 - get_local $3 - f32.ne - i32.eq - br_if $continue|0 - get_local $1 - tee_local $2 - get_local $0 - i32.load tee_local $4 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - get_local $4 - get_local $2 - i32.const 2 - i32.shl - i32.add - f32.load offset=8 - else - unreachable - end - set_local $3 get_local $1 i32.const 3160 i32.load @@ -4438,18 +4403,15 @@ i32.shr_u i32.lt_u if (result f32) - get_local $2 get_local $1 i32.const 2 i32.shl + get_local $2 i32.add f32.load offset=8 else unreachable end - set_local $6 - get_local $3 - get_local $6 f32.ne if i32.const 0 @@ -4477,10 +4439,10 @@ i32.ge_s i32.eqz if - get_local $0 get_local $4 i32.const 3 i32.shl + get_local $0 i32.add f64.load offset=8 set_local $5 @@ -4494,10 +4456,10 @@ i32.ge_s if block $break|1 - get_local $0 get_local $3 i32.const 3 i32.shl + get_local $0 i32.add f64.load offset=8 set_local $6 @@ -4515,12 +4477,12 @@ i32.const 1 i32.sub set_local $3 - get_local $0 get_local $7 i32.const 1 i32.add i32.const 3 i32.shl + get_local $0 i32.add get_local $6 f64.store offset=8 @@ -4528,12 +4490,12 @@ end end end - get_local $0 get_local $3 i32.const 1 i32.add i32.const 3 i32.shl + get_local $0 i32.add get_local $5 f64.store offset=8 @@ -4565,28 +4527,27 @@ i32.const 0 get_local $5 call $~lib/internal/memory/memset - block $break|0 - get_local $1 - i32.const 1 - i32.sub - set_local $3 - loop $repeat|0 - get_local $3 - i32.const 0 - i32.le_s - br_if $break|0 + get_local $1 + i32.const 1 + i32.sub + set_local $3 + loop $repeat|0 + get_local $3 + i32.const 0 + i32.gt_s + if get_local $3 set_local $5 loop $continue|1 get_local $5 i32.const 1 i32.and - get_local $8 get_local $5 i32.const 6 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add i32.load get_local $5 @@ -4606,20 +4567,20 @@ br $continue|1 end end - get_local $0 get_local $5 i32.const 1 i32.shr_s tee_local $4 i32.const 3 i32.shl + get_local $0 i32.add f64.load offset=8 set_local $7 - get_local $0 get_local $3 i32.const 3 i32.shl + get_local $0 i32.add f64.load offset=8 set_local $6 @@ -4632,12 +4593,12 @@ i32.const 0 i32.lt_s if - get_local $8 get_local $3 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add tee_local $5 get_local $5 @@ -4649,17 +4610,17 @@ i32.shl i32.xor i32.store - get_local $0 get_local $3 i32.const 3 i32.shl + get_local $0 i32.add get_local $7 f64.store offset=8 - get_local $0 get_local $4 i32.const 3 i32.shl + get_local $0 i32.add get_local $6 f64.store offset=8 @@ -4669,47 +4630,43 @@ i32.sub set_local $3 br $repeat|0 - unreachable end - unreachable end - block $break|2 - get_local $1 - i32.const 1 - i32.sub - set_local $3 - loop $repeat|2 - get_local $3 - i32.const 2 - i32.lt_s - br_if $break|2 + get_local $1 + i32.const 1 + i32.sub + set_local $3 + loop $repeat|2 + get_local $3 + i32.const 2 + i32.ge_s + if get_local $0 f64.load offset=8 set_local $6 get_local $0 - get_local $0 get_local $3 i32.const 3 i32.shl - i32.add tee_local $1 + get_local $0 + i32.add f64.load offset=8 f64.store offset=8 + get_local $0 get_local $1 + i32.add get_local $6 f64.store offset=8 i32.const 1 set_local $4 loop $continue|3 - get_local $4 - i32.const 1 - i32.shl - get_local $8 get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add i32.load get_local $4 @@ -4718,6 +4675,9 @@ i32.shr_u i32.const 1 i32.and + get_local $4 + i32.const 1 + i32.shl i32.add tee_local $5 get_local $3 @@ -4736,10 +4696,10 @@ get_local $0 f64.load offset=8 set_local $6 - get_local $0 get_local $4 i32.const 3 i32.shl + get_local $0 i32.add f64.load offset=8 set_local $7 @@ -4752,12 +4712,12 @@ i32.const 0 i32.lt_s if - get_local $8 get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $8 i32.add tee_local $1 get_local $1 @@ -4769,10 +4729,10 @@ i32.shl i32.xor i32.store - get_local $0 get_local $4 i32.const 3 i32.shl + get_local $0 i32.add get_local $6 f64.store offset=8 @@ -4792,9 +4752,7 @@ i32.sub set_local $3 br $repeat|2 - unreachable end - unreachable end get_local $0 i32.const 8 @@ -4919,10 +4877,9 @@ (func $std/array/isArraysEqual (; 78 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - (local $3 f64) - (local $4 i32) + (local $3 i32) + (local $4 f64) (local $5 i32) - (local $6 f64) get_local $0 i32.load offset=4 tee_local $5 @@ -4941,80 +4898,76 @@ return end loop $repeat|0 - block $break|0 - block $continue|0 + get_local $1 + get_local $5 + i32.lt_s + if + get_local $1 + tee_local $2 + get_local $0 + i32.load + tee_local $3 + i32.load + i32.const 3 + i32.shr_u + i32.lt_u + if (result f64) + get_local $2 + i32.const 3 + i32.shl + get_local $3 + i32.add + f64.load offset=8 + else + unreachable + end + tee_local $4 + get_local $4 + f64.ne + tee_local $3 + get_local $1 + i32.const 3432 + i32.load + tee_local $2 + i32.load + i32.const 3 + i32.shr_u + i32.lt_u + if (result f64) get_local $1 - get_local $5 - i32.ge_s - br_if $break|0 + i32.const 3 + i32.shl + get_local $2 + i32.add + f64.load offset=8 + else + unreachable + end + tee_local $4 + get_local $4 + f64.ne + i32.ne + if get_local $1 tee_local $2 get_local $0 i32.load - tee_local $4 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - get_local $4 - get_local $2 - i32.const 3 - i32.shl - i32.add - f64.load offset=8 - else - unreachable - end tee_local $3 - get_local $3 - f64.ne - set_local $4 - get_local $1 - i32.const 3432 - i32.load - tee_local $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) get_local $2 - get_local $1 i32.const 3 i32.shl + get_local $3 i32.add f64.load offset=8 else unreachable end - set_local $3 - get_local $4 - get_local $3 - get_local $3 - f64.ne - i32.eq - br_if $continue|0 - get_local $1 - tee_local $2 - get_local $0 - i32.load tee_local $4 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - get_local $4 - get_local $2 - i32.const 3 - i32.shl - i32.add - f64.load offset=8 - else - unreachable - end - set_local $3 get_local $1 i32.const 3432 i32.load @@ -5024,18 +4977,15 @@ i32.shr_u i32.lt_u if (result f64) - get_local $2 get_local $1 i32.const 3 i32.shl + get_local $2 i32.add f64.load offset=8 else unreachable end - set_local $6 - get_local $3 - get_local $6 f64.ne if i32.const 0 @@ -5063,10 +5013,10 @@ i32.ge_s i32.eqz if - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 set_local $6 @@ -5080,10 +5030,10 @@ i32.ge_s if block $break|1 - get_local $0 get_local $3 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 set_local $5 @@ -5103,12 +5053,12 @@ i32.const 1 i32.sub set_local $3 - get_local $0 get_local $5 i32.const 1 i32.add i32.const 2 i32.shl + get_local $0 i32.add get_local $7 i32.store offset=8 @@ -5116,12 +5066,12 @@ end end end - get_local $0 get_local $3 i32.const 1 i32.add i32.const 2 i32.shl + get_local $0 i32.add get_local $6 i32.store offset=8 @@ -5153,28 +5103,27 @@ i32.const 0 get_local $6 call $~lib/internal/memory/memset - block $break|0 - get_local $1 - i32.const 1 - i32.sub - set_local $4 - loop $repeat|0 - get_local $4 - i32.const 0 - i32.le_s - br_if $break|0 + get_local $1 + i32.const 1 + i32.sub + set_local $4 + loop $repeat|0 + get_local $4 + i32.const 0 + i32.gt_s + if get_local $4 set_local $3 loop $continue|1 get_local $3 i32.const 1 i32.and - get_local $7 get_local $3 i32.const 6 i32.shr_s i32.const 2 i32.shl + get_local $7 i32.add i32.load get_local $3 @@ -5194,20 +5143,20 @@ br $continue|1 end end - get_local $0 get_local $3 i32.const 1 i32.shr_s tee_local $5 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 set_local $3 - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 set_local $6 @@ -5220,12 +5169,12 @@ i32.const 0 i32.lt_s if - get_local $7 get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $7 i32.add tee_local $8 get_local $8 @@ -5237,17 +5186,17 @@ i32.shl i32.xor i32.store - get_local $0 get_local $4 i32.const 2 i32.shl + get_local $0 i32.add get_local $3 i32.store offset=8 - get_local $0 get_local $5 i32.const 2 i32.shl + get_local $0 i32.add get_local $6 i32.store offset=8 @@ -5257,47 +5206,43 @@ i32.sub set_local $4 br $repeat|0 - unreachable end - unreachable end - block $break|2 - get_local $1 - i32.const 1 - i32.sub - set_local $4 - loop $repeat|2 - get_local $4 - i32.const 2 - i32.lt_s - br_if $break|2 + get_local $1 + i32.const 1 + i32.sub + set_local $4 + loop $repeat|2 + get_local $4 + i32.const 2 + i32.ge_s + if get_local $0 i32.load offset=8 set_local $6 get_local $0 - get_local $0 get_local $4 i32.const 2 i32.shl - i32.add tee_local $1 + get_local $0 + i32.add i32.load offset=8 i32.store offset=8 + get_local $0 get_local $1 + i32.add get_local $6 i32.store offset=8 i32.const 1 set_local $5 loop $continue|3 - get_local $5 - i32.const 1 - i32.shl - get_local $7 get_local $5 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $7 i32.add i32.load get_local $5 @@ -5306,6 +5251,9 @@ i32.shr_u i32.const 1 i32.and + get_local $5 + i32.const 1 + i32.shl i32.add tee_local $3 get_local $4 @@ -5324,10 +5272,10 @@ get_local $0 i32.load offset=8 set_local $6 - get_local $0 get_local $5 i32.const 2 i32.shl + get_local $0 i32.add i32.load offset=8 set_local $3 @@ -5340,12 +5288,12 @@ i32.const 0 i32.lt_s if - get_local $7 get_local $5 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $7 i32.add tee_local $1 get_local $1 @@ -5357,10 +5305,10 @@ i32.shl i32.xor i32.store - get_local $0 get_local $5 i32.const 2 i32.shl + get_local $0 i32.add get_local $6 i32.store offset=8 @@ -5380,9 +5328,7 @@ i32.sub set_local $4 br $repeat|2 - unreachable end - unreachable end get_local $0 i32.const 4 @@ -5493,10 +5439,10 @@ get_local $0 call $~lib/array/Array#constructor set_local $1 - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 + i32.const 0 + set_local $0 + loop $repeat|0 + block $break|0 get_local $0 get_local $1 i32.load offset=4 @@ -5516,9 +5462,7 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end get_local $1 ) @@ -5540,17 +5484,17 @@ get_global $~lib/math/random_state1_64 tee_local $1 set_global $~lib/math/random_state0_64 - get_local $0 + get_local $1 get_local $0 i64.const 23 i64.shl + get_local $0 i64.xor tee_local $0 get_local $0 i64.const 17 i64.shr_u i64.xor - get_local $1 i64.xor get_local $1 i64.const 26 @@ -5558,8 +5502,8 @@ i64.xor tee_local $0 set_global $~lib/math/random_state1_64 - get_local $1 get_local $0 + get_local $1 i64.add i64.const 4503599627370495 i64.and @@ -5574,8 +5518,8 @@ get_local $0 call $~lib/array/Array#constructor set_local $0 - block $break|0 - loop $repeat|0 + loop $repeat|0 + block $break|0 get_local $1 get_local $0 i32.load offset=4 @@ -5595,9 +5539,7 @@ i32.add set_local $1 br $repeat|0 - unreachable end - unreachable end get_local $0 ) @@ -5606,17 +5548,16 @@ (local $3 i32) (local $4 i32) (local $5 i32) - block $break|0 - i32.const 1 - set_local $2 - get_local $0 - i32.load offset=4 - set_local $5 - loop $repeat|0 - get_local $2 - get_local $5 - i32.ge_s - br_if $break|0 + i32.const 1 + set_local $2 + get_local $0 + i32.load offset=4 + set_local $5 + loop $repeat|0 + get_local $2 + get_local $5 + i32.lt_s + if i32.const 2 set_global $~argc get_local $2 @@ -5631,17 +5572,17 @@ i32.shr_u i32.lt_u if (result i32) - get_local $3 get_local $4 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 else unreachable end tee_local $3 - set_local $4 + tee_local $4 get_local $2 get_local $0 i32.load @@ -5651,18 +5592,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $3 get_local $2 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 else unreachable end - set_local $3 - get_local $4 - get_local $3 + tee_local $3 get_local $1 call_indirect (type $iii) i32.const 0 @@ -5678,9 +5617,7 @@ br $repeat|0 end unreachable - unreachable end - unreachable end i32.const 1 ) @@ -5737,10 +5674,10 @@ i32.shr_u i32.lt_u if (result i32) - get_local $2 get_local $0 i32.const 2 i32.shl + get_local $2 i32.add i32.load offset=8 else @@ -5765,7 +5702,6 @@ get_local $1 ) (func $start~anonymous|52 (; 92 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) i32.const 0 get_local $0 i32.load @@ -5781,7 +5717,6 @@ unreachable end tee_local $0 - set_local $2 i32.const 0 get_local $1 i32.load @@ -5796,9 +5731,7 @@ else unreachable end - set_local $0 - get_local $2 - get_local $0 + tee_local $0 i32.sub ) (func $~lib/array/Array>#sort (; 93 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -5894,8 +5827,7 @@ get_local $1 get_local $0 i32.load offset=4 - i32.ge_s - i32.eqz + i32.lt_s if get_local $0 i32.load offset=4 @@ -6126,7 +6058,6 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) get_local $0 i32.load offset=4 tee_local $4 @@ -6158,17 +6089,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $3 get_local $2 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 else unreachable end tee_local $3 - set_local $5 get_local $2 tee_local $3 get_local $1 @@ -6179,18 +6109,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $2 get_local $3 i32.const 2 i32.shl + get_local $2 i32.add i32.load offset=8 else unreachable end - set_local $2 - get_local $5 - get_local $2 + tee_local $2 call $~lib/string/String.__eq if get_local $3 @@ -6263,17 +6191,17 @@ get_local $1 ) (func $~lib/internal/string/copyUnsafe (; 105 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add i32.const 4 i32.add - get_local $2 get_local $3 i32.const 1 i32.shl + get_local $2 i32.add i32.const 4 i32.add @@ -6347,8 +6275,8 @@ (local $2 i32) i32.const 3824 set_local $1 - block $break|0 - loop $repeat|0 + loop $repeat|0 + block $break|0 get_local $2 get_local $0 i32.ge_s @@ -6369,9 +6297,7 @@ i32.add set_local $2 br $repeat|0 - unreachable end - unreachable end get_local $1 ) @@ -6381,13 +6307,12 @@ i32.const 400 call $~lib/array/Array#constructor set_local $1 - block $break|0 - loop $repeat|0 - get_local $0 - get_local $1 - i32.load offset=4 - i32.ge_s - br_if $break|0 + loop $repeat|0 + get_local $0 + get_local $1 + i32.load offset=4 + i32.lt_s + if get_local $1 get_local $0 call $~lib/math/NativeMath.random @@ -6401,9 +6326,7 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end get_local $1 ) @@ -6468,9 +6391,9 @@ i32.eqz tee_local $2 if - get_local $1 get_local $0 i32.load + get_local $1 i32.eq set_local $2 end @@ -6545,8 +6468,8 @@ get_local $4 i32.lt_s if - get_local $5 get_local $1 + get_local $5 i32.add i32.load8_u offset=8 i32.const 0 @@ -6589,8 +6512,8 @@ br $repeat|0 end end - get_local $5 get_local $4 + get_local $5 i32.add i32.load8_u offset=8 i32.const 0 @@ -6708,28 +6631,28 @@ i32.const 10000 i32.div_u set_local $1 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 100 i32.div_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -6751,18 +6674,18 @@ i32.const 100 i32.div_u set_local $1 - get_local $0 get_local $2 i32.const 2 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -6771,27 +6694,27 @@ i32.const 10 i32.ge_u if - get_local $0 get_local $2 i32.const 2 i32.sub i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $1 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 i32.store offset=4 else - get_local $0 get_local $2 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add get_local $1 i32.const 48 @@ -6838,10 +6761,10 @@ get_local $2 ) (func $~lib/internal/number/itoa_stream (; 115 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -6930,16 +6853,16 @@ get_local $4 i32.lt_s if - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $3 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add set_local $2 get_local $7 @@ -6965,16 +6888,16 @@ get_local $0 set_local $3 get_local $8 - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $4 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add tee_local $2 i32.gt_s @@ -7017,10 +6940,10 @@ ) (func $~lib/internal/number/itoa_stream (; 118 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -7091,16 +7014,16 @@ get_local $4 i32.lt_s if - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $3 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add set_local $2 get_local $7 @@ -7126,16 +7049,16 @@ get_local $0 set_local $3 get_local $8 - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $4 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add tee_local $2 i32.gt_s @@ -7170,7 +7093,6 @@ get_local $1 i64.sub set_local $8 - get_local $3 i64.const 1 i32.const 0 get_local $4 @@ -7183,6 +7105,7 @@ i64.const 1 i64.sub tee_local $14 + get_local $3 i64.and set_local $1 get_local $3 @@ -7329,10 +7252,10 @@ i32.const 1 i32.add set_local $6 - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add get_local $4 i32.const 65535 @@ -7360,22 +7283,22 @@ get_local $9 i32.add set_global $~lib/internal/number/_K - get_local $12 get_local $9 i32.const 2 i32.shl + get_local $12 i32.add i64.load32_u offset=8 get_local $11 i64.extend_s/i32 i64.shl set_local $1 - get_local $0 get_local $6 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add tee_local $2 i32.load16_u offset=4 @@ -7395,8 +7318,8 @@ end get_local $0 if - get_local $3 get_local $1 + get_local $3 i64.add get_local $8 i64.lt_u @@ -7406,8 +7329,8 @@ get_local $8 get_local $3 i64.sub - get_local $3 get_local $1 + get_local $3 i64.add get_local $8 i64.sub @@ -7421,8 +7344,8 @@ i32.const 1 i32.sub set_local $7 - get_local $3 get_local $1 + get_local $3 i64.add set_local $3 br $continue|2 @@ -7461,10 +7384,10 @@ i32.const 1 i32.add set_local $6 - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add get_local $3 i32.wrap/i64 @@ -7489,23 +7412,23 @@ get_local $9 i32.add set_global $~lib/internal/number/_K - get_local $8 - get_local $12 i32.const 0 get_local $9 i32.sub i32.const 2 i32.shl + get_local $12 i32.add i64.load32_u offset=8 + get_local $8 i64.mul set_local $8 - get_local $0 get_local $6 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add tee_local $4 i32.load16_u offset=4 @@ -7573,10 +7496,10 @@ get_local $2 i32.eqz if - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add i32.const 3145774 i32.store offset=4 @@ -7600,18 +7523,18 @@ end get_local $3 if (result i32) - block $break|0 - get_local $1 - set_local $3 - loop $repeat|0 + get_local $1 + set_local $3 + loop $repeat|0 + block $break|0 get_local $3 get_local $4 i32.ge_s br_if $break|0 - get_local $0 get_local $3 i32.const 1 i32.shl + get_local $0 i32.add i32.const 48 i32.store16 offset=4 @@ -7620,14 +7543,12 @@ i32.add set_local $3 br $repeat|0 - unreachable end - unreachable end - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add i32.const 3145774 i32.store offset=4 @@ -7647,10 +7568,10 @@ end get_local $3 if (result i32) - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add tee_local $3 i32.const 6 @@ -7703,18 +7624,18 @@ get_local $0 i32.const 3014704 i32.store offset=4 - block $break|1 - i32.const 2 - set_local $2 - loop $repeat|1 + i32.const 2 + set_local $2 + loop $repeat|1 + block $break|1 get_local $2 get_local $3 i32.ge_s br_if $break|1 - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add i32.const 48 i32.store16 offset=4 @@ -7723,9 +7644,7 @@ i32.add set_local $2 br $repeat|1 - unreachable end - unreachable end get_local $1 get_local $3 @@ -7843,18 +7762,18 @@ (local $5 i32) (local $6 i64) (local $7 i64) - (local $8 i64) + (local $8 i32) (local $9 i64) (local $10 i64) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i32) (local $15 i64) get_local $1 f64.const 0 f64.lt - tee_local $12 + tee_local $13 if get_local $1 f64.neg @@ -7871,25 +7790,26 @@ i64.const 52 i64.shr_u i32.wrap/i64 - tee_local $13 + set_local $8 + get_local $2 + i64.const 4503599627370495 + i64.and + get_local $8 i32.const 0 i32.ne tee_local $5 i64.extend_u/i32 i64.const 52 i64.shl - get_local $2 - i64.const 4503599627370495 - i64.and i64.add set_local $2 - get_local $13 + get_local $8 i32.const 1 get_local $5 select i32.const 1075 i32.sub - tee_local $13 + tee_local $8 i32.const 1 i32.sub set_local $5 @@ -7918,7 +7838,7 @@ i64.shl i64.const 1 i64.sub - get_local $13 + get_local $8 get_local $14 i32.sub get_local $5 @@ -7968,10 +7888,10 @@ i32.add i64.load offset=8 set_global $~lib/internal/number/_frc_pow - get_local $4 get_local $5 i32.const 1 i32.shl + get_local $4 i32.add i32.load16_s offset=8 set_global $~lib/internal/number/_exp_pow @@ -7990,22 +7910,22 @@ tee_local $6 i64.const 4294967295 i64.and - tee_local $8 + tee_local $9 i64.mul - set_local $9 - get_local $7 + set_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $10 + tee_local $11 + get_local $7 i64.mul get_local $2 i64.const 32 i64.shr_u - tee_local $11 - get_local $8 - i64.mul + tee_local $12 get_local $9 + i64.mul + get_local $10 i64.const 32 i64.shr_u i64.add @@ -8013,43 +7933,42 @@ i64.const 4294967295 i64.and i64.add - set_local $2 + tee_local $2 + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u get_local $11 - get_local $10 + get_local $12 i64.mul get_local $3 i64.const 32 i64.shr_u i64.add - get_local $2 - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u i64.add set_local $2 + get_local $6 + i64.const 4294967295 + i64.and + tee_local $11 get_global $~lib/internal/number/_frc_plus tee_local $3 i64.const 4294967295 i64.and - tee_local $9 - get_local $6 - i64.const 4294967295 - i64.and tee_local $10 i64.mul set_local $7 - get_local $9 + get_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $8 + tee_local $9 i64.mul + get_local $11 get_local $3 i64.const 32 i64.shr_u - tee_local $11 - get_local $10 + tee_local $12 i64.mul get_local $7 i64.const 32 @@ -8059,19 +7978,18 @@ i64.const 4294967295 i64.and i64.add - set_local $7 - get_local $11 - get_local $8 + tee_local $7 + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + get_local $9 + get_local $12 i64.mul get_local $3 i64.const 32 i64.shr_u i64.add - get_local $7 - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u i64.add set_local $15 get_global $~lib/internal/number/_frc_minus @@ -8082,22 +8000,22 @@ get_local $6 i64.const 4294967295 i64.and - tee_local $8 + tee_local $9 i64.mul - set_local $9 - get_local $7 + set_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $10 + tee_local $11 + get_local $7 i64.mul get_local $3 i64.const 32 i64.shr_u - tee_local $11 - get_local $8 - i64.mul + tee_local $12 get_local $9 + i64.mul + get_local $10 i64.const 32 i64.shr_u i64.add @@ -8111,7 +8029,7 @@ i64.sub tee_local $7 get_local $11 - get_local $10 + get_local $12 i64.mul get_local $3 i64.const 32 @@ -8127,14 +8045,14 @@ i64.add i64.sub set_local $3 - get_local $0 - get_local $12 + get_local $13 i32.const 1 i32.shl + get_local $0 i32.add get_local $0 get_local $2 - get_local $13 + get_local $8 get_local $4 i32.sub get_global $~lib/internal/number/_exp_pow @@ -8144,19 +8062,19 @@ i32.sub tee_local $5 get_local $7 - get_global $~lib/internal/number/_exp get_local $4 + get_global $~lib/internal/number/_exp i32.add i32.const -64 i32.sub get_local $3 - get_local $12 + get_local $13 call $~lib/internal/number/genDigits - get_local $12 + get_local $13 i32.sub get_global $~lib/internal/number/_K call $~lib/internal/number/prettify - get_local $12 + get_local $13 i32.add ) (func $~lib/internal/number/dtoa (; 123 ;) (type $Fi) (param $0 f64) (result i32) @@ -8213,10 +8131,10 @@ get_local $1 ) (func $~lib/internal/number/dtoa_stream (; 124 ;) (type $iiFi) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -8338,16 +8256,16 @@ get_local $3 i32.lt_s if - get_local $0 get_local $2 get_local $0 - get_local $4 get_local $1 i32.const 3 i32.shl + get_local $4 i32.add f64.load offset=8 call $~lib/internal/number/dtoa_stream + get_local $0 i32.add set_local $0 get_local $6 @@ -8371,17 +8289,17 @@ end end get_local $7 - get_local $0 get_local $2 tee_local $1 get_local $0 - get_local $4 get_local $3 i32.const 3 i32.shl + get_local $4 i32.add f64.load offset=8 call $~lib/internal/number/dtoa_stream + get_local $0 i32.add tee_local $0 i32.gt_s @@ -8438,26 +8356,26 @@ i32.load offset=8 return end - block $break|0 - i32.const 0 - set_local $0 - get_local $5 - i32.const 1 - i32.add - set_local $2 - loop $repeat|0 + i32.const 0 + set_local $0 + get_local $5 + i32.const 1 + i32.add + set_local $2 + loop $repeat|0 + block $break|0 get_local $0 get_local $2 i32.ge_s br_if $break|0 - get_local $3 - get_local $6 get_local $0 i32.const 2 i32.shl + get_local $6 i32.add i32.load offset=8 i32.load + get_local $3 i32.add set_local $3 get_local $0 @@ -8465,31 +8383,29 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end i32.const 0 set_local $2 - get_local $3 - get_local $7 get_local $5 + get_local $7 i32.mul + get_local $3 i32.add call $~lib/internal/string/allocateUnsafe set_local $0 - block $break|1 - i32.const 0 - set_local $3 - loop $repeat|1 + i32.const 0 + set_local $3 + loop $repeat|1 + block $break|1 get_local $3 get_local $5 i32.ge_s br_if $break|1 - get_local $6 get_local $3 i32.const 2 i32.shl + get_local $6 i32.add i32.load offset=8 tee_local $4 @@ -8525,14 +8441,12 @@ i32.add set_local $3 br $repeat|1 - unreachable end - unreachable end - get_local $6 get_local $5 i32.const 2 i32.shl + get_local $6 i32.add i32.load offset=8 tee_local $4 @@ -8596,10 +8510,10 @@ get_local $3 i32.lt_s if - get_local $5 get_local $2 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 if @@ -8634,10 +8548,10 @@ br $repeat|0 end end - get_local $5 get_local $3 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 if @@ -8677,10 +8591,10 @@ ) (func $~lib/internal/number/itoa_stream (; 128 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -8782,14 +8696,14 @@ get_local $3 i32.lt_s if - get_local $0 get_local $2 get_local $0 - get_local $4 get_local $1 + get_local $4 i32.add i32.load8_s offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add set_local $0 get_local $6 @@ -8813,15 +8727,15 @@ end end get_local $7 - get_local $0 get_local $2 tee_local $1 get_local $0 - get_local $4 get_local $3 + get_local $4 i32.add i32.load8_s offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add tee_local $0 i32.gt_s @@ -8844,10 +8758,10 @@ get_local $1 ) (func $~lib/internal/number/itoa_stream (; 130 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -8925,16 +8839,16 @@ get_local $3 i32.lt_s if - get_local $0 get_local $2 get_local $0 - get_local $4 get_local $1 i32.const 1 i32.shl + get_local $4 i32.add i32.load16_u offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add set_local $0 get_local $6 @@ -8958,17 +8872,17 @@ end end get_local $7 - get_local $0 get_local $2 tee_local $1 get_local $0 - get_local $4 get_local $3 i32.const 1 i32.shl + get_local $4 i32.add i32.load16_u offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add tee_local $0 i32.gt_s @@ -9077,15 +8991,14 @@ i32.const 100 i32.rem_u set_local $5 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 10000 i32.rem_u @@ -9094,38 +9007,39 @@ i32.div_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 i64.shl i64.or i64.store offset=4 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $6 i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $5 i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -9179,10 +9093,10 @@ ) (func $~lib/internal/number/itoa_stream (; 135 ;) (type $iiIi) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -9269,16 +9183,16 @@ get_local $3 i32.lt_s if - get_local $0 get_local $2 get_local $0 - get_local $4 get_local $1 i32.const 3 i32.shl + get_local $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add set_local $0 get_local $6 @@ -9302,17 +9216,17 @@ end end get_local $7 - get_local $0 get_local $2 tee_local $1 get_local $0 - get_local $4 get_local $3 i32.const 3 i32.shl + get_local $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add tee_local $0 i32.gt_s @@ -9394,10 +9308,10 @@ (func $~lib/internal/number/itoa_stream (; 138 ;) (type $iiIi) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -9504,16 +9418,16 @@ get_local $3 i32.lt_s if - get_local $0 get_local $2 get_local $0 - get_local $4 get_local $1 i32.const 3 i32.shl + get_local $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add set_local $0 get_local $6 @@ -9537,17 +9451,17 @@ end end get_local $7 - get_local $0 get_local $2 tee_local $1 get_local $0 - get_local $4 get_local $3 i32.const 3 i32.shl + get_local $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream + get_local $0 i32.add tee_local $0 i32.gt_s @@ -9612,18 +9526,17 @@ tee_local $0 return end - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 - get_local $0 - get_local $3 - i32.ge_s - br_if $break|0 - get_local $4 + i32.const 0 + set_local $0 + loop $repeat|0 + get_local $0 + get_local $3 + i32.lt_s + if get_local $0 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -9647,14 +9560,12 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end - get_local $4 get_local $3 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -9669,10 +9580,10 @@ get_local $1 ) (func $~lib/internal/number/itoa_stream (; 141 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 get_local $2 @@ -9749,14 +9660,14 @@ get_local $4 i32.lt_s if - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $3 + get_local $5 i32.add i32.load8_u offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add set_local $2 get_local $7 @@ -9782,14 +9693,14 @@ get_local $0 set_local $3 get_local $8 - get_local $2 get_local $0 get_local $2 - get_local $5 get_local $4 + get_local $5 i32.add i32.load8_u offset=8 call $~lib/internal/number/itoa_stream + get_local $2 i32.add tee_local $2 i32.gt_s @@ -9854,18 +9765,17 @@ tee_local $0 return end - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 - get_local $0 - get_local $3 - i32.ge_s - br_if $break|0 - get_local $4 + i32.const 0 + set_local $0 + loop $repeat|0 + get_local $0 + get_local $3 + i32.lt_s + if get_local $0 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -9889,14 +9799,12 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end - get_local $4 get_local $3 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -9953,18 +9861,18 @@ tee_local $0 return end - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 + i32.const 0 + set_local $0 + loop $repeat|0 + block $break|0 get_local $0 get_local $4 i32.ge_s br_if $break|0 - get_local $5 get_local $0 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 tee_local $3 @@ -9988,14 +9896,12 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end - get_local $5 get_local $4 i32.const 2 i32.shl + get_local $5 i32.add i32.load offset=8 tee_local $3 @@ -10052,18 +9958,17 @@ tee_local $0 return end - block $break|0 - i32.const 0 - set_local $0 - loop $repeat|0 - get_local $0 - get_local $3 - i32.ge_s - br_if $break|0 - get_local $4 + i32.const 0 + set_local $0 + loop $repeat|0 + get_local $0 + get_local $3 + i32.lt_s + if get_local $0 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -10087,14 +9992,12 @@ i32.add set_local $0 br $repeat|0 - unreachable end - unreachable end - get_local $4 get_local $3 i32.const 2 i32.shl + get_local $4 i32.add i32.load offset=8 tee_local $2 @@ -10111,7 +10014,6 @@ (func $start (; 146 ;) (type $v) (local $0 i32) (local $1 i32) - (local $2 f32) i32.const 8352 set_global $~lib/allocator/arena/startOffset get_global $~lib/allocator/arena/startOffset @@ -13397,7 +13299,6 @@ else unreachable end - set_local $2 i32.const 0 get_global $std/array/arr i32.load @@ -13412,9 +13313,7 @@ else unreachable end - set_local $0 - get_local $2 - get_local $0 + tee_local $0 f32.convert_s/i32 f32.ne if diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 1fd09805..73e671b5 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -180,24 +180,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -282,12 +282,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -562,9 +562,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -572,14 +569,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -587,14 +584,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -602,14 +599,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -617,6 +614,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -671,9 +671,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -681,14 +678,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -696,14 +693,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -711,14 +708,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -726,6 +723,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -772,9 +772,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -782,14 +779,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -797,14 +794,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -812,14 +809,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -827,6 +824,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1380,11 +1380,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1399,11 +1399,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1417,11 +1417,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1443,8 +1443,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $3 get_local $1 + get_local $3 i32.add tee_local $4 i32.const 0 @@ -1466,8 +1466,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $3 get_local $2 + get_local $3 i32.add tee_local $4 i32.const 0 diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 1ff3bedd..4b74bdb5 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -190,24 +190,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -292,12 +292,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -384,12 +384,12 @@ call $~lib/env/abort unreachable end + get_local $1 get_local $0 i32.load get_local $0 i32.load offset=4 i32.add - get_local $1 i32.add get_local $2 i32.store8 offset=8 @@ -652,9 +652,6 @@ get_local $2 i32.eqz if - get_local $0 - i32.const 8 - i32.shl get_local $0 i32.const 16 i32.shl @@ -662,6 +659,9 @@ i32.shr_s i32.const 255 i32.and + get_local $0 + i32.const 8 + i32.shl i32.or set_local $0 end @@ -964,9 +964,6 @@ get_local $2 i32.eqz if - get_local $1 - i32.const 8 - i32.shl get_local $1 i32.const 16 i32.shl @@ -974,6 +971,9 @@ i32.shr_s i32.const 255 i32.and + get_local $1 + i32.const 8 + i32.shl i32.or set_local $1 end diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 05f6b6dd..8e2ff5e8 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -170,9 +170,9 @@ i64.store get_local $0 set_global $std/date/date + get_global $std/date/creationTime get_global $std/date/date i64.load - get_global $std/date/creationTime i64.ne if i32.const 0 diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat index 5998a907..99578f95 100644 --- a/tests/compiler/std/gc-array.optimized.wat +++ b/tests/compiler/std/gc-array.optimized.wat @@ -44,22 +44,22 @@ i32.load offset=4 set_local $2 get_local $1 - get_local $0 get_local $1 i32.load i32.const 3 i32.and + get_local $0 i32.or i32.store get_local $1 get_local $2 i32.store offset=4 get_local $2 - get_local $1 get_local $2 i32.load i32.const 3 i32.and + get_local $1 i32.or i32.store get_local $0 @@ -69,8 +69,8 @@ (func $~lib/collector/itcm/ManagedObject#makeGray (; 3 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 get_global $~lib/collector/itcm/iter + get_local $0 i32.eq if get_local $0 @@ -87,11 +87,11 @@ tee_local $1 i32.store offset=4 get_local $1 - get_local $2 get_local $1 i32.load i32.const 3 i32.and + get_local $2 i32.or i32.store get_global $~lib/collector/itcm/toSpace @@ -110,6 +110,7 @@ (local $1 i32) get_local $0 if + get_global $~lib/collector/itcm/white get_local $0 i32.const 16 i32.sub @@ -117,7 +118,6 @@ i32.load i32.const 3 i32.and - get_global $~lib/collector/itcm/white i32.eq if get_local $1 @@ -142,8 +142,8 @@ get_local $0 i32.lt_u if - get_local $2 get_local $1 + get_local $2 i32.add i32.load offset=8 call $~lib/collector/itcm/__gc_mark @@ -283,12 +283,12 @@ get_local $0 set_global $~lib/collector/itcm/iter get_local $0 + get_global $~lib/collector/itcm/white + i32.eqz get_local $0 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white - i32.eqz i32.or i32.store i32.const 1 @@ -303,11 +303,11 @@ get_global $std/gc-array/arr i32.const 3 call_indirect (type $iv) + get_global $~lib/collector/itcm/toSpace get_global $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/toSpace i32.eq if get_global $~lib/collector/itcm/fromSpace @@ -396,11 +396,11 @@ get_local $1 i32.store offset=8 get_local $2 + get_global $~lib/collector/itcm/white get_local $2 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white i32.or i32.store get_global $~lib/collector/itcm/fromSpace @@ -480,24 +480,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -582,12 +582,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -890,9 +890,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -900,14 +897,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -915,14 +912,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -930,14 +927,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -945,6 +942,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -999,9 +999,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -1009,14 +1006,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -1024,14 +1021,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -1039,14 +1036,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -1054,6 +1051,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -1100,9 +1100,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -1110,14 +1107,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -1125,14 +1122,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -1140,14 +1137,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -1155,6 +1152,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1708,11 +1708,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1727,11 +1727,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1745,11 +1745,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1819,8 +1819,8 @@ i32.add get_local $2 call $~lib/internal/memory/memmove - get_local $4 get_local $2 + get_local $4 i32.add get_local $1 get_local $2 @@ -1854,6 +1854,8 @@ ) (func $~lib/collector/itcm/__gc_link (; 16 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) + get_global $~lib/collector/itcm/white + i32.eqz get_local $0 i32.const 16 i32.sub @@ -1861,18 +1863,16 @@ i32.load i32.const 3 i32.and - get_global $~lib/collector/itcm/white - i32.eqz i32.eq tee_local $0 if + get_global $~lib/collector/itcm/white get_local $1 i32.const 16 i32.sub i32.load i32.const 3 i32.and - get_global $~lib/collector/itcm/white i32.eq set_local $0 end @@ -1920,10 +1920,10 @@ get_local $4 i32.store offset=4 end - get_local $3 get_local $1 i32.const 2 i32.shl + get_local $3 i32.add get_local $2 i32.store offset=8 diff --git a/tests/compiler/std/gc-basics.optimized.wat b/tests/compiler/std/gc-basics.optimized.wat index a282029e..849f6711 100644 --- a/tests/compiler/std/gc-basics.optimized.wat +++ b/tests/compiler/std/gc-basics.optimized.wat @@ -96,22 +96,22 @@ i32.load offset=4 set_local $2 get_local $1 - get_local $0 get_local $1 i32.load i32.const 3 i32.and + get_local $0 i32.or i32.store get_local $1 get_local $2 i32.store offset=4 get_local $2 - get_local $1 get_local $2 i32.load i32.const 3 i32.and + get_local $1 i32.or i32.store get_local $0 @@ -121,8 +121,8 @@ (func $~lib/collector/itcm/ManagedObject#makeGray (; 4 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 get_global $~lib/collector/itcm/iter + get_local $0 i32.eq if get_local $0 @@ -139,11 +139,11 @@ tee_local $1 i32.store offset=4 get_local $1 - get_local $2 get_local $1 i32.load i32.const 3 i32.and + get_local $2 i32.or i32.store get_global $~lib/collector/itcm/toSpace @@ -162,6 +162,7 @@ (local $1 i32) get_local $0 if + get_global $~lib/collector/itcm/white get_local $0 i32.const 16 i32.sub @@ -169,7 +170,6 @@ i32.load i32.const 3 i32.and - get_global $~lib/collector/itcm/white i32.eq if get_local $1 @@ -243,12 +243,12 @@ get_local $0 set_global $~lib/collector/itcm/iter get_local $0 + get_global $~lib/collector/itcm/white + i32.eqz get_local $0 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white - i32.eqz i32.or i32.store i32.const 1 @@ -266,11 +266,11 @@ get_global $std/gc-basics/obj2 i32.const 2 call_indirect (type $iv) + get_global $~lib/collector/itcm/toSpace get_global $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/toSpace i32.eq if get_global $~lib/collector/itcm/fromSpace @@ -325,11 +325,11 @@ i32.const 1 i32.store offset=8 get_local $0 + get_global $~lib/collector/itcm/white get_local $0 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white i32.or i32.store get_global $~lib/collector/itcm/fromSpace @@ -422,8 +422,8 @@ end get_local $1 if - get_local $3 get_local $2 + get_local $3 i32.eq set_local $1 end diff --git a/tests/compiler/std/gc-object.optimized.wat b/tests/compiler/std/gc-object.optimized.wat index a188b7ea..64fb0778 100644 --- a/tests/compiler/std/gc-object.optimized.wat +++ b/tests/compiler/std/gc-object.optimized.wat @@ -88,22 +88,22 @@ i32.load offset=4 set_local $2 get_local $1 - get_local $0 get_local $1 i32.load i32.const 3 i32.and + get_local $0 i32.or i32.store get_local $1 get_local $2 i32.store offset=4 get_local $2 - get_local $1 get_local $2 i32.load i32.const 3 i32.and + get_local $1 i32.or i32.store get_local $0 @@ -113,8 +113,8 @@ (func $~lib/collector/itcm/ManagedObject#makeGray (; 2 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 get_global $~lib/collector/itcm/iter + get_local $0 i32.eq if get_local $0 @@ -131,11 +131,11 @@ tee_local $1 i32.store offset=4 get_local $1 - get_local $2 get_local $1 i32.load i32.const 3 i32.and + get_local $2 i32.or i32.store get_global $~lib/collector/itcm/toSpace @@ -154,6 +154,7 @@ (local $1 i32) get_local $0 if + get_global $~lib/collector/itcm/white get_local $0 i32.const 16 i32.sub @@ -161,7 +162,6 @@ i32.load i32.const 3 i32.and - get_global $~lib/collector/itcm/white i32.eq if get_local $1 @@ -232,12 +232,12 @@ get_local $0 set_global $~lib/collector/itcm/iter get_local $0 + get_global $~lib/collector/itcm/white + i32.eqz get_local $0 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white - i32.eqz i32.or i32.store i32.const 1 @@ -252,11 +252,11 @@ get_global $std/gc-object/obj i32.const 1 call_indirect (type $iv) + get_global $~lib/collector/itcm/toSpace get_global $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/toSpace i32.eq if get_global $~lib/collector/itcm/fromSpace @@ -311,11 +311,11 @@ i32.const 2 i32.store offset=8 get_local $0 + get_global $~lib/collector/itcm/white get_local $0 i32.load i32.const -4 i32.and - get_global $~lib/collector/itcm/white i32.or i32.store get_global $~lib/collector/itcm/fromSpace diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 985ae420..7242b18b 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -17,22 +17,22 @@ (local $3 i32) i32.const -2128831035 set_local $2 - block $break|0 - get_local $0 - i32.load - i32.const 1 - i32.shl - set_local $3 - loop $repeat|0 + get_local $0 + i32.load + i32.const 1 + i32.shl + set_local $3 + loop $repeat|0 + block $break|0 get_local $1 get_local $3 i32.ge_u br_if $break|0 - get_local $2 get_local $0 get_local $1 i32.add i32.load8_u offset=4 + get_local $2 i32.xor i32.const 16777619 i32.mul @@ -42,9 +42,7 @@ i32.add set_local $1 br $repeat|0 - unreachable end - unreachable end get_local $2 ) diff --git a/tests/compiler/std/libm.optimized.wat b/tests/compiler/std/libm.optimized.wat index 8c5547f2..86ba19a4 100644 --- a/tests/compiler/std/libm.optimized.wat +++ b/tests/compiler/std/libm.optimized.wat @@ -124,12 +124,12 @@ i32.const 1072693248 i32.ge_u if - get_local $2 - i32.const 1072693248 - i32.sub get_local $0 i64.reinterpret/f64 i32.wrap/i64 + get_local $2 + i32.const 1072693248 + i32.sub i32.or i32.eqz if @@ -361,6 +361,9 @@ f64.const 0 end set_local $4 + get_local $7 + i64.const 4294967295 + i64.and get_local $5 i32.const 1048575 i32.and @@ -369,9 +372,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $7 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -532,7 +532,6 @@ end end end - get_local $3 get_local $1 i32.const 614242 i32.add @@ -541,8 +540,12 @@ i32.shr_s i32.const 1023 i32.sub + get_local $3 i32.add set_local $3 + get_local $4 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -551,9 +554,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $4 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -696,12 +696,12 @@ i32.const 1072693248 i32.ge_u if - get_local $2 - i32.const 1072693248 - i32.sub get_local $0 i64.reinterpret/f64 i32.wrap/i64 + get_local $2 + i32.const 1072693248 + i32.sub i32.or i32.eqz if @@ -1198,105 +1198,105 @@ (local $5 i32) (local $6 i64) (local $7 i32) - block $folding-inner0 - get_local $1 - get_local $1 - f64.ne - tee_local $2 - i32.eqz - if - get_local $0 - get_local $0 - f64.ne - set_local $2 - end - get_local $2 - if - get_local $1 - get_local $0 - f64.add - return - end - get_local $1 - i64.reinterpret/f64 - tee_local $6 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $6 - i32.wrap/i64 - set_local $2 + get_local $1 + get_local $1 + f64.ne + tee_local $2 + i32.eqz + if get_local $0 - i64.reinterpret/f64 - tee_local $6 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $6 - i32.wrap/i64 - set_local $7 - get_local $4 - i32.const 1072693248 - i32.sub - get_local $2 - i32.or - i32.eqz - if - get_local $0 - call $~lib/math/NativeMath.atan - return - end - get_local $5 - i32.const 31 - i32.shr_u - get_local $4 - i32.const 30 - i32.shr_u - i32.const 2 - i32.and - i32.or - set_local $3 - get_local $4 - i32.const 2147483647 - i32.and - set_local $4 - get_local $5 - i32.const 2147483647 - i32.and - tee_local $5 - get_local $7 - i32.or - i32.eqz - if - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 + get_local $0 + f64.ne + set_local $2 + end + get_local $2 + if + get_local $1 + get_local $0 + f64.add + return + end + get_local $1 + i64.reinterpret/f64 + tee_local $6 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $4 + get_local $6 + i32.wrap/i64 + set_local $2 + get_local $0 + i64.reinterpret/f64 + tee_local $6 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $5 + get_local $6 + i32.wrap/i64 + set_local $7 + get_local $4 + i32.const 1072693248 + i32.sub + get_local $2 + i32.or + i32.eqz + if + get_local $0 + call $~lib/math/NativeMath.atan + return + end + get_local $4 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + get_local $5 + i32.const 31 + i32.shr_u + i32.or + set_local $3 + get_local $4 + i32.const 2147483647 + i32.and + set_local $4 + get_local $7 + get_local $5 + i32.const 2147483647 + i32.and + tee_local $5 + i32.or + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + get_local $3 + i32.eqz + br_if $case1|0 + block $tablify|0 get_local $3 - i32.eqz - br_if $case1|0 - block $tablify|0 - get_local $3 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end - br $break|0 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 end - get_local $0 - return + br $break|0 end - f64.const 3.141592653589793 + get_local $0 return end - f64.const -3.141592653589793 + f64.const 3.141592653589793 return end + f64.const -3.141592653589793 + return end - get_local $4 + end + block $folding-inner0 get_local $2 + get_local $4 i32.or i32.eqz br_if $folding-inner0 @@ -2467,7 +2467,6 @@ end end end - get_local $4 get_local $1 i32.const 614242 i32.add @@ -2476,8 +2475,12 @@ i32.shr_u i32.const 1023 i32.sub + get_local $4 i32.add set_local $4 + get_local $5 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -2486,9 +2489,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $5 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -2688,7 +2688,6 @@ end end end - get_local $5 get_local $1 i32.const 614242 i32.add @@ -2697,8 +2696,12 @@ i32.shr_u i32.const 1023 i32.sub + get_local $5 i32.add set_local $5 + get_local $6 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -2707,9 +2710,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $6 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -2840,718 +2840,720 @@ (local $18 i32) (local $19 f64) (local $20 i32) - block $folding-inner1 - block $folding-inner0 - get_local $0 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 - i32.const 2147483647 - i32.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - tee_local $11 - i32.const 2147483647 - i32.and - tee_local $12 - get_local $17 - i32.wrap/i64 - tee_local $7 - i32.or - i32.eqz - if - f64.const 1 - return - end - get_local $4 - i32.const 2146435072 - i32.gt_s - tee_local $8 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $20 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.gt_s - set_local $8 - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $7 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - if - get_local $0 - get_local $1 - f64.add - return - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $12 - i32.const 1128267776 - i32.ge_s - if - i32.const 2 - set_local $16 - else - get_local $12 - i32.const 1072693248 - i32.ge_s - if - i32.const 52 - i32.const 20 - get_local $12 - i32.const 20 - i32.shr_s - i32.const 1023 - i32.sub - tee_local $10 - i32.const 20 - i32.gt_s - tee_local $5 - select - get_local $10 - i32.sub - set_local $8 - get_local $7 - get_local $12 - get_local $5 - select - tee_local $10 - get_local $8 - i32.shr_s - tee_local $5 - get_local $8 - i32.shl - get_local $10 - i32.eq - if - i32.const 2 - get_local $5 - i32.const 1 - i32.and - i32.sub - set_local $16 - end - end - end - end - get_local $7 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $20 - i32.or - if - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 0 - set_local $1 - end - get_local $1 - return - else - get_local $11 - i32.const 0 - i32.ge_s - if (result f64) - f64.const 0 - else - get_local $1 - f64.neg - end - tee_local $0 - return - end - unreachable - else - f64.const nan:0x8000000000000 - return - end - unreachable - end - get_local $12 - i32.const 1072693248 - i32.eq - if - get_local $11 - i32.const 0 - i32.ge_s - if - get_local $0 - return - end - f64.const 1 - get_local $0 - f64.div - return - end - get_local $11 - i32.const 1073741824 - i32.eq - if - get_local $0 - get_local $0 - f64.mul - return - end - get_local $11 - i32.const 1071644672 - i32.eq - if - get_local $18 - i32.const 0 - i32.ge_s - if - get_local $0 - f64.sqrt - return - end - end - end - get_local $0 - f64.abs - set_local $2 + get_local $0 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $18 + get_local $17 + i32.wrap/i64 + set_local $20 + get_local $18 + i32.const 2147483647 + i32.and + set_local $4 + get_local $1 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $12 + i32.const 2147483647 + i32.and + set_local $11 + get_local $11 + get_local $17 + i32.wrap/i64 + tee_local $7 + i32.or + i32.eqz + if + f64.const 1 + return + end + get_local $4 + i32.const 2146435072 + i32.gt_s + tee_local $8 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $8 + if get_local $20 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $5 - i32.eqz - if - get_local $4 - i32.eqz - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $4 - i32.const 1072693248 - i32.eq - set_local $5 - end - get_local $5 - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 1 - get_local $2 - f64.div - set_local $2 - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $16 - i32.or - if - get_local $16 - i32.const 1 - i32.eq - if - get_local $2 - f64.neg - set_local $2 - end - else - get_local $2 - get_local $2 - f64.sub - tee_local $0 - get_local $0 - f64.div - set_local $2 - end - end - get_local $2 - return - end - end - f64.const 1 - set_local $13 - get_local $18 i32.const 0 - i32.lt_s + i32.ne + set_local $8 + end + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.gt_s + set_local $8 + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + tee_local $8 + if + get_local $7 + i32.const 0 + i32.ne + set_local $8 + end + end + get_local $8 + if + get_local $0 + get_local $1 + f64.add + return + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $11 + i32.const 1128267776 + i32.ge_s + if + i32.const 2 + set_local $16 + else + get_local $11 + i32.const 1072693248 + i32.ge_s if - get_local $16 - i32.eqz - if - get_local $0 - get_local $0 - f64.sub - tee_local $0 - get_local $0 - f64.div - return - end - get_local $16 - i32.const 1 - i32.eq - if - f64.const -1 - set_local $13 - end - end - get_local $12 - i32.const 1105199104 - i32.gt_s - if (result f64) - get_local $12 - i32.const 1139802112 - i32.gt_s - if - get_local $4 - i32.const 1072693247 - i32.le_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - end - get_local $4 - i32.const 1072693247 - i32.lt_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.gt_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $2 - f64.const 1 - f64.sub - tee_local $3 - get_local $3 - f64.mul - f64.const 0.5 - get_local $3 - f64.const 0.3333333333333333 - get_local $3 - f64.const 0.25 - f64.mul - f64.sub - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 1.4426950216293335 - get_local $3 - f64.mul - tee_local $15 - get_local $3 - f64.const 1.9259629911266175e-08 - f64.mul - get_local $0 - f64.const 1.4426950408889634 - f64.mul - f64.sub - tee_local $6 - f64.add - set_local $9 - get_local $6 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $15 - f64.sub - f64.sub - else - i32.const 0 - set_local $7 - get_local $4 - i32.const 1048576 - i32.lt_s - if - i32.const -53 - set_local $7 - get_local $2 - f64.const 9007199254740992 - f64.mul - tee_local $2 - i64.reinterpret/f64 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $4 - end - get_local $7 - get_local $4 + i32.const 52 + i32.const 20 + get_local $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub + tee_local $10 + i32.const 20 + i32.gt_s + tee_local $5 + select + get_local $10 + i32.sub + set_local $8 + get_local $7 + get_local $11 + get_local $5 + select + tee_local $10 + get_local $8 + i32.shr_s + set_local $5 + get_local $5 + get_local $8 + i32.shl + get_local $10 + i32.eq + if + i32.const 2 + get_local $5 + i32.const 1 + i32.and + i32.sub + set_local $16 + end + end + end + end + get_local $7 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $20 + i32.or + if + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 0 + set_local $1 + end + get_local $1 + return + else + get_local $12 + i32.const 0 + i32.ge_s + if (result f64) + f64.const 0 + else + get_local $1 + f64.neg + end + tee_local $0 + return + end + unreachable + else + f64.const nan:0x8000000000000 + return + end + unreachable + end + get_local $11 + i32.const 1072693248 + i32.eq + if + get_local $12 + i32.const 0 + i32.ge_s + if + get_local $0 + return + end + f64.const 1 + get_local $0 + f64.div + return + end + get_local $12 + i32.const 1073741824 + i32.eq + if + get_local $0 + get_local $0 + f64.mul + return + end + get_local $12 + i32.const 1071644672 + i32.eq + if + get_local $18 + i32.const 0 + i32.ge_s + if + get_local $0 + f64.sqrt + return + end + end + end + get_local $0 + f64.abs + set_local $2 + get_local $20 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $5 + i32.eqz + if + get_local $4 + i32.eqz + set_local $5 + end + get_local $5 + i32.eqz + if + get_local $4 + i32.const 1072693248 + i32.eq + set_local $5 + end + get_local $5 + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 1 + get_local $2 + f64.div + set_local $2 + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $16 + i32.or + if + get_local $16 + i32.const 1 + i32.eq + if + get_local $2 + f64.neg + set_local $2 + end + else + get_local $2 + get_local $2 + f64.sub + tee_local $0 + get_local $0 + f64.div + set_local $2 + end + end + get_local $2 + return + end + end + f64.const 1 + set_local $13 + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $16 + i32.eqz + if + get_local $0 + get_local $0 + f64.sub + tee_local $0 + get_local $0 + f64.div + return + end + get_local $16 + i32.const 1 + i32.eq + if + f64.const -1 + set_local $13 + end + end + get_local $11 + i32.const 1105199104 + i32.gt_s + if (result f64) + get_local $11 + i32.const 1139802112 + i32.gt_s + if + get_local $4 + i32.const 1072693247 + i32.le_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + end + get_local $4 + i32.const 1072693247 + i32.lt_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.gt_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $2 + f64.const 1 + f64.sub + tee_local $3 + get_local $3 + f64.mul + f64.const 0.5 + get_local $3 + f64.const 0.3333333333333333 + get_local $3 + f64.const 0.25 + f64.mul + f64.sub + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 1.4426950216293335 + get_local $3 + f64.mul + tee_local $15 + get_local $3 + f64.const 1.9259629911266175e-08 + f64.mul + get_local $0 + f64.const 1.4426950408889634 + f64.mul + f64.sub + tee_local $6 + f64.add + set_local $9 + get_local $6 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $15 + f64.sub + f64.sub + else + i32.const 0 + set_local $7 + get_local $4 + i32.const 1048576 + i32.lt_s + if + i32.const -53 + set_local $7 + get_local $2 + f64.const 9007199254740992 + f64.mul + tee_local $2 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $4 + end + get_local $4 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + get_local $7 + i32.add + set_local $7 + get_local $4 + i32.const 1048575 + i32.and + tee_local $5 + i32.const 1072693248 + i32.or + set_local $4 + get_local $5 + i32.const 235662 + i32.le_s + if (result i32) + i32.const 0 + else + get_local $5 + i32.const 767610 + i32.lt_s + if (result i32) + i32.const 1 + else + get_local $7 + i32.const 1 i32.add set_local $7 get_local $4 - i32.const 1048575 - i32.and - tee_local $5 - i32.const 1072693248 - i32.or + i32.const -1048576 + i32.add set_local $4 - get_local $5 - i32.const 235662 - i32.le_s - if (result i32) - i32.const 0 - else - get_local $5 - i32.const 767610 - i32.lt_s - if (result i32) - i32.const 1 - else - get_local $7 - i32.const 1 - i32.add - set_local $7 - get_local $4 - i32.const -1048576 - i32.add - set_local $4 - i32.const 0 - end - end - set_local $10 - get_local $2 - i64.reinterpret/f64 - i64.const 4294967295 - i64.and - get_local $4 - i64.extend_s/i32 - i64.const 32 - i64.shl - i64.or - f64.reinterpret/i64 - tee_local $2 - f64.const 1.5 - f64.const 1 - get_local $10 - select - tee_local $0 - f64.sub - tee_local $15 - f64.const 1 - get_local $2 - get_local $0 - f64.add - f64.div - tee_local $6 - f64.mul - set_local $9 - get_local $2 - get_local $4 - i32.const 1 - i32.shr_s - i32.const 536870912 - i32.or - i32.const 524288 - i32.add - get_local $10 - i32.const 18 - i32.shl - i32.add - i64.extend_s/i32 - i64.const 32 - i64.shl - f64.reinterpret/i64 - tee_local $3 - get_local $0 - f64.sub - f64.sub - set_local $2 - get_local $9 - get_local $9 - f64.mul - tee_local $14 - get_local $14 - f64.mul - f64.const 0.5999999999999946 - get_local $14 - f64.const 0.4285714285785502 - get_local $14 - f64.const 0.33333332981837743 - get_local $14 - f64.const 0.272728123808534 - get_local $14 - f64.const 0.23066074577556175 - get_local $14 - f64.const 0.20697501780033842 - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - set_local $19 - get_local $6 - get_local $15 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $3 - f64.mul - f64.sub - get_local $6 - get_local $2 - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 3 - get_local $6 - get_local $6 - f64.mul - tee_local $14 - f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $9 - f64.add - f64.mul - f64.add - tee_local $19 - f64.add - set_local $3 - get_local $19 - get_local $3 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $3 - f64.const 3 - f64.sub - get_local $14 - f64.sub - f64.sub - set_local $2 - get_local $6 - get_local $3 - f64.mul - tee_local $15 - get_local $0 - get_local $3 - f64.mul - get_local $2 - get_local $9 - f64.mul - f64.add - tee_local $6 - f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $15 - f64.sub - f64.sub - set_local $6 - f64.const 0.9617967009544373 - get_local $0 - f64.mul - tee_local $19 - f64.const -7.028461650952758e-09 - get_local $0 - f64.mul - get_local $6 - f64.const 0.9617966939259756 - f64.mul - f64.add - f64.const 1.350039202129749e-08 - f64.const 0 - get_local $10 - select - f64.add - tee_local $2 - f64.add - f64.const 0.5849624872207642 - f64.const 0 - get_local $10 - select - tee_local $0 - f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 - f64.add - set_local $9 - get_local $2 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $3 - f64.sub - get_local $0 - f64.sub - get_local $19 - f64.sub - f64.sub + i32.const 0 end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - f64.sub - get_local $9 - f64.mul - get_local $1 - get_local $2 - f64.mul - f64.add - tee_local $6 - get_local $0 - get_local $9 - f64.mul - tee_local $0 - f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $8 + end + set_local $10 + get_local $2 + i64.reinterpret/f64 + i64.const 4294967295 + i64.and + get_local $4 + i64.extend_s/i32 + i64.const 32 + i64.shl + i64.or + f64.reinterpret/i64 + tee_local $2 + f64.const 1.5 + f64.const 1 + get_local $10 + select + tee_local $0 + f64.sub + tee_local $15 + f64.const 1 + get_local $2 + get_local $0 + f64.add + f64.div + tee_local $6 + f64.mul + set_local $9 + get_local $2 + get_local $4 + i32.const 1 + i32.shr_s + i32.const 536870912 + i32.or + i32.const 524288 + i32.add + get_local $10 + i32.const 18 + i32.shl + i32.add + i64.extend_s/i32 + i64.const 32 + i64.shl + f64.reinterpret/i64 + tee_local $3 + get_local $0 + f64.sub + f64.sub + set_local $2 + get_local $9 + get_local $9 + f64.mul + tee_local $14 + get_local $14 + f64.mul + f64.const 0.5999999999999946 + get_local $14 + f64.const 0.4285714285785502 + get_local $14 + f64.const 0.33333332981837743 + get_local $14 + f64.const 0.272728123808534 + get_local $14 + f64.const 0.23066074577556175 + get_local $14 + f64.const 0.20697501780033842 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + set_local $19 + get_local $6 + get_local $15 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $6 + get_local $3 + f64.mul + f64.sub + get_local $6 + get_local $2 + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 3 + get_local $6 + get_local $6 + f64.mul + tee_local $14 + f64.add + get_local $19 + get_local $0 + get_local $6 + get_local $9 + f64.add + f64.mul + f64.add + tee_local $19 + f64.add + set_local $3 + get_local $19 + get_local $3 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $3 + f64.const 3 + f64.sub + get_local $14 + f64.sub + f64.sub + set_local $2 + get_local $6 + get_local $3 + f64.mul + tee_local $15 + get_local $0 + get_local $3 + f64.mul + get_local $2 + get_local $9 + f64.mul + f64.add + tee_local $6 + f64.add + set_local $0 + get_local $6 + get_local $0 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + get_local $15 + f64.sub + f64.sub + set_local $6 + f64.const 0.9617967009544373 + get_local $0 + f64.mul + tee_local $19 + f64.const -7.028461650952758e-09 + get_local $0 + f64.mul + get_local $6 + f64.const 0.9617966939259756 + f64.mul + f64.add + f64.const 1.350039202129749e-08 + f64.const 0 + get_local $10 + select + f64.add + tee_local $2 + f64.add + f64.const 0.5849624872207642 + f64.const 0 + get_local $10 + select + tee_local $0 + f64.add + get_local $7 + f64.convert_s/i32 + tee_local $3 + f64.add + set_local $9 + get_local $2 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $3 + f64.sub + get_local $0 + f64.sub + get_local $19 + f64.sub + f64.sub + end + set_local $2 + get_local $1 + get_local $1 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + f64.sub + get_local $9 + f64.mul + get_local $1 + get_local $2 + f64.mul + f64.add + tee_local $6 + get_local $0 + get_local $9 + f64.mul + tee_local $0 + f64.add + tee_local $2 + i64.reinterpret/f64 + tee_local $17 + i32.wrap/i64 + set_local $8 + block $folding-inner1 + block $folding-inner0 get_local $17 i64.const 32 i64.shr_u @@ -3565,7 +3567,7 @@ i32.sub get_local $8 i32.or - br_if $folding-inner1 + br_if $folding-inner0 get_local $6 f64.const 8.008566259537294e-17 f64.add @@ -3573,7 +3575,7 @@ get_local $0 f64.sub f64.gt - br_if $folding-inner1 + br_if $folding-inner0 else get_local $5 i32.const 2147483647 @@ -3586,13 +3588,13 @@ i32.sub get_local $8 i32.or - br_if $folding-inner0 + br_if $folding-inner1 get_local $6 get_local $2 get_local $0 f64.sub f64.le - br_if $folding-inner0 + br_if $folding-inner1 end end get_local $5 @@ -3610,12 +3612,12 @@ i32.const 1071644672 i32.gt_s if - get_local $5 i32.const 1048576 get_local $10 i32.const 1 i32.add i32.shr_s + get_local $5 i32.add tee_local $7 i32.const 2147483647 @@ -3625,12 +3627,12 @@ i32.const 1023 i32.sub set_local $10 - get_local $7 i32.const 1048575 get_local $10 i32.shr_s i32.const -1 i32.xor + get_local $7 i32.and i64.extend_s/i32 i64.const 32 @@ -3768,16 +3770,16 @@ return end get_local $13 - f64.const 1e-300 + f64.const 1.e+300 f64.mul - f64.const 1e-300 + f64.const 1.e+300 f64.mul return end get_local $13 - f64.const 1.e+300 + f64.const 1e-300 f64.mul - f64.const 1.e+300 + f64.const 1e-300 f64.mul ) (func $std/libm/pow (; 44 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 631729f9..cd6762df 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -191,24 +191,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -293,12 +293,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -420,9 +420,9 @@ (func $~lib/map/Map#find (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -541,7 +541,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 i32.load8_s i32.const -2128831035 @@ -552,6 +551,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -675,9 +675,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -863,14 +863,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -950,9 +949,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -966,14 +963,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -1027,9 +1023,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1043,14 +1037,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -1106,9 +1099,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1212,7 +1203,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 i32.load8_u i32.const -2128831035 @@ -1223,6 +1213,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -1344,9 +1335,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -1524,14 +1515,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -1605,9 +1595,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1621,14 +1609,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -1680,9 +1667,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1696,14 +1681,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -1757,9 +1741,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1789,9 +1771,9 @@ (func $~lib/map/Map#find (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -1920,7 +1902,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $5 get_local $2 i32.load16_s tee_local $4 @@ -1940,6 +1921,7 @@ i32.and i32.const 2 i32.shl + get_local $5 i32.add tee_local $4 i32.load offset=8 @@ -2072,9 +2054,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -2279,14 +2261,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -2366,9 +2347,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2382,14 +2361,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -2443,9 +2421,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2459,14 +2435,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -2522,9 +2497,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2638,7 +2611,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $5 get_local $2 i32.load16_u tee_local $4 @@ -2658,6 +2630,7 @@ i32.and i32.const 2 i32.shl + get_local $5 i32.add tee_local $4 i32.load offset=8 @@ -2788,9 +2761,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -2987,14 +2960,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3068,9 +3040,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3084,14 +3054,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3143,9 +3112,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3159,14 +3126,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3220,9 +3186,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3283,9 +3247,9 @@ (func $~lib/map/Map#find (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -3395,7 +3359,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 i32.load call $~lib/internal/hash/hash32 @@ -3403,6 +3366,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -3517,9 +3481,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -3684,14 +3648,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3759,9 +3722,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3775,14 +3736,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3832,9 +3792,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3848,14 +3806,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -3907,9 +3864,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4011,14 +3966,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -4086,9 +4040,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4102,14 +4054,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -4159,9 +4110,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4175,14 +4124,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -4234,9 +4182,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4382,9 +4328,9 @@ (func $~lib/map/Map#find (; 45 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -4494,7 +4440,6 @@ i32.load offset=8 i32.store offset=8 get_local $3 - get_local $4 get_local $2 i64.load call $~lib/internal/hash/hash64 @@ -4502,6 +4447,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -4616,9 +4562,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -4786,14 +4732,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i64.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i64.const 100 - i64.ge_s - br_if $break|1 + i64.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i64.const 100 + i64.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -4864,9 +4809,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4880,14 +4823,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i64.const 50 - i64.ge_s - br_if $break|2 + i64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i64.const 50 + i64.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -4938,9 +4880,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4954,14 +4894,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i64.const 50 - i64.ge_s - br_if $break|3 + i64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i64.const 50 + i64.lt_s + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5014,9 +4953,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5120,14 +5057,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i64.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - i64.const 100 - i64.ge_u - br_if $break|1 + i64.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + i64.const 100 + i64.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5198,9 +5134,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5214,14 +5148,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i64.const 50 - i64.ge_u - br_if $break|2 + i64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i64.const 50 + i64.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5272,9 +5205,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5288,14 +5219,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i64.const 50 - i64.ge_u - br_if $break|3 + i64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i64.const 50 + i64.lt_u + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5348,9 +5278,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5380,9 +5308,9 @@ (func $~lib/map/Map#find (; 53 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -5493,7 +5421,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 f32.load i32.reinterpret/f32 @@ -5502,6 +5429,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -5617,9 +5545,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -5789,15 +5717,13 @@ call $~lib/env/abort unreachable end - block $break|1 - f32.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - f32.const 100 - f32.lt - i32.eqz - br_if $break|1 + f32.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + f32.const 100 + f32.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5868,9 +5794,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5884,15 +5808,13 @@ call $~lib/env/abort unreachable end - block $break|2 - f32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - f32.const 50 - f32.lt - i32.eqz - br_if $break|2 + f32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + f32.const 50 + f32.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -5943,9 +5865,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5959,15 +5879,13 @@ call $~lib/env/abort unreachable end - block $break|3 - f32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - f32.const 50 - f32.lt - i32.eqz - br_if $break|3 + f32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + f32.const 50 + f32.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -6020,9 +5938,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -6052,9 +5968,9 @@ (func $~lib/map/Map#find (; 60 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -6165,7 +6081,6 @@ i32.load offset=8 i32.store offset=8 get_local $3 - get_local $4 get_local $2 f64.load i64.reinterpret/f64 @@ -6174,6 +6089,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -6289,9 +6205,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -6461,15 +6377,13 @@ call $~lib/env/abort unreachable end - block $break|1 - f64.const 0 - set_local $0 - loop $repeat|1 - get_local $0 - f64.const 100 - f64.lt - i32.eqz - br_if $break|1 + f64.const 0 + set_local $0 + loop $repeat|1 + get_local $0 + f64.const 100 + f64.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -6540,9 +6454,7 @@ br $repeat|1 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -6556,15 +6468,13 @@ call $~lib/env/abort unreachable end - block $break|2 - f64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - f64.const 50 - f64.lt - i32.eqz - br_if $break|2 + f64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + f64.const 50 + f64.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -6615,9 +6525,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -6631,15 +6539,13 @@ call $~lib/env/abort unreachable end - block $break|3 - f64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - f64.const 50 - f64.lt - i32.eqz - br_if $break|3 + f64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + f64.const 50 + f64.lt + if get_local $1 get_local $0 call $~lib/map/Map#has @@ -6692,9 +6598,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index eb6393e1..70a8e2e0 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -580,12 +580,12 @@ i32.const 1072693248 i32.ge_u if - get_local $2 - i32.const 1072693248 - i32.sub get_local $0 i64.reinterpret/f64 i32.wrap/i64 + get_local $2 + i32.const 1072693248 + i32.sub i32.or i32.eqz if @@ -1007,6 +1007,9 @@ f64.const 0 end set_local $4 + get_local $7 + i64.const 4294967295 + i64.and get_local $5 i32.const 1048575 i32.and @@ -1015,9 +1018,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $7 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -1178,7 +1178,6 @@ end end end - get_local $3 get_local $1 i32.const 614242 i32.add @@ -1187,8 +1186,12 @@ i32.shr_s i32.const 1023 i32.sub + get_local $3 i32.add set_local $3 + get_local $4 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -1197,9 +1200,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $4 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -1585,7 +1585,6 @@ end end end - get_local $3 get_local $1 i32.const 4913933 i32.add @@ -1594,6 +1593,7 @@ i32.shr_s i32.const 127 i32.sub + get_local $3 i32.add set_local $3 get_local $1 @@ -1729,12 +1729,12 @@ i32.const 1072693248 i32.ge_u if - get_local $2 - i32.const 1072693248 - i32.sub get_local $0 i64.reinterpret/f64 i32.wrap/i64 + get_local $2 + i32.const 1072693248 + i32.sub i32.or i32.eqz if @@ -2751,105 +2751,105 @@ (local $5 i32) (local $6 i64) (local $7 i32) - block $folding-inner0 - get_local $1 - get_local $1 - f64.ne - tee_local $2 - i32.eqz - if - get_local $0 - get_local $0 - f64.ne - set_local $2 - end - get_local $2 - if - get_local $1 - get_local $0 - f64.add - return - end - get_local $1 - i64.reinterpret/f64 - tee_local $6 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $6 - i32.wrap/i64 - set_local $2 + get_local $1 + get_local $1 + f64.ne + tee_local $2 + i32.eqz + if get_local $0 - i64.reinterpret/f64 - tee_local $6 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $6 - i32.wrap/i64 - set_local $7 - get_local $4 - i32.const 1072693248 - i32.sub - get_local $2 - i32.or - i32.eqz - if - get_local $0 - call $~lib/math/NativeMath.atan - return - end - get_local $5 - i32.const 31 - i32.shr_u - get_local $4 - i32.const 30 - i32.shr_u - i32.const 2 - i32.and - i32.or - set_local $3 - get_local $4 - i32.const 2147483647 - i32.and - set_local $4 - get_local $5 - i32.const 2147483647 - i32.and - tee_local $5 - get_local $7 - i32.or - i32.eqz - if - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 + get_local $0 + f64.ne + set_local $2 + end + get_local $2 + if + get_local $1 + get_local $0 + f64.add + return + end + get_local $1 + i64.reinterpret/f64 + tee_local $6 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $4 + get_local $6 + i32.wrap/i64 + set_local $2 + get_local $0 + i64.reinterpret/f64 + tee_local $6 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $5 + get_local $6 + i32.wrap/i64 + set_local $7 + get_local $4 + i32.const 1072693248 + i32.sub + get_local $2 + i32.or + i32.eqz + if + get_local $0 + call $~lib/math/NativeMath.atan + return + end + get_local $4 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + get_local $5 + i32.const 31 + i32.shr_u + i32.or + set_local $3 + get_local $4 + i32.const 2147483647 + i32.and + set_local $4 + get_local $7 + get_local $5 + i32.const 2147483647 + i32.and + tee_local $5 + i32.or + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + get_local $3 + i32.eqz + br_if $case1|0 + block $tablify|0 get_local $3 - i32.eqz - br_if $case1|0 - block $tablify|0 - get_local $3 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end - br $break|0 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 end - get_local $0 - return + br $break|0 end - f64.const 3.141592653589793 + get_local $0 return end - f64.const -3.141592653589793 + f64.const 3.141592653589793 return end + f64.const -3.141592653589793 + return end - get_local $4 + end + block $folding-inner0 get_local $2 + get_local $4 i32.or i32.eqz br_if $folding-inner0 @@ -3019,83 +3019,83 @@ (local $3 i32) (local $4 i32) (local $5 i32) - block $folding-inner0 - get_local $1 - get_local $1 - f32.ne - tee_local $2 - i32.eqz - if - get_local $0 - get_local $0 - f32.ne - set_local $2 - end - get_local $2 - if - get_local $1 - get_local $0 - f32.add - return - end + get_local $1 + get_local $1 + f32.ne + tee_local $2 + i32.eqz + if get_local $0 - i32.reinterpret/f32 - set_local $4 + get_local $0 + f32.ne + set_local $2 + end + get_local $2 + if get_local $1 - i32.reinterpret/f32 - tee_local $5 - i32.const 1065353216 - i32.eq - if - get_local $0 - call $~lib/math/NativeMathf.atan - return - end - get_local $4 - i32.const 31 - i32.shr_u - get_local $5 - i32.const 30 - i32.shr_u - i32.const 2 - i32.and - i32.or - set_local $3 - get_local $5 - i32.const 2147483647 - i32.and - set_local $5 - get_local $4 - i32.const 2147483647 - i32.and - tee_local $4 - i32.eqz - if - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 + get_local $0 + f32.add + return + end + get_local $0 + i32.reinterpret/f32 + set_local $4 + get_local $1 + i32.reinterpret/f32 + tee_local $5 + i32.const 1065353216 + i32.eq + if + get_local $0 + call $~lib/math/NativeMathf.atan + return + end + get_local $5 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + get_local $4 + i32.const 31 + i32.shr_u + i32.or + set_local $3 + get_local $5 + i32.const 2147483647 + i32.and + set_local $5 + get_local $4 + i32.const 2147483647 + i32.and + tee_local $4 + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + get_local $3 + i32.eqz + br_if $case1|0 + block $tablify|0 get_local $3 - i32.eqz - br_if $case1|0 - block $tablify|0 - get_local $3 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end - br $break|0 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 end - get_local $0 - return + br $break|0 end - f32.const 3.1415927410125732 + get_local $0 return end - f32.const -3.1415927410125732 + f32.const 3.1415927410125732 return end + f32.const -3.1415927410125732 + return end + end + block $folding-inner0 get_local $5 i32.eqz br_if $folding-inner0 @@ -3438,10 +3438,10 @@ i32.add end set_local $3 + get_local $3 get_local $5 i32.const -2147483648 i32.and - get_local $3 i32.or f32.reinterpret/i32 f64.promote/f32 @@ -5009,7 +5009,6 @@ end end end - get_local $4 get_local $1 i32.const 614242 i32.add @@ -5018,8 +5017,12 @@ i32.shr_u i32.const 1023 i32.sub + get_local $4 i32.add set_local $4 + get_local $5 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -5028,9 +5031,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $5 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -5222,7 +5222,6 @@ end end end - get_local $2 get_local $1 i32.const 4913933 i32.add @@ -5231,6 +5230,7 @@ i32.shr_u i32.const 127 i32.sub + get_local $2 i32.add set_local $2 get_local $1 @@ -5438,7 +5438,6 @@ end end end - get_local $5 get_local $1 i32.const 614242 i32.add @@ -5447,8 +5446,12 @@ i32.shr_u i32.const 1023 i32.sub + get_local $5 i32.add set_local $5 + get_local $6 + i64.const 4294967295 + i64.and get_local $1 i32.const 1048575 i32.and @@ -5457,9 +5460,6 @@ i64.extend_u/i32 i64.const 32 i64.shl - get_local $6 - i64.const 4294967295 - i64.and i64.or f64.reinterpret/i64 f64.const 1 @@ -5646,7 +5646,6 @@ end end end - get_local $2 get_local $1 i32.const 4913933 i32.add @@ -5655,6 +5654,7 @@ i32.shr_u i32.const 127 i32.sub + get_local $2 i32.add set_local $2 get_local $1 @@ -5803,59 +5803,59 @@ (local $7 i64) (local $8 i64) (local $9 i64) - block $folding-inner0 - get_local $0 - i64.reinterpret/f64 - tee_local $2 - i64.const 52 - i64.shr_u + get_local $0 + i64.reinterpret/f64 + tee_local $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + set_local $4 + get_local $1 + i64.reinterpret/f64 + tee_local $3 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + set_local $5 + get_local $2 + i64.const 63 + i64.shr_u + set_local $8 + get_local $3 + i64.const 1 + i64.shl + tee_local $7 + i64.const 0 + i64.eq + tee_local $6 + i32.eqz + if + get_local $4 i64.const 2047 - i64.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $3 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - set_local $5 - get_local $2 - i64.const 63 - i64.shr_u - set_local $8 - get_local $3 - i64.const 1 - i64.shl - tee_local $7 - i64.const 0 i64.eq - tee_local $6 - i32.eqz - if - get_local $4 - i64.const 2047 - i64.eq - set_local $6 - end - get_local $6 - i32.eqz - if - get_local $1 - get_local $1 - f64.ne - set_local $6 - end - get_local $6 - if - get_local $0 - get_local $1 - f64.mul - tee_local $0 - get_local $0 - f64.div - return - end + set_local $6 + end + get_local $6 + i32.eqz + if + get_local $1 + get_local $1 + f64.ne + set_local $6 + end + get_local $6 + if + get_local $0 + get_local $1 + f64.mul + tee_local $0 + get_local $0 + f64.div + return + end + block $folding-inner0 get_local $2 i64.const 1 i64.shl @@ -5863,8 +5863,8 @@ get_local $7 i64.le_u if - get_local $9 get_local $7 + get_local $9 i64.eq br_if $folding-inner0 get_local $0 @@ -6030,58 +6030,58 @@ (local $6 i32) (local $7 i32) (local $8 i32) - block $folding-inner0 - get_local $0 - i32.reinterpret/f32 - tee_local $2 - i32.const 23 - i32.shr_u + get_local $0 + i32.reinterpret/f32 + tee_local $2 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + set_local $3 + get_local $1 + i32.reinterpret/f32 + tee_local $4 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + set_local $6 + get_local $2 + i32.const -2147483648 + i32.and + set_local $8 + get_local $4 + i32.const 1 + i32.shl + tee_local $7 + i32.eqz + tee_local $5 + i32.eqz + if + get_local $3 i32.const 255 - i32.and - set_local $3 + i32.eq + set_local $5 + end + get_local $5 + i32.eqz + if get_local $1 - i32.reinterpret/f32 - tee_local $4 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - set_local $6 - get_local $2 - i32.const -2147483648 - i32.and - set_local $8 - get_local $4 - i32.const 1 - i32.shl - tee_local $7 - i32.eqz - tee_local $5 - i32.eqz - if - get_local $3 - i32.const 255 - i32.eq - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $1 - get_local $1 - f32.ne - set_local $5 - end - get_local $5 - if - get_local $0 - get_local $1 - f32.mul - tee_local $0 - get_local $0 - f32.div - return - end + get_local $1 + f32.ne + set_local $5 + end + get_local $5 + if + get_local $0 + get_local $1 + f32.mul + tee_local $0 + get_local $0 + f32.div + return + end + block $folding-inner0 get_local $2 i32.const 1 i32.shl @@ -6188,6 +6188,7 @@ tee_local $5 i32.shl set_local $2 + get_local $8 get_local $3 get_local $5 i32.sub @@ -6210,7 +6211,6 @@ i32.shr_u end tee_local $2 - get_local $8 i32.or f32.reinterpret/i32 return @@ -6247,718 +6247,720 @@ (local $18 i32) (local $19 f64) (local $20 i32) - block $folding-inner1 - block $folding-inner0 - get_local $0 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 - i32.const 2147483647 - i32.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - tee_local $11 - i32.const 2147483647 - i32.and - tee_local $12 - get_local $17 - i32.wrap/i64 - tee_local $7 - i32.or - i32.eqz - if - f64.const 1 - return - end - get_local $4 - i32.const 2146435072 - i32.gt_s - tee_local $8 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $20 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.gt_s - set_local $8 - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $7 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - if - get_local $0 - get_local $1 - f64.add - return - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $12 - i32.const 1128267776 - i32.ge_s - if - i32.const 2 - set_local $16 - else - get_local $12 - i32.const 1072693248 - i32.ge_s - if - i32.const 52 - i32.const 20 - get_local $12 - i32.const 20 - i32.shr_s - i32.const 1023 - i32.sub - tee_local $10 - i32.const 20 - i32.gt_s - tee_local $5 - select - get_local $10 - i32.sub - set_local $8 - get_local $7 - get_local $12 - get_local $5 - select - tee_local $10 - get_local $8 - i32.shr_s - tee_local $5 - get_local $8 - i32.shl - get_local $10 - i32.eq - if - i32.const 2 - get_local $5 - i32.const 1 - i32.and - i32.sub - set_local $16 - end - end - end - end - get_local $7 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $20 - i32.or - if - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 0 - set_local $1 - end - get_local $1 - return - else - get_local $11 - i32.const 0 - i32.ge_s - if (result f64) - f64.const 0 - else - get_local $1 - f64.neg - end - tee_local $0 - return - end - unreachable - else - f64.const nan:0x8000000000000 - return - end - unreachable - end - get_local $12 - i32.const 1072693248 - i32.eq - if - get_local $11 - i32.const 0 - i32.ge_s - if - get_local $0 - return - end - f64.const 1 - get_local $0 - f64.div - return - end - get_local $11 - i32.const 1073741824 - i32.eq - if - get_local $0 - get_local $0 - f64.mul - return - end - get_local $11 - i32.const 1071644672 - i32.eq - if - get_local $18 - i32.const 0 - i32.ge_s - if - get_local $0 - f64.sqrt - return - end - end - end - get_local $0 - f64.abs - set_local $2 + get_local $0 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $18 + get_local $17 + i32.wrap/i64 + set_local $20 + get_local $18 + i32.const 2147483647 + i32.and + set_local $4 + get_local $1 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $12 + i32.const 2147483647 + i32.and + set_local $11 + get_local $11 + get_local $17 + i32.wrap/i64 + tee_local $7 + i32.or + i32.eqz + if + f64.const 1 + return + end + get_local $4 + i32.const 2146435072 + i32.gt_s + tee_local $8 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $8 + if get_local $20 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $5 - i32.eqz - if - get_local $4 - i32.eqz - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $4 - i32.const 1072693248 - i32.eq - set_local $5 - end - get_local $5 - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 1 - get_local $2 - f64.div - set_local $2 - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $16 - i32.or - if - get_local $16 - i32.const 1 - i32.eq - if - get_local $2 - f64.neg - set_local $2 - end - else - get_local $2 - get_local $2 - f64.sub - tee_local $0 - get_local $0 - f64.div - set_local $2 - end - end - get_local $2 - return - end - end - f64.const 1 - set_local $13 - get_local $18 i32.const 0 - i32.lt_s + i32.ne + set_local $8 + end + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.gt_s + set_local $8 + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + tee_local $8 + if + get_local $7 + i32.const 0 + i32.ne + set_local $8 + end + end + get_local $8 + if + get_local $0 + get_local $1 + f64.add + return + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $11 + i32.const 1128267776 + i32.ge_s + if + i32.const 2 + set_local $16 + else + get_local $11 + i32.const 1072693248 + i32.ge_s if - get_local $16 - i32.eqz - if - get_local $0 - get_local $0 - f64.sub - tee_local $0 - get_local $0 - f64.div - return - end - get_local $16 - i32.const 1 - i32.eq - if - f64.const -1 - set_local $13 - end - end - get_local $12 - i32.const 1105199104 - i32.gt_s - if (result f64) - get_local $12 - i32.const 1139802112 - i32.gt_s - if - get_local $4 - i32.const 1072693247 - i32.le_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - end - get_local $4 - i32.const 1072693247 - i32.lt_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.gt_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $2 - f64.const 1 - f64.sub - tee_local $3 - get_local $3 - f64.mul - f64.const 0.5 - get_local $3 - f64.const 0.3333333333333333 - get_local $3 - f64.const 0.25 - f64.mul - f64.sub - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 1.4426950216293335 - get_local $3 - f64.mul - tee_local $15 - get_local $3 - f64.const 1.9259629911266175e-08 - f64.mul - get_local $0 - f64.const 1.4426950408889634 - f64.mul - f64.sub - tee_local $6 - f64.add - set_local $9 - get_local $6 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $15 - f64.sub - f64.sub - else - i32.const 0 - set_local $7 - get_local $4 - i32.const 1048576 - i32.lt_s - if - i32.const -53 - set_local $7 - get_local $2 - f64.const 9007199254740992 - f64.mul - tee_local $2 - i64.reinterpret/f64 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $4 - end - get_local $7 - get_local $4 + i32.const 52 + i32.const 20 + get_local $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub + tee_local $10 + i32.const 20 + i32.gt_s + tee_local $5 + select + get_local $10 + i32.sub + set_local $8 + get_local $7 + get_local $11 + get_local $5 + select + tee_local $10 + get_local $8 + i32.shr_s + set_local $5 + get_local $5 + get_local $8 + i32.shl + get_local $10 + i32.eq + if + i32.const 2 + get_local $5 + i32.const 1 + i32.and + i32.sub + set_local $16 + end + end + end + end + get_local $7 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $20 + i32.or + if + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 0 + set_local $1 + end + get_local $1 + return + else + get_local $12 + i32.const 0 + i32.ge_s + if (result f64) + f64.const 0 + else + get_local $1 + f64.neg + end + tee_local $0 + return + end + unreachable + else + f64.const nan:0x8000000000000 + return + end + unreachable + end + get_local $11 + i32.const 1072693248 + i32.eq + if + get_local $12 + i32.const 0 + i32.ge_s + if + get_local $0 + return + end + f64.const 1 + get_local $0 + f64.div + return + end + get_local $12 + i32.const 1073741824 + i32.eq + if + get_local $0 + get_local $0 + f64.mul + return + end + get_local $12 + i32.const 1071644672 + i32.eq + if + get_local $18 + i32.const 0 + i32.ge_s + if + get_local $0 + f64.sqrt + return + end + end + end + get_local $0 + f64.abs + set_local $2 + get_local $20 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $5 + i32.eqz + if + get_local $4 + i32.eqz + set_local $5 + end + get_local $5 + i32.eqz + if + get_local $4 + i32.const 1072693248 + i32.eq + set_local $5 + end + get_local $5 + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 1 + get_local $2 + f64.div + set_local $2 + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $16 + i32.or + if + get_local $16 + i32.const 1 + i32.eq + if + get_local $2 + f64.neg + set_local $2 + end + else + get_local $2 + get_local $2 + f64.sub + tee_local $0 + get_local $0 + f64.div + set_local $2 + end + end + get_local $2 + return + end + end + f64.const 1 + set_local $13 + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $16 + i32.eqz + if + get_local $0 + get_local $0 + f64.sub + tee_local $0 + get_local $0 + f64.div + return + end + get_local $16 + i32.const 1 + i32.eq + if + f64.const -1 + set_local $13 + end + end + get_local $11 + i32.const 1105199104 + i32.gt_s + if (result f64) + get_local $11 + i32.const 1139802112 + i32.gt_s + if + get_local $4 + i32.const 1072693247 + i32.le_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + end + get_local $4 + i32.const 1072693247 + i32.lt_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.gt_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $2 + f64.const 1 + f64.sub + tee_local $3 + get_local $3 + f64.mul + f64.const 0.5 + get_local $3 + f64.const 0.3333333333333333 + get_local $3 + f64.const 0.25 + f64.mul + f64.sub + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 1.4426950216293335 + get_local $3 + f64.mul + tee_local $15 + get_local $3 + f64.const 1.9259629911266175e-08 + f64.mul + get_local $0 + f64.const 1.4426950408889634 + f64.mul + f64.sub + tee_local $6 + f64.add + set_local $9 + get_local $6 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $15 + f64.sub + f64.sub + else + i32.const 0 + set_local $7 + get_local $4 + i32.const 1048576 + i32.lt_s + if + i32.const -53 + set_local $7 + get_local $2 + f64.const 9007199254740992 + f64.mul + tee_local $2 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $4 + end + get_local $4 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + get_local $7 + i32.add + set_local $7 + get_local $4 + i32.const 1048575 + i32.and + tee_local $5 + i32.const 1072693248 + i32.or + set_local $4 + get_local $5 + i32.const 235662 + i32.le_s + if (result i32) + i32.const 0 + else + get_local $5 + i32.const 767610 + i32.lt_s + if (result i32) + i32.const 1 + else + get_local $7 + i32.const 1 i32.add set_local $7 get_local $4 - i32.const 1048575 - i32.and - tee_local $5 - i32.const 1072693248 - i32.or + i32.const -1048576 + i32.add set_local $4 - get_local $5 - i32.const 235662 - i32.le_s - if (result i32) - i32.const 0 - else - get_local $5 - i32.const 767610 - i32.lt_s - if (result i32) - i32.const 1 - else - get_local $7 - i32.const 1 - i32.add - set_local $7 - get_local $4 - i32.const -1048576 - i32.add - set_local $4 - i32.const 0 - end - end - set_local $10 - get_local $2 - i64.reinterpret/f64 - i64.const 4294967295 - i64.and - get_local $4 - i64.extend_s/i32 - i64.const 32 - i64.shl - i64.or - f64.reinterpret/i64 - tee_local $2 - f64.const 1.5 - f64.const 1 - get_local $10 - select - tee_local $0 - f64.sub - tee_local $15 - f64.const 1 - get_local $2 - get_local $0 - f64.add - f64.div - tee_local $6 - f64.mul - set_local $9 - get_local $2 - get_local $4 - i32.const 1 - i32.shr_s - i32.const 536870912 - i32.or - i32.const 524288 - i32.add - get_local $10 - i32.const 18 - i32.shl - i32.add - i64.extend_s/i32 - i64.const 32 - i64.shl - f64.reinterpret/i64 - tee_local $3 - get_local $0 - f64.sub - f64.sub - set_local $2 - get_local $9 - get_local $9 - f64.mul - tee_local $14 - get_local $14 - f64.mul - f64.const 0.5999999999999946 - get_local $14 - f64.const 0.4285714285785502 - get_local $14 - f64.const 0.33333332981837743 - get_local $14 - f64.const 0.272728123808534 - get_local $14 - f64.const 0.23066074577556175 - get_local $14 - f64.const 0.20697501780033842 - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - set_local $19 - get_local $6 - get_local $15 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $3 - f64.mul - f64.sub - get_local $6 - get_local $2 - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 3 - get_local $6 - get_local $6 - f64.mul - tee_local $14 - f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $9 - f64.add - f64.mul - f64.add - tee_local $19 - f64.add - set_local $3 - get_local $19 - get_local $3 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $3 - f64.const 3 - f64.sub - get_local $14 - f64.sub - f64.sub - set_local $2 - get_local $6 - get_local $3 - f64.mul - tee_local $15 - get_local $0 - get_local $3 - f64.mul - get_local $2 - get_local $9 - f64.mul - f64.add - tee_local $6 - f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $15 - f64.sub - f64.sub - set_local $6 - f64.const 0.9617967009544373 - get_local $0 - f64.mul - tee_local $19 - f64.const -7.028461650952758e-09 - get_local $0 - f64.mul - get_local $6 - f64.const 0.9617966939259756 - f64.mul - f64.add - f64.const 1.350039202129749e-08 - f64.const 0 - get_local $10 - select - f64.add - tee_local $2 - f64.add - f64.const 0.5849624872207642 - f64.const 0 - get_local $10 - select - tee_local $0 - f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 - f64.add - set_local $9 - get_local $2 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $3 - f64.sub - get_local $0 - f64.sub - get_local $19 - f64.sub - f64.sub + i32.const 0 end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - f64.sub - get_local $9 - f64.mul - get_local $1 - get_local $2 - f64.mul - f64.add - tee_local $6 - get_local $0 - get_local $9 - f64.mul - tee_local $0 - f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $8 + end + set_local $10 + get_local $2 + i64.reinterpret/f64 + i64.const 4294967295 + i64.and + get_local $4 + i64.extend_s/i32 + i64.const 32 + i64.shl + i64.or + f64.reinterpret/i64 + tee_local $2 + f64.const 1.5 + f64.const 1 + get_local $10 + select + tee_local $0 + f64.sub + tee_local $15 + f64.const 1 + get_local $2 + get_local $0 + f64.add + f64.div + tee_local $6 + f64.mul + set_local $9 + get_local $2 + get_local $4 + i32.const 1 + i32.shr_s + i32.const 536870912 + i32.or + i32.const 524288 + i32.add + get_local $10 + i32.const 18 + i32.shl + i32.add + i64.extend_s/i32 + i64.const 32 + i64.shl + f64.reinterpret/i64 + tee_local $3 + get_local $0 + f64.sub + f64.sub + set_local $2 + get_local $9 + get_local $9 + f64.mul + tee_local $14 + get_local $14 + f64.mul + f64.const 0.5999999999999946 + get_local $14 + f64.const 0.4285714285785502 + get_local $14 + f64.const 0.33333332981837743 + get_local $14 + f64.const 0.272728123808534 + get_local $14 + f64.const 0.23066074577556175 + get_local $14 + f64.const 0.20697501780033842 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + set_local $19 + get_local $6 + get_local $15 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $6 + get_local $3 + f64.mul + f64.sub + get_local $6 + get_local $2 + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 3 + get_local $6 + get_local $6 + f64.mul + tee_local $14 + f64.add + get_local $19 + get_local $0 + get_local $6 + get_local $9 + f64.add + f64.mul + f64.add + tee_local $19 + f64.add + set_local $3 + get_local $19 + get_local $3 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $3 + f64.const 3 + f64.sub + get_local $14 + f64.sub + f64.sub + set_local $2 + get_local $6 + get_local $3 + f64.mul + tee_local $15 + get_local $0 + get_local $3 + f64.mul + get_local $2 + get_local $9 + f64.mul + f64.add + tee_local $6 + f64.add + set_local $0 + get_local $6 + get_local $0 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + get_local $15 + f64.sub + f64.sub + set_local $6 + f64.const 0.9617967009544373 + get_local $0 + f64.mul + tee_local $19 + f64.const -7.028461650952758e-09 + get_local $0 + f64.mul + get_local $6 + f64.const 0.9617966939259756 + f64.mul + f64.add + f64.const 1.350039202129749e-08 + f64.const 0 + get_local $10 + select + f64.add + tee_local $2 + f64.add + f64.const 0.5849624872207642 + f64.const 0 + get_local $10 + select + tee_local $0 + f64.add + get_local $7 + f64.convert_s/i32 + tee_local $3 + f64.add + set_local $9 + get_local $2 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $3 + f64.sub + get_local $0 + f64.sub + get_local $19 + f64.sub + f64.sub + end + set_local $2 + get_local $1 + get_local $1 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + f64.sub + get_local $9 + f64.mul + get_local $1 + get_local $2 + f64.mul + f64.add + tee_local $6 + get_local $0 + get_local $9 + f64.mul + tee_local $0 + f64.add + tee_local $2 + i64.reinterpret/f64 + tee_local $17 + i32.wrap/i64 + set_local $8 + block $folding-inner1 + block $folding-inner0 get_local $17 i64.const 32 i64.shr_u @@ -6972,7 +6974,7 @@ i32.sub get_local $8 i32.or - br_if $folding-inner1 + br_if $folding-inner0 get_local $6 f64.const 8.008566259537294e-17 f64.add @@ -6980,7 +6982,7 @@ get_local $0 f64.sub f64.gt - br_if $folding-inner1 + br_if $folding-inner0 else get_local $5 i32.const 2147483647 @@ -6993,13 +6995,13 @@ i32.sub get_local $8 i32.or - br_if $folding-inner0 + br_if $folding-inner1 get_local $6 get_local $2 get_local $0 f64.sub f64.le - br_if $folding-inner0 + br_if $folding-inner1 end end get_local $5 @@ -7017,12 +7019,12 @@ i32.const 1071644672 i32.gt_s if - get_local $5 i32.const 1048576 get_local $10 i32.const 1 i32.add i32.shr_s + get_local $5 i32.add tee_local $7 i32.const 2147483647 @@ -7032,12 +7034,12 @@ i32.const 1023 i32.sub set_local $10 - get_local $7 i32.const 1048575 get_local $10 i32.shr_s i32.const -1 i32.xor + get_local $7 i32.and i64.extend_s/i32 i64.const 32 @@ -7175,16 +7177,16 @@ return end get_local $13 - f64.const 1e-300 + f64.const 1.e+300 f64.mul - f64.const 1e-300 + f64.const 1.e+300 f64.mul return end get_local $13 - f64.const 1.e+300 + f64.const 1e-300 f64.mul - f64.const 1.e+300 + f64.const 1e-300 f64.mul ) (func $std/math/test_pow (; 118 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) @@ -7225,602 +7227,602 @@ (local $15 f32) (local $16 f32) (local $17 f32) - block $folding-inner1 - block $folding-inner0 - get_local $0 - i32.reinterpret/f32 - tee_local $7 - i32.const 2147483647 - i32.and - set_local $6 - get_local $1 - i32.reinterpret/f32 - tee_local $13 - i32.const 2147483647 - i32.and - tee_local $12 - i32.eqz - if - f32.const 1 - return - end - get_local $6 - i32.const 2139095040 - i32.gt_s - tee_local $5 - i32.eqz - if - get_local $12 - i32.const 2139095040 - i32.gt_s - set_local $5 - end - get_local $5 - if - get_local $0 - get_local $1 - f32.add - return - end - get_local $7 - i32.const 0 - i32.lt_s - if - get_local $12 - i32.const 1266679808 - i32.ge_s - if - i32.const 2 - set_local $4 - else - get_local $12 - i32.const 1065353216 - i32.ge_s - if - get_local $12 - i32.const 150 - get_local $12 - i32.const 23 - i32.shr_s - i32.sub - tee_local $5 - i32.shr_s - tee_local $8 - get_local $5 - i32.shl - get_local $12 - i32.eq - if - i32.const 2 - get_local $8 - i32.const 1 - i32.and - i32.sub - set_local $4 - end - end - end - end - get_local $12 - i32.const 2139095040 - i32.eq - if - get_local $6 - i32.const 1065353216 - i32.eq - if - f32.const nan:0x400000 - return - else - get_local $6 - i32.const 1065353216 - i32.gt_s - if - get_local $13 - i32.const 0 - i32.lt_s - if - f32.const 0 - set_local $1 - end - get_local $1 - return - else - get_local $13 - i32.const 0 - i32.ge_s - if (result f32) - f32.const 0 - else - get_local $1 - f32.neg - end - tee_local $0 - return - end - unreachable - end - unreachable - end + get_local $0 + i32.reinterpret/f32 + tee_local $7 + i32.const 2147483647 + i32.and + set_local $6 + get_local $1 + i32.reinterpret/f32 + tee_local $13 + i32.const 2147483647 + i32.and + tee_local $12 + i32.eqz + if + f32.const 1 + return + end + get_local $6 + i32.const 2139095040 + i32.gt_s + tee_local $5 + i32.eqz + if + get_local $12 + i32.const 2139095040 + i32.gt_s + set_local $5 + end + get_local $5 + if + get_local $0 + get_local $1 + f32.add + return + end + get_local $7 + i32.const 0 + i32.lt_s + if + get_local $12 + i32.const 1266679808 + i32.ge_s + if + i32.const 2 + set_local $4 + else get_local $12 i32.const 1065353216 - i32.eq + i32.ge_s + if + get_local $12 + i32.const 150 + get_local $12 + i32.const 23 + i32.shr_s + i32.sub + tee_local $5 + i32.shr_s + tee_local $8 + get_local $5 + i32.shl + get_local $12 + i32.eq + if + i32.const 2 + get_local $8 + i32.const 1 + i32.and + i32.sub + set_local $4 + end + end + end + end + get_local $12 + i32.const 2139095040 + i32.eq + if + get_local $6 + i32.const 1065353216 + i32.eq + if + f32.const nan:0x400000 + return + else + get_local $6 + i32.const 1065353216 + i32.gt_s if get_local $13 i32.const 0 i32.lt_s if - f32.const 1 - get_local $0 - f32.div - set_local $0 + f32.const 0 + set_local $1 end - get_local $0 + get_local $1 return - end - get_local $13 - i32.const 1073741824 - i32.eq - if - get_local $0 - get_local $0 - f32.mul - return - end - get_local $13 - i32.const 1056964608 - i32.eq - if - get_local $7 + else + get_local $13 i32.const 0 i32.ge_s - if - get_local $0 - f32.sqrt - return + if (result f32) + f32.const 0 + else + get_local $1 + f32.neg end - end - get_local $0 - f32.abs - set_local $2 - get_local $6 - i32.const 2139095040 - i32.eq - tee_local $5 - i32.eqz - if - get_local $6 - i32.eqz - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $6 - i32.const 1065353216 - i32.eq - set_local $5 - end - get_local $5 - if - get_local $13 - i32.const 0 - i32.lt_s - if - f32.const 1 - get_local $2 - f32.div - set_local $2 - end - get_local $7 - i32.const 0 - i32.lt_s - if - get_local $6 - i32.const 1065353216 - i32.sub - get_local $4 - i32.or - if - get_local $4 - i32.const 1 - i32.eq - if - get_local $2 - f32.neg - set_local $2 - end - else - get_local $2 - get_local $2 - f32.sub - tee_local $0 - get_local $0 - f32.div - set_local $2 - end - end - get_local $2 + tee_local $0 return end + unreachable + end + unreachable + end + get_local $12 + i32.const 1065353216 + i32.eq + if + get_local $13 + i32.const 0 + i32.lt_s + if f32.const 1 - set_local $10 - get_local $7 - i32.const 0 - i32.lt_s + get_local $0 + f32.div + set_local $0 + end + get_local $0 + return + end + get_local $13 + i32.const 1073741824 + i32.eq + if + get_local $0 + get_local $0 + f32.mul + return + end + get_local $13 + i32.const 1056964608 + i32.eq + if + get_local $7 + i32.const 0 + i32.ge_s + if + get_local $0 + f32.sqrt + return + end + end + get_local $0 + f32.abs + set_local $2 + get_local $6 + i32.const 2139095040 + i32.eq + tee_local $5 + i32.eqz + if + get_local $6 + i32.eqz + set_local $5 + end + get_local $5 + i32.eqz + if + get_local $6 + i32.const 1065353216 + i32.eq + set_local $5 + end + get_local $5 + if + get_local $13 + i32.const 0 + i32.lt_s + if + f32.const 1 + get_local $2 + f32.div + set_local $2 + end + get_local $7 + i32.const 0 + i32.lt_s + if + get_local $6 + i32.const 1065353216 + i32.sub + get_local $4 + i32.or if - get_local $4 - i32.eqz - if - get_local $0 - get_local $0 - f32.sub - tee_local $0 - get_local $0 - f32.div - return - end get_local $4 i32.const 1 i32.eq if - f32.const -1 - set_local $10 + get_local $2 + f32.neg + set_local $2 end + else + get_local $2 + get_local $2 + f32.sub + tee_local $0 + get_local $0 + f32.div + set_local $2 end - get_local $12 - i32.const 1291845632 + end + get_local $2 + return + end + f32.const 1 + set_local $10 + get_local $7 + i32.const 0 + i32.lt_s + if + get_local $4 + i32.eqz + if + get_local $0 + get_local $0 + f32.sub + tee_local $0 + get_local $0 + f32.div + return + end + get_local $4 + i32.const 1 + i32.eq + if + f32.const -1 + set_local $10 + end + end + get_local $12 + i32.const 1291845632 + i32.gt_s + if (result f32) + get_local $6 + i32.const 1065353208 + i32.lt_s + if + get_local $13 + i32.const 0 + i32.lt_s + if (result f32) + get_local $10 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + else + get_local $10 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + tee_local $0 + return + end + get_local $6 + i32.const 1065353223 + i32.gt_s + if + get_local $13 + i32.const 0 i32.gt_s if (result f32) - get_local $6 - i32.const 1065353208 - i32.lt_s - if - get_local $13 - i32.const 0 - i32.lt_s - if (result f32) - get_local $10 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - get_local $10 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end - tee_local $0 - return - end - get_local $6 - i32.const 1065353223 - i32.gt_s - if - get_local $13 - i32.const 0 - i32.gt_s - if (result f32) - get_local $10 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - get_local $10 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end - tee_local $0 - return - end - get_local $2 - f32.const 1 - f32.sub - tee_local $3 - get_local $3 + get_local $10 + f32.const 1000000015047466219876688e6 f32.mul - f32.const 0.5 - get_local $3 - f32.const 0.3333333432674408 - get_local $3 - f32.const 0.25 + f32.const 1000000015047466219876688e6 f32.mul - f32.sub - f32.mul - f32.sub - f32.mul - set_local $0 - f32.const 1.44268798828125 - get_local $3 - f32.mul - tee_local $15 - get_local $3 - f32.const 7.052607543300837e-06 - f32.mul - get_local $0 - f32.const 1.4426950216293335 - f32.mul - f32.sub - tee_local $16 - f32.add - i32.reinterpret/f32 - set_local $5 - get_local $16 - get_local $5 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $11 - get_local $15 - f32.sub - f32.sub else - i32.const 0 + get_local $10 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + tee_local $0 + return + end + get_local $2 + f32.const 1 + f32.sub + tee_local $3 + get_local $3 + f32.mul + f32.const 0.5 + get_local $3 + f32.const 0.3333333432674408 + get_local $3 + f32.const 0.25 + f32.mul + f32.sub + f32.mul + f32.sub + f32.mul + set_local $0 + f32.const 1.44268798828125 + get_local $3 + f32.mul + tee_local $15 + get_local $3 + f32.const 7.052607543300837e-06 + f32.mul + get_local $0 + f32.const 1.4426950216293335 + f32.mul + f32.sub + tee_local $16 + f32.add + i32.reinterpret/f32 + set_local $5 + get_local $16 + get_local $5 + i32.const -4096 + i32.and + f32.reinterpret/i32 + tee_local $11 + get_local $15 + f32.sub + f32.sub + else + i32.const 0 + set_local $4 + get_local $6 + i32.const 8388608 + i32.lt_s + if + i32.const -24 + set_local $4 + get_local $2 + f32.const 16777216 + f32.mul + i32.reinterpret/f32 + set_local $6 + end + get_local $6 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + get_local $4 + i32.add + set_local $4 + get_local $6 + i32.const 8388607 + i32.and + tee_local $8 + i32.const 1065353216 + i32.or + set_local $6 + get_local $8 + i32.const 1885297 + i32.le_s + if (result i32) + i32.const 0 + else + get_local $8 + i32.const 6140887 + i32.lt_s + if (result i32) + i32.const 1 + else + get_local $4 + i32.const 1 + i32.add set_local $4 get_local $6 i32.const 8388608 - i32.lt_s - if - i32.const -24 - set_local $4 - get_local $2 - f32.const 16777216 - f32.mul - i32.reinterpret/f32 - set_local $6 - end - get_local $4 - get_local $6 - i32.const 23 - i32.shr_s - i32.const 127 i32.sub - i32.add - set_local $4 - get_local $6 - i32.const 8388607 - i32.and - tee_local $8 - i32.const 1065353216 - i32.or set_local $6 - get_local $8 - i32.const 1885297 - i32.le_s - if (result i32) - i32.const 0 - else - get_local $8 - i32.const 6140887 - i32.lt_s - if (result i32) - i32.const 1 - else - get_local $4 - i32.const 1 - i32.add - set_local $4 - get_local $6 - i32.const 8388608 - i32.sub - set_local $6 - i32.const 0 - end - end - set_local $7 - get_local $6 - f32.reinterpret/i32 - tee_local $2 - f32.const 1.5 - f32.const 1 - get_local $7 - select - tee_local $0 - f32.sub - tee_local $15 - f32.const 1 - get_local $2 - get_local $0 - f32.add - f32.div - tee_local $16 - f32.mul - tee_local $9 - i32.reinterpret/f32 - i32.const -4096 - i32.and - f32.reinterpret/i32 - set_local $3 - get_local $2 - get_local $6 - i32.const 1 - i32.shr_s - i32.const -4096 - i32.and - i32.const 536870912 - i32.or - i32.const 4194304 - i32.add - get_local $7 - i32.const 21 - i32.shl - i32.add - f32.reinterpret/i32 - tee_local $11 - get_local $0 - f32.sub - f32.sub - set_local $2 - get_local $9 - get_local $9 - f32.mul - tee_local $14 - get_local $14 - f32.mul - f32.const 0.6000000238418579 - get_local $14 - f32.const 0.4285714328289032 - get_local $14 - f32.const 0.3333333432674408 - get_local $14 - f32.const 0.2727281153202057 - get_local $14 - f32.const 0.23066075146198273 - get_local $14 - f32.const 0.20697501301765442 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.add - f32.mul - set_local $17 - f32.const 3 - get_local $3 - get_local $3 - f32.mul - tee_local $14 - f32.add - get_local $17 - get_local $16 - get_local $15 - get_local $3 - get_local $11 - f32.mul - f32.sub - get_local $3 - get_local $2 - f32.mul - f32.sub - f32.mul - tee_local $0 - get_local $3 - get_local $9 - f32.add - f32.mul - f32.add - tee_local $17 - f32.add - i32.reinterpret/f32 - set_local $5 - get_local $17 - get_local $5 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $11 - f32.const 3 - f32.sub - get_local $14 - f32.sub - f32.sub - set_local $2 - get_local $3 - get_local $11 - f32.mul - tee_local $15 - get_local $0 - get_local $11 - f32.mul - get_local $2 - get_local $9 - f32.mul - f32.add - tee_local $16 - f32.add - i32.reinterpret/f32 - set_local $5 - get_local $16 - get_local $5 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $0 - get_local $15 - f32.sub - f32.sub - set_local $9 - f32.const 0.9619140625 - get_local $0 - f32.mul - tee_local $17 - f32.const -1.1736857413779944e-04 - get_local $0 - f32.mul - get_local $9 - f32.const 0.9617967009544373 - f32.mul - f32.add - f32.const 1.5632208487659227e-06 - f32.const 0 - get_local $7 - select - f32.add - tee_local $2 - f32.add - f32.const 0.5849609375 - f32.const 0 - get_local $7 - select - tee_local $0 - f32.add - get_local $4 - f32.convert_s/i32 - tee_local $3 - f32.add - i32.reinterpret/f32 - set_local $5 - get_local $2 - get_local $5 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $11 - get_local $3 - f32.sub - get_local $0 - f32.sub - get_local $17 - f32.sub - f32.sub + i32.const 0 end - set_local $2 - get_local $1 - get_local $1 - i32.reinterpret/f32 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $0 - f32.sub - get_local $11 - f32.mul - get_local $1 - get_local $2 - f32.mul - f32.add - tee_local $9 - get_local $0 - get_local $11 - f32.mul - tee_local $0 - f32.add - tee_local $2 - i32.reinterpret/f32 - tee_local $8 - i32.const 1124073472 - i32.gt_s - br_if $folding-inner0 + end + set_local $7 + get_local $6 + f32.reinterpret/i32 + tee_local $2 + f32.const 1.5 + f32.const 1 + get_local $7 + select + tee_local $0 + f32.sub + tee_local $15 + f32.const 1 + get_local $2 + get_local $0 + f32.add + f32.div + tee_local $16 + f32.mul + tee_local $9 + i32.reinterpret/f32 + i32.const -4096 + i32.and + f32.reinterpret/i32 + set_local $3 + get_local $2 + get_local $6 + i32.const 1 + i32.shr_s + i32.const -4096 + i32.and + i32.const 536870912 + i32.or + i32.const 4194304 + i32.add + get_local $7 + i32.const 21 + i32.shl + i32.add + f32.reinterpret/i32 + tee_local $11 + get_local $0 + f32.sub + f32.sub + set_local $2 + get_local $9 + get_local $9 + f32.mul + tee_local $14 + get_local $14 + f32.mul + f32.const 0.6000000238418579 + get_local $14 + f32.const 0.4285714328289032 + get_local $14 + f32.const 0.3333333432674408 + get_local $14 + f32.const 0.2727281153202057 + get_local $14 + f32.const 0.23066075146198273 + get_local $14 + f32.const 0.20697501301765442 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + set_local $17 + f32.const 3 + get_local $3 + get_local $3 + f32.mul + tee_local $14 + f32.add + get_local $17 + get_local $16 + get_local $15 + get_local $3 + get_local $11 + f32.mul + f32.sub + get_local $3 + get_local $2 + f32.mul + f32.sub + f32.mul + tee_local $0 + get_local $3 + get_local $9 + f32.add + f32.mul + f32.add + tee_local $17 + f32.add + i32.reinterpret/f32 + set_local $5 + get_local $17 + get_local $5 + i32.const -4096 + i32.and + f32.reinterpret/i32 + tee_local $11 + f32.const 3 + f32.sub + get_local $14 + f32.sub + f32.sub + set_local $2 + get_local $3 + get_local $11 + f32.mul + tee_local $15 + get_local $0 + get_local $11 + f32.mul + get_local $2 + get_local $9 + f32.mul + f32.add + tee_local $16 + f32.add + i32.reinterpret/f32 + set_local $5 + get_local $16 + get_local $5 + i32.const -4096 + i32.and + f32.reinterpret/i32 + tee_local $0 + get_local $15 + f32.sub + f32.sub + set_local $9 + f32.const 0.9619140625 + get_local $0 + f32.mul + tee_local $17 + f32.const -1.1736857413779944e-04 + get_local $0 + f32.mul + get_local $9 + f32.const 0.9617967009544373 + f32.mul + f32.add + f32.const 1.5632208487659227e-06 + f32.const 0 + get_local $7 + select + f32.add + tee_local $2 + f32.add + f32.const 0.5849609375 + f32.const 0 + get_local $7 + select + tee_local $0 + f32.add + get_local $4 + f32.convert_s/i32 + tee_local $3 + f32.add + i32.reinterpret/f32 + set_local $5 + get_local $2 + get_local $5 + i32.const -4096 + i32.and + f32.reinterpret/i32 + tee_local $11 + get_local $3 + f32.sub + get_local $0 + f32.sub + get_local $17 + f32.sub + f32.sub + end + set_local $2 + block $folding-inner1 + get_local $1 + get_local $1 + i32.reinterpret/f32 + i32.const -4096 + i32.and + f32.reinterpret/i32 + tee_local $0 + f32.sub + get_local $11 + f32.mul + get_local $1 + get_local $2 + f32.mul + f32.add + tee_local $9 + get_local $0 + get_local $11 + f32.mul + tee_local $0 + f32.add + tee_local $2 + i32.reinterpret/f32 + tee_local $8 + i32.const 1124073472 + i32.gt_s + br_if $folding-inner1 + block $folding-inner0 get_local $8 i32.const 1124073472 i32.eq @@ -7832,7 +7834,7 @@ get_local $0 f32.sub f32.gt - br_if $folding-inner0 + br_if $folding-inner1 else get_local $8 i32.const 2147483647 @@ -7840,7 +7842,7 @@ i32.const 1125515264 i32.gt_s if - br $folding-inner1 + br $folding-inner0 else get_local $8 i32.const -1021968384 @@ -7851,7 +7853,7 @@ get_local $0 f32.sub f32.le - br_if $folding-inner1 + br_if $folding-inner0 end end end @@ -7870,12 +7872,12 @@ i32.const 1056964608 i32.gt_s if - get_local $8 i32.const 8388608 get_local $7 i32.const 1 i32.add i32.shr_s + get_local $8 i32.add tee_local $4 i32.const 2147483647 @@ -7885,12 +7887,12 @@ i32.const 127 i32.sub set_local $7 - get_local $4 i32.const 8388607 get_local $7 i32.shr_s i32.const -1 i32.xor + get_local $4 i32.and f32.reinterpret/i32 set_local $3 @@ -8014,16 +8016,16 @@ return end get_local $10 - f32.const 1000000015047466219876688e6 + f32.const 1.0000000031710769e-30 f32.mul - f32.const 1000000015047466219876688e6 + f32.const 1.0000000031710769e-30 f32.mul return end get_local $10 - f32.const 1.0000000031710769e-30 + f32.const 1000000015047466219876688e6 f32.mul - f32.const 1.0000000031710769e-30 + f32.const 1000000015047466219876688e6 f32.mul ) (func $std/math/test_powf (; 120 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) @@ -8049,15 +8051,15 @@ i32.mul tee_local $0 get_local $0 - get_local $0 + i32.const 61 + i32.or get_local $0 i32.const 7 i32.shr_u - i32.xor get_local $0 - i32.const 61 - i32.or + i32.xor i32.mul + get_local $0 i32.add i32.xor tee_local $0 @@ -8081,9 +8083,9 @@ i32.const 1 set_global $~lib/math/random_seeded get_local $0 - get_local $0 i64.const 33 i64.shr_u + get_local $0 i64.xor i64.const -49064778989728563 i64.mul @@ -8149,17 +8151,17 @@ get_global $~lib/math/random_state1_64 tee_local $1 set_global $~lib/math/random_state0_64 - get_local $0 + get_local $1 get_local $0 i64.const 23 i64.shl + get_local $0 i64.xor tee_local $0 get_local $0 i64.const 17 i64.shr_u i64.xor - get_local $1 i64.xor get_local $1 i64.const 26 @@ -8167,8 +8169,8 @@ i64.xor tee_local $0 set_global $~lib/math/random_state1_64 - get_local $1 get_local $0 + get_local $1 i64.add i64.const 4503599627370495 i64.and @@ -8191,26 +8193,25 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state1_32 get_global $~lib/math/random_state0_32 - tee_local $1 + tee_local $0 + get_global $~lib/math/random_state1_32 i32.xor - set_local $0 - get_local $1 + tee_local $1 + get_local $0 i32.const 26 i32.rotl - get_local $0 i32.xor - get_local $0 + get_local $1 i32.const 9 i32.shl i32.xor set_global $~lib/math/random_state0_32 - get_local $0 + get_local $1 i32.const 13 i32.rotl set_global $~lib/math/random_state1_32 - get_local $1 + get_local $0 i32.const -1640531525 i32.mul i32.const 5 @@ -9344,8 +9345,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -9362,8 +9363,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -9380,8 +9381,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -9398,8 +9399,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -9416,8 +9417,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -9434,8 +9435,8 @@ i32.const 1 i32.and if - get_local $2 get_local $0 + get_local $2 i64.mul set_local $2 end @@ -31369,8 +31370,8 @@ call $~lib/bindings/Math/random i64.reinterpret/f64 call $~lib/math/NativeMath.seedRandom - block $break|0 - loop $repeat|0 + loop $repeat|0 + block $break|0 get_local $0 f64.convert_s/i32 f64.const 1e6 @@ -31404,17 +31405,15 @@ unreachable end unreachable - unreachable end - unreachable end call $~lib/bindings/Math/random i64.reinterpret/f64 call $~lib/math/NativeMath.seedRandom - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 + i32.const 0 + set_local $0 + loop $repeat|1 + block $break|1 get_local $0 f64.convert_s/i32 f64.const 1e6 @@ -31448,9 +31447,7 @@ unreachable end unreachable - unreachable end - unreachable end f64.const -8.06684839057968 f64.const -8 diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index c584c0f7..d194f91e 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -26,59 +26,59 @@ (local $7 i64) (local $8 i64) (local $9 i64) - block $folding-inner0 - get_local $0 - i64.reinterpret/f64 - tee_local $2 - i64.const 52 - i64.shr_u + get_local $0 + i64.reinterpret/f64 + tee_local $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + set_local $4 + get_local $1 + i64.reinterpret/f64 + tee_local $3 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + set_local $5 + get_local $2 + i64.const 63 + i64.shr_u + set_local $8 + get_local $3 + i64.const 1 + i64.shl + tee_local $7 + i64.const 0 + i64.eq + tee_local $6 + i32.eqz + if + get_local $4 i64.const 2047 - i64.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $3 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - set_local $5 - get_local $2 - i64.const 63 - i64.shr_u - set_local $8 - get_local $3 - i64.const 1 - i64.shl - tee_local $7 - i64.const 0 i64.eq - tee_local $6 - i32.eqz - if - get_local $4 - i64.const 2047 - i64.eq - set_local $6 - end - get_local $6 - i32.eqz - if - get_local $1 - get_local $1 - f64.ne - set_local $6 - end - get_local $6 - if - get_local $0 - get_local $1 - f64.mul - tee_local $0 - get_local $0 - f64.div - return - end + set_local $6 + end + get_local $6 + i32.eqz + if + get_local $1 + get_local $1 + f64.ne + set_local $6 + end + get_local $6 + if + get_local $0 + get_local $1 + f64.mul + tee_local $0 + get_local $0 + f64.div + return + end + block $folding-inner0 get_local $2 i64.const 1 i64.shl @@ -86,8 +86,8 @@ get_local $7 i64.le_u if - get_local $9 get_local $7 + get_local $9 i64.eq br_if $folding-inner0 get_local $0 @@ -279,58 +279,58 @@ (local $6 i32) (local $7 i32) (local $8 i32) - block $folding-inner0 - get_local $0 - i32.reinterpret/f32 - tee_local $2 - i32.const 23 - i32.shr_u + get_local $0 + i32.reinterpret/f32 + tee_local $2 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + set_local $3 + get_local $1 + i32.reinterpret/f32 + tee_local $4 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + set_local $6 + get_local $2 + i32.const -2147483648 + i32.and + set_local $8 + get_local $4 + i32.const 1 + i32.shl + tee_local $7 + i32.eqz + tee_local $5 + i32.eqz + if + get_local $3 i32.const 255 - i32.and - set_local $3 + i32.eq + set_local $5 + end + get_local $5 + i32.eqz + if get_local $1 - i32.reinterpret/f32 - tee_local $4 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - set_local $6 - get_local $2 - i32.const -2147483648 - i32.and - set_local $8 - get_local $4 - i32.const 1 - i32.shl - tee_local $7 - i32.eqz - tee_local $5 - i32.eqz - if - get_local $3 - i32.const 255 - i32.eq - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $1 - get_local $1 - f32.ne - set_local $5 - end - get_local $5 - if - get_local $0 - get_local $1 - f32.mul - tee_local $0 - get_local $0 - f32.div - return - end + get_local $1 + f32.ne + set_local $5 + end + get_local $5 + if + get_local $0 + get_local $1 + f32.mul + tee_local $0 + get_local $0 + f32.div + return + end + block $folding-inner0 get_local $2 i32.const 1 i32.shl @@ -437,6 +437,7 @@ tee_local $5 i32.shl set_local $2 + get_local $8 get_local $3 get_local $5 i32.sub @@ -459,7 +460,6 @@ i32.shr_u end tee_local $2 - get_local $8 i32.or f32.reinterpret/i32 return diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 8be7761b..36f12592 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -250,718 +250,720 @@ (local $18 i32) (local $19 f64) (local $20 i32) - block $folding-inner1 - block $folding-inner0 - get_local $0 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 - i32.const 2147483647 - i32.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $17 - i64.const 32 - i64.shr_u - i32.wrap/i64 - tee_local $11 - i32.const 2147483647 - i32.and - tee_local $12 - get_local $17 - i32.wrap/i64 - tee_local $7 - i32.or - i32.eqz - if - f64.const 1 - return - end - get_local $4 - i32.const 2146435072 - i32.gt_s - tee_local $8 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $20 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.gt_s - set_local $8 - end - get_local $8 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - tee_local $8 - if - get_local $7 - i32.const 0 - i32.ne - set_local $8 - end - end - get_local $8 - if - get_local $0 - get_local $1 - f64.add - return - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $12 - i32.const 1128267776 - i32.ge_s - if - i32.const 2 - set_local $16 - else - get_local $12 - i32.const 1072693248 - i32.ge_s - if - i32.const 52 - i32.const 20 - get_local $12 - i32.const 20 - i32.shr_s - i32.const 1023 - i32.sub - tee_local $10 - i32.const 20 - i32.gt_s - tee_local $5 - select - get_local $10 - i32.sub - set_local $8 - get_local $7 - get_local $12 - get_local $5 - select - tee_local $10 - get_local $8 - i32.shr_s - tee_local $5 - get_local $8 - i32.shl - get_local $10 - i32.eq - if - i32.const 2 - get_local $5 - i32.const 1 - i32.and - i32.sub - set_local $16 - end - end - end - end - get_local $7 - i32.eqz - if - get_local $12 - i32.const 2146435072 - i32.eq - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $20 - i32.or - if - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 0 - set_local $1 - end - get_local $1 - return - else - get_local $11 - i32.const 0 - i32.ge_s - if (result f64) - f64.const 0 - else - get_local $1 - f64.neg - end - tee_local $0 - return - end - unreachable - else - f64.const nan:0x8000000000000 - return - end - unreachable - end - get_local $12 - i32.const 1072693248 - i32.eq - if - get_local $11 - i32.const 0 - i32.ge_s - if - get_local $0 - return - end - f64.const 1 - get_local $0 - f64.div - return - end - get_local $11 - i32.const 1073741824 - i32.eq - if - get_local $0 - get_local $0 - f64.mul - return - end - get_local $11 - i32.const 1071644672 - i32.eq - if - get_local $18 - i32.const 0 - i32.ge_s - if - get_local $0 - f64.sqrt - return - end - end - end - get_local $0 - f64.abs - set_local $2 + get_local $0 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $18 + get_local $17 + i32.wrap/i64 + set_local $20 + get_local $18 + i32.const 2147483647 + i32.and + set_local $4 + get_local $1 + i64.reinterpret/f64 + tee_local $17 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $12 + i32.const 2147483647 + i32.and + set_local $11 + get_local $11 + get_local $17 + i32.wrap/i64 + tee_local $7 + i32.or + i32.eqz + if + f64.const 1 + return + end + get_local $4 + i32.const 2146435072 + i32.gt_s + tee_local $8 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $8 + if get_local $20 - i32.eqz - if - get_local $4 - i32.const 2146435072 - i32.eq - tee_local $5 - i32.eqz - if - get_local $4 - i32.eqz - set_local $5 - end - get_local $5 - i32.eqz - if - get_local $4 - i32.const 1072693248 - i32.eq - set_local $5 - end - get_local $5 - if - get_local $11 - i32.const 0 - i32.lt_s - if - f64.const 1 - get_local $2 - f64.div - set_local $2 - end - get_local $18 - i32.const 0 - i32.lt_s - if - get_local $4 - i32.const 1072693248 - i32.sub - get_local $16 - i32.or - if - get_local $16 - i32.const 1 - i32.eq - if - get_local $2 - f64.neg - set_local $2 - end - else - get_local $2 - get_local $2 - f64.sub - tee_local $0 - get_local $0 - f64.div - set_local $2 - end - end - get_local $2 - return - end - end - f64.const 1 - set_local $13 - get_local $18 i32.const 0 - i32.lt_s + i32.ne + set_local $8 + end + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.gt_s + set_local $8 + end + get_local $8 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + tee_local $8 + if + get_local $7 + i32.const 0 + i32.ne + set_local $8 + end + end + get_local $8 + if + get_local $0 + get_local $1 + f64.add + return + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $11 + i32.const 1128267776 + i32.ge_s + if + i32.const 2 + set_local $16 + else + get_local $11 + i32.const 1072693248 + i32.ge_s if - get_local $16 - i32.eqz - if - get_local $0 - get_local $0 - f64.sub - tee_local $0 - get_local $0 - f64.div - return - end - get_local $16 - i32.const 1 - i32.eq - if - f64.const -1 - set_local $13 - end - end - get_local $12 - i32.const 1105199104 - i32.gt_s - if (result f64) - get_local $12 - i32.const 1139802112 - i32.gt_s - if - get_local $4 - i32.const 1072693247 - i32.le_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.ge_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - f64.const inf - else - f64.const 0 - end - tee_local $0 - return - end - end - get_local $4 - i32.const 1072693247 - i32.lt_s - if - get_local $11 - i32.const 0 - i32.lt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $4 - i32.const 1072693248 - i32.gt_s - if - get_local $11 - i32.const 0 - i32.gt_s - if (result f64) - get_local $13 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - get_local $13 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end - tee_local $0 - return - end - get_local $2 - f64.const 1 - f64.sub - tee_local $3 - get_local $3 - f64.mul - f64.const 0.5 - get_local $3 - f64.const 0.3333333333333333 - get_local $3 - f64.const 0.25 - f64.mul - f64.sub - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 1.4426950216293335 - get_local $3 - f64.mul - tee_local $15 - get_local $3 - f64.const 1.9259629911266175e-08 - f64.mul - get_local $0 - f64.const 1.4426950408889634 - f64.mul - f64.sub - tee_local $6 - f64.add - set_local $9 - get_local $6 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $15 - f64.sub - f64.sub - else - i32.const 0 - set_local $7 - get_local $4 - i32.const 1048576 - i32.lt_s - if - i32.const -53 - set_local $7 - get_local $2 - f64.const 9007199254740992 - f64.mul - tee_local $2 - i64.reinterpret/f64 - i64.const 32 - i64.shr_u - i32.wrap/i64 - set_local $4 - end - get_local $7 - get_local $4 + i32.const 52 + i32.const 20 + get_local $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub + tee_local $10 + i32.const 20 + i32.gt_s + tee_local $5 + select + get_local $10 + i32.sub + set_local $8 + get_local $7 + get_local $11 + get_local $5 + select + tee_local $10 + get_local $8 + i32.shr_s + set_local $5 + get_local $5 + get_local $8 + i32.shl + get_local $10 + i32.eq + if + i32.const 2 + get_local $5 + i32.const 1 + i32.and + i32.sub + set_local $16 + end + end + end + end + get_local $7 + i32.eqz + if + get_local $11 + i32.const 2146435072 + i32.eq + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $20 + i32.or + if + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 0 + set_local $1 + end + get_local $1 + return + else + get_local $12 + i32.const 0 + i32.ge_s + if (result f64) + f64.const 0 + else + get_local $1 + f64.neg + end + tee_local $0 + return + end + unreachable + else + f64.const nan:0x8000000000000 + return + end + unreachable + end + get_local $11 + i32.const 1072693248 + i32.eq + if + get_local $12 + i32.const 0 + i32.ge_s + if + get_local $0 + return + end + f64.const 1 + get_local $0 + f64.div + return + end + get_local $12 + i32.const 1073741824 + i32.eq + if + get_local $0 + get_local $0 + f64.mul + return + end + get_local $12 + i32.const 1071644672 + i32.eq + if + get_local $18 + i32.const 0 + i32.ge_s + if + get_local $0 + f64.sqrt + return + end + end + end + get_local $0 + f64.abs + set_local $2 + get_local $20 + i32.eqz + if + get_local $4 + i32.const 2146435072 + i32.eq + tee_local $5 + i32.eqz + if + get_local $4 + i32.eqz + set_local $5 + end + get_local $5 + i32.eqz + if + get_local $4 + i32.const 1072693248 + i32.eq + set_local $5 + end + get_local $5 + if + get_local $12 + i32.const 0 + i32.lt_s + if + f64.const 1 + get_local $2 + f64.div + set_local $2 + end + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $4 + i32.const 1072693248 + i32.sub + get_local $16 + i32.or + if + get_local $16 + i32.const 1 + i32.eq + if + get_local $2 + f64.neg + set_local $2 + end + else + get_local $2 + get_local $2 + f64.sub + tee_local $0 + get_local $0 + f64.div + set_local $2 + end + end + get_local $2 + return + end + end + f64.const 1 + set_local $13 + get_local $18 + i32.const 0 + i32.lt_s + if + get_local $16 + i32.eqz + if + get_local $0 + get_local $0 + f64.sub + tee_local $0 + get_local $0 + f64.div + return + end + get_local $16 + i32.const 1 + i32.eq + if + f64.const -1 + set_local $13 + end + end + get_local $11 + i32.const 1105199104 + i32.gt_s + if (result f64) + get_local $11 + i32.const 1139802112 + i32.gt_s + if + get_local $4 + i32.const 1072693247 + i32.le_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.ge_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + f64.const inf + else + f64.const 0 + end + tee_local $0 + return + end + end + get_local $4 + i32.const 1072693247 + i32.lt_s + if + get_local $12 + i32.const 0 + i32.lt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $4 + i32.const 1072693248 + i32.gt_s + if + get_local $12 + i32.const 0 + i32.gt_s + if (result f64) + get_local $13 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + get_local $13 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + tee_local $0 + return + end + get_local $2 + f64.const 1 + f64.sub + tee_local $3 + get_local $3 + f64.mul + f64.const 0.5 + get_local $3 + f64.const 0.3333333333333333 + get_local $3 + f64.const 0.25 + f64.mul + f64.sub + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 1.4426950216293335 + get_local $3 + f64.mul + tee_local $15 + get_local $3 + f64.const 1.9259629911266175e-08 + f64.mul + get_local $0 + f64.const 1.4426950408889634 + f64.mul + f64.sub + tee_local $6 + f64.add + set_local $9 + get_local $6 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $15 + f64.sub + f64.sub + else + i32.const 0 + set_local $7 + get_local $4 + i32.const 1048576 + i32.lt_s + if + i32.const -53 + set_local $7 + get_local $2 + f64.const 9007199254740992 + f64.mul + tee_local $2 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $4 + end + get_local $4 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + get_local $7 + i32.add + set_local $7 + get_local $4 + i32.const 1048575 + i32.and + tee_local $5 + i32.const 1072693248 + i32.or + set_local $4 + get_local $5 + i32.const 235662 + i32.le_s + if (result i32) + i32.const 0 + else + get_local $5 + i32.const 767610 + i32.lt_s + if (result i32) + i32.const 1 + else + get_local $7 + i32.const 1 i32.add set_local $7 get_local $4 - i32.const 1048575 - i32.and - tee_local $5 - i32.const 1072693248 - i32.or + i32.const -1048576 + i32.add set_local $4 - get_local $5 - i32.const 235662 - i32.le_s - if (result i32) - i32.const 0 - else - get_local $5 - i32.const 767610 - i32.lt_s - if (result i32) - i32.const 1 - else - get_local $7 - i32.const 1 - i32.add - set_local $7 - get_local $4 - i32.const -1048576 - i32.add - set_local $4 - i32.const 0 - end - end - set_local $10 - get_local $2 - i64.reinterpret/f64 - i64.const 4294967295 - i64.and - get_local $4 - i64.extend_s/i32 - i64.const 32 - i64.shl - i64.or - f64.reinterpret/i64 - tee_local $2 - f64.const 1.5 - f64.const 1 - get_local $10 - select - tee_local $0 - f64.sub - tee_local $15 - f64.const 1 - get_local $2 - get_local $0 - f64.add - f64.div - tee_local $6 - f64.mul - set_local $9 - get_local $2 - get_local $4 - i32.const 1 - i32.shr_s - i32.const 536870912 - i32.or - i32.const 524288 - i32.add - get_local $10 - i32.const 18 - i32.shl - i32.add - i64.extend_s/i32 - i64.const 32 - i64.shl - f64.reinterpret/i64 - tee_local $3 - get_local $0 - f64.sub - f64.sub - set_local $2 - get_local $9 - get_local $9 - f64.mul - tee_local $14 - get_local $14 - f64.mul - f64.const 0.5999999999999946 - get_local $14 - f64.const 0.4285714285785502 - get_local $14 - f64.const 0.33333332981837743 - get_local $14 - f64.const 0.272728123808534 - get_local $14 - f64.const 0.23066074577556175 - get_local $14 - f64.const 0.20697501780033842 - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - f64.mul - set_local $19 - get_local $6 - get_local $15 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $3 - f64.mul - f64.sub - get_local $6 - get_local $2 - f64.mul - f64.sub - f64.mul - set_local $0 - f64.const 3 - get_local $6 - get_local $6 - f64.mul - tee_local $14 - f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $9 - f64.add - f64.mul - f64.add - tee_local $19 - f64.add - set_local $3 - get_local $19 - get_local $3 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $3 - f64.const 3 - f64.sub - get_local $14 - f64.sub - f64.sub - set_local $2 - get_local $6 - get_local $3 - f64.mul - tee_local $15 - get_local $0 - get_local $3 - f64.mul - get_local $2 - get_local $9 - f64.mul - f64.add - tee_local $6 - f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $15 - f64.sub - f64.sub - set_local $6 - f64.const 0.9617967009544373 - get_local $0 - f64.mul - tee_local $19 - f64.const -7.028461650952758e-09 - get_local $0 - f64.mul - get_local $6 - f64.const 0.9617966939259756 - f64.mul - f64.add - f64.const 1.350039202129749e-08 - f64.const 0 - get_local $10 - select - f64.add - tee_local $2 - f64.add - f64.const 0.5849624872207642 - f64.const 0 - get_local $10 - select - tee_local $0 - f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 - f64.add - set_local $9 - get_local $2 - get_local $9 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $9 - get_local $3 - f64.sub - get_local $0 - f64.sub - get_local $19 - f64.sub - f64.sub + i32.const 0 end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 - i64.const -4294967296 - i64.and - f64.reinterpret/i64 - tee_local $0 - f64.sub - get_local $9 - f64.mul - get_local $1 - get_local $2 - f64.mul - f64.add - tee_local $6 - get_local $0 - get_local $9 - f64.mul - tee_local $0 - f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $8 + end + set_local $10 + get_local $2 + i64.reinterpret/f64 + i64.const 4294967295 + i64.and + get_local $4 + i64.extend_s/i32 + i64.const 32 + i64.shl + i64.or + f64.reinterpret/i64 + tee_local $2 + f64.const 1.5 + f64.const 1 + get_local $10 + select + tee_local $0 + f64.sub + tee_local $15 + f64.const 1 + get_local $2 + get_local $0 + f64.add + f64.div + tee_local $6 + f64.mul + set_local $9 + get_local $2 + get_local $4 + i32.const 1 + i32.shr_s + i32.const 536870912 + i32.or + i32.const 524288 + i32.add + get_local $10 + i32.const 18 + i32.shl + i32.add + i64.extend_s/i32 + i64.const 32 + i64.shl + f64.reinterpret/i64 + tee_local $3 + get_local $0 + f64.sub + f64.sub + set_local $2 + get_local $9 + get_local $9 + f64.mul + tee_local $14 + get_local $14 + f64.mul + f64.const 0.5999999999999946 + get_local $14 + f64.const 0.4285714285785502 + get_local $14 + f64.const 0.33333332981837743 + get_local $14 + f64.const 0.272728123808534 + get_local $14 + f64.const 0.23066074577556175 + get_local $14 + f64.const 0.20697501780033842 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + set_local $19 + get_local $6 + get_local $15 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $6 + get_local $3 + f64.mul + f64.sub + get_local $6 + get_local $2 + f64.mul + f64.sub + f64.mul + set_local $0 + f64.const 3 + get_local $6 + get_local $6 + f64.mul + tee_local $14 + f64.add + get_local $19 + get_local $0 + get_local $6 + get_local $9 + f64.add + f64.mul + f64.add + tee_local $19 + f64.add + set_local $3 + get_local $19 + get_local $3 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $3 + f64.const 3 + f64.sub + get_local $14 + f64.sub + f64.sub + set_local $2 + get_local $6 + get_local $3 + f64.mul + tee_local $15 + get_local $0 + get_local $3 + f64.mul + get_local $2 + get_local $9 + f64.mul + f64.add + tee_local $6 + f64.add + set_local $0 + get_local $6 + get_local $0 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + get_local $15 + f64.sub + f64.sub + set_local $6 + f64.const 0.9617967009544373 + get_local $0 + f64.mul + tee_local $19 + f64.const -7.028461650952758e-09 + get_local $0 + f64.mul + get_local $6 + f64.const 0.9617966939259756 + f64.mul + f64.add + f64.const 1.350039202129749e-08 + f64.const 0 + get_local $10 + select + f64.add + tee_local $2 + f64.add + f64.const 0.5849624872207642 + f64.const 0 + get_local $10 + select + tee_local $0 + f64.add + get_local $7 + f64.convert_s/i32 + tee_local $3 + f64.add + set_local $9 + get_local $2 + get_local $9 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $9 + get_local $3 + f64.sub + get_local $0 + f64.sub + get_local $19 + f64.sub + f64.sub + end + set_local $2 + get_local $1 + get_local $1 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $0 + f64.sub + get_local $9 + f64.mul + get_local $1 + get_local $2 + f64.mul + f64.add + tee_local $6 + get_local $0 + get_local $9 + f64.mul + tee_local $0 + f64.add + tee_local $2 + i64.reinterpret/f64 + tee_local $17 + i32.wrap/i64 + set_local $8 + block $folding-inner1 + block $folding-inner0 get_local $17 i64.const 32 i64.shr_u @@ -975,7 +977,7 @@ i32.sub get_local $8 i32.or - br_if $folding-inner1 + br_if $folding-inner0 get_local $6 f64.const 8.008566259537294e-17 f64.add @@ -983,7 +985,7 @@ get_local $0 f64.sub f64.gt - br_if $folding-inner1 + br_if $folding-inner0 else get_local $5 i32.const 2147483647 @@ -996,13 +998,13 @@ i32.sub get_local $8 i32.or - br_if $folding-inner0 + br_if $folding-inner1 get_local $6 get_local $2 get_local $0 f64.sub f64.le - br_if $folding-inner0 + br_if $folding-inner1 end end get_local $5 @@ -1020,12 +1022,12 @@ i32.const 1071644672 i32.gt_s if - get_local $5 i32.const 1048576 get_local $10 i32.const 1 i32.add i32.shr_s + get_local $5 i32.add tee_local $7 i32.const 2147483647 @@ -1035,12 +1037,12 @@ i32.const 1023 i32.sub set_local $10 - get_local $7 i32.const 1048575 get_local $10 i32.shr_s i32.const -1 i32.xor + get_local $7 i32.and i64.extend_s/i32 i64.const 32 @@ -1178,16 +1180,16 @@ return end get_local $13 - f64.const 1e-300 + f64.const 1.e+300 f64.mul - f64.const 1e-300 + f64.const 1.e+300 f64.mul return end get_local $13 - f64.const 1.e+300 + f64.const 1e-300 f64.mul - f64.const 1.e+300 + f64.const 1e-300 f64.mul ) (func $std/operator-overloading/Tester.pow (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -2138,8 +2140,8 @@ i32.eqz set_local $0 end - get_local $1 get_local $0 + get_local $1 i32.ne if i32.const 0 diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index 91fd189f..b61e2445 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -295,9 +295,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -305,14 +302,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -320,14 +317,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -335,14 +332,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -350,6 +347,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -404,9 +404,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -414,14 +411,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -429,14 +426,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -444,14 +441,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -459,6 +456,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -505,9 +505,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -515,14 +512,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -530,14 +527,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -545,14 +542,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -560,6 +557,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1116,11 +1116,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1135,11 +1135,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1153,11 +1153,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 495c53c7..1188cace 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -192,24 +192,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -294,12 +294,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -421,9 +421,9 @@ (func $~lib/set/Set#find (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -538,7 +538,6 @@ i32.load8_s i32.store8 get_local $3 - get_local $4 get_local $2 i32.load8_s i32.const -2128831035 @@ -549,6 +548,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -665,9 +665,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -805,14 +805,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -846,9 +845,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -862,14 +859,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -904,9 +900,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -920,14 +914,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -976,9 +969,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1078,7 +1069,6 @@ i32.load8_u i32.store8 get_local $3 - get_local $4 get_local $2 i32.load8_u i32.const -2128831035 @@ -1089,6 +1079,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -1203,9 +1194,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -1341,14 +1332,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -1382,9 +1372,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1398,14 +1386,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -1440,9 +1427,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1456,14 +1441,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -1512,9 +1496,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -1544,9 +1526,9 @@ (func $~lib/set/Set#find (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -1671,7 +1653,6 @@ i32.load16_s i32.store16 get_local $3 - get_local $5 get_local $2 i32.load16_s tee_local $4 @@ -1691,6 +1672,7 @@ i32.and i32.const 2 i32.shl + get_local $5 i32.add tee_local $4 i32.load offset=8 @@ -1816,9 +1798,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -1965,14 +1947,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2006,9 +1987,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2022,14 +2001,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2064,9 +2042,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2080,14 +2056,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2136,9 +2111,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2248,7 +2221,6 @@ i32.load16_u i32.store16 get_local $3 - get_local $5 get_local $2 i32.load16_u tee_local $4 @@ -2268,6 +2240,7 @@ i32.and i32.const 2 i32.shl + get_local $5 i32.add tee_local $4 i32.load offset=8 @@ -2391,9 +2364,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -2538,14 +2511,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2579,9 +2551,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2595,14 +2565,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2637,9 +2606,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2653,14 +2620,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -2709,9 +2675,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -2772,9 +2736,9 @@ (func $~lib/set/Set#find (; 30 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -2880,7 +2844,6 @@ i32.load i32.store get_local $3 - get_local $4 get_local $2 i32.load call $~lib/internal/hash/hash32 @@ -2888,6 +2851,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -2997,9 +2961,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -3130,14 +3094,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_s - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3171,9 +3134,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3187,14 +3148,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3229,9 +3189,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3245,14 +3203,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_s - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3301,9 +3258,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3386,14 +3341,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i32.const 100 - i32.ge_u - br_if $break|1 + i32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i32.const 100 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3427,9 +3381,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3443,14 +3395,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|2 + i32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3485,9 +3436,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3501,14 +3450,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i32.const 50 - i32.ge_u - br_if $break|3 + i32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i32.const 50 + i32.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -3557,9 +3505,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -3705,9 +3651,9 @@ (func $~lib/set/Set#find (; 40 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -3813,7 +3759,6 @@ i64.load i64.store get_local $3 - get_local $4 get_local $2 i64.load call $~lib/internal/hash/hash64 @@ -3821,6 +3766,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -3930,9 +3876,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -4064,14 +4010,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i64.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i64.const 100 - i64.ge_s - br_if $break|1 + i64.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i64.const 100 + i64.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4105,9 +4050,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4121,14 +4064,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i64.const 50 - i64.ge_s - br_if $break|2 + i64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i64.const 50 + i64.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4163,9 +4105,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4179,14 +4119,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i64.const 50 - i64.ge_s - br_if $break|3 + i64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i64.const 50 + i64.lt_s + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4235,9 +4174,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4320,14 +4257,13 @@ call $~lib/env/abort unreachable end - block $break|1 - i64.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - i64.const 100 - i64.ge_u - br_if $break|1 + i64.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + i64.const 100 + i64.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4361,9 +4297,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4377,14 +4311,13 @@ call $~lib/env/abort unreachable end - block $break|2 - i64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - i64.const 50 - i64.ge_u - br_if $break|2 + i64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + i64.const 50 + i64.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4419,9 +4352,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4435,14 +4366,13 @@ call $~lib/env/abort unreachable end - block $break|3 - i64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - i64.const 50 - i64.ge_u - br_if $break|3 + i64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + i64.const 50 + i64.lt_u + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4491,9 +4421,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4528,9 +4456,9 @@ (func $~lib/set/Set#find (; 48 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -4636,7 +4564,6 @@ f32.load f32.store get_local $3 - get_local $4 get_local $2 f32.load i32.reinterpret/f32 @@ -4645,6 +4572,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -4752,9 +4680,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -4887,15 +4815,13 @@ call $~lib/env/abort unreachable end - block $break|1 - f32.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - f32.const 100 - f32.lt - i32.eqz - br_if $break|1 + f32.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + f32.const 100 + f32.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4929,9 +4855,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -4945,15 +4869,13 @@ call $~lib/env/abort unreachable end - block $break|2 - f32.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - f32.const 50 - f32.lt - i32.eqz - br_if $break|2 + f32.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + f32.const 50 + f32.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -4988,9 +4910,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5004,15 +4924,13 @@ call $~lib/env/abort unreachable end - block $break|3 - f32.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - f32.const 50 - f32.lt - i32.eqz - br_if $break|3 + f32.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + f32.const 50 + f32.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -5061,9 +4979,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5098,9 +5014,9 @@ (func $~lib/set/Set#find (; 55 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -5206,7 +5122,6 @@ f64.load f64.store get_local $3 - get_local $4 get_local $2 f64.load i64.reinterpret/f64 @@ -5215,6 +5130,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -5322,9 +5238,9 @@ get_local $2 get_local $0 i32.load - get_local $4 get_local $0 i32.load offset=4 + get_local $4 i32.and i32.const 2 i32.shl @@ -5457,15 +5373,13 @@ call $~lib/env/abort unreachable end - block $break|1 - f64.const 50 - set_local $0 - loop $repeat|1 - get_local $0 - f64.const 100 - f64.lt - i32.eqz - br_if $break|1 + f64.const 50 + set_local $0 + loop $repeat|1 + get_local $0 + f64.const 100 + f64.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -5499,9 +5413,7 @@ unreachable end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5515,15 +5427,13 @@ call $~lib/env/abort unreachable end - block $break|2 - f64.const 0 - set_local $0 - loop $repeat|2 - get_local $0 - f64.const 50 - f64.lt - i32.eqz - br_if $break|2 + f64.const 0 + set_local $0 + loop $repeat|2 + get_local $0 + f64.const 50 + f64.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -5558,9 +5468,7 @@ br $repeat|2 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 @@ -5574,15 +5482,13 @@ call $~lib/env/abort unreachable end - block $break|3 - f64.const 0 - set_local $0 - loop $repeat|3 - get_local $0 - f64.const 50 - f64.lt - i32.eqz - br_if $break|3 + f64.const 0 + set_local $0 + loop $repeat|3 + get_local $0 + f64.const 50 + f64.lt + if get_local $1 get_local $0 call $~lib/set/Set#has @@ -5631,9 +5537,7 @@ br $repeat|3 end unreachable - unreachable end - unreachable end get_local $1 i32.load offset=20 diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index ee11414d..93107ba4 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -98,24 +98,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -200,12 +200,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -569,9 +569,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -579,14 +576,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -594,14 +591,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -609,14 +606,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -624,6 +621,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -678,9 +678,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -688,14 +685,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -703,14 +700,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -718,14 +715,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -733,6 +730,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -779,9 +779,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -789,14 +786,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -804,14 +801,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -819,14 +816,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -834,6 +831,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1387,11 +1387,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1406,11 +1406,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1424,11 +1424,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1498,8 +1498,8 @@ i32.add get_local $2 call $~lib/internal/memory/memmove - get_local $4 get_local $2 + get_local $4 i32.add get_local $1 get_local $2 diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index d06d0259..e582fbbb 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -40,10 +40,10 @@ get_local $4 i32.lt_u if - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add i32.load16_u offset=4 tee_local $3 @@ -86,12 +86,12 @@ end get_local $3 if - get_local $0 get_local $2 i32.const 1 i32.add i32.const 1 i32.shl + get_local $0 i32.add i32.load16_u offset=4 i32.const 64512 @@ -208,18 +208,18 @@ get_local $7 i32.lt_u if - get_local $0 get_local $3 i32.const 1 i32.shl + get_local $0 i32.add i32.load16_u offset=4 tee_local $1 i32.const 128 i32.lt_u if - get_local $5 get_local $2 + get_local $5 i32.add get_local $1 i32.store8 @@ -232,8 +232,8 @@ i32.const 2048 i32.lt_u if - get_local $5 get_local $2 + get_local $5 i32.add tee_local $4 get_local $1 @@ -254,8 +254,8 @@ i32.add set_local $2 else - get_local $5 get_local $2 + get_local $5 i32.add set_local $4 get_local $1 @@ -274,12 +274,12 @@ end get_local $6 if - get_local $0 get_local $3 i32.const 1 i32.add i32.const 1 i32.shl + get_local $0 i32.add i32.load16_u offset=4 tee_local $6 @@ -378,8 +378,8 @@ br $continue|0 end end - get_local $5 get_local $2 + get_local $5 i32.add i32.const 0 i32.store8 @@ -651,9 +651,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -661,14 +658,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -676,14 +673,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -691,14 +688,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -706,6 +703,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -760,9 +760,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -770,14 +767,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -785,14 +782,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -800,14 +797,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -815,6 +812,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -861,9 +861,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -871,14 +868,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -886,14 +883,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -901,14 +898,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -916,6 +913,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1469,11 +1469,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1488,11 +1488,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1506,11 +1506,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1558,8 +1558,8 @@ i32.const 128 i32.lt_u if (result i32) - get_local $6 get_local $4 + get_local $6 i32.add get_local $3 i32.store16 @@ -1597,20 +1597,20 @@ i32.const 1 i32.add set_local $2 - get_local $6 get_local $4 + get_local $6 i32.add - get_local $3 - i32.const 31 - i32.and - i32.const 6 - i32.shl get_local $0 get_local $5 i32.add i32.load8_u i32.const 63 i32.and + get_local $3 + i32.const 31 + i32.and + i32.const 6 + i32.shl i32.or i32.store16 else @@ -1639,17 +1639,17 @@ call $~lib/env/abort unreachable end - get_local $6 get_local $4 + get_local $6 i32.add get_local $3 i32.const 7 i32.and i32.const 18 i32.shl - get_local $0 get_local $2 tee_local $5 + get_local $0 i32.add i32.load8_u i32.const 63 @@ -1657,11 +1657,11 @@ i32.const 12 i32.shl i32.or - get_local $0 get_local $2 i32.const 1 i32.add tee_local $2 + get_local $0 i32.add i32.load8_u i32.const 63 @@ -1670,11 +1670,11 @@ i32.shl i32.or tee_local $3 - get_local $0 get_local $2 i32.const 1 i32.add tee_local $2 + get_local $0 i32.add i32.load8_u i32.const 63 @@ -1714,17 +1714,17 @@ call $~lib/env/abort unreachable end - get_local $6 get_local $4 + get_local $6 i32.add get_local $3 i32.const 15 i32.and i32.const 12 i32.shl - get_local $0 get_local $2 tee_local $5 + get_local $0 i32.add i32.load8_u i32.const 63 @@ -1733,11 +1733,11 @@ i32.shl i32.or tee_local $3 - get_local $0 get_local $2 i32.const 1 i32.add tee_local $2 + get_local $0 i32.add i32.load8_u i32.const 63 @@ -1758,8 +1758,8 @@ br $continue|0 end end - get_local $2 get_local $1 + get_local $2 i32.ne if i32.const 0 diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index e6f6bfdd..17e0dd60 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -324,10 +324,10 @@ ) (func $~lib/internal/string/compareUnsafe (; 5 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $1 loop $continue|0 @@ -419,14 +419,13 @@ get_local $0 i32.const 65535 i32.gt_s - tee_local $2 + tee_local $1 i32.const 1 i32.add call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $2 + set_local $2 + get_local $1 if - get_local $1 get_local $0 i32.const 65536 i32.sub @@ -435,21 +434,24 @@ i32.shr_u i32.const 55296 i32.add - i32.const 16 - i32.shl + set_local $1 + get_local $2 get_local $0 i32.const 1023 i32.and i32.const 56320 i32.add + get_local $1 + i32.const 16 + i32.shl i32.or i32.store offset=4 else - get_local $1 + get_local $2 get_local $0 i32.store16 offset=4 end - get_local $1 + get_local $2 ) (func $~lib/string/String#startsWith (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -465,9 +467,6 @@ call $~lib/env/abort unreachable end - i32.const 192 - i32.load - tee_local $2 i32.const 0 get_local $0 i32.load @@ -476,6 +475,9 @@ get_local $1 i32.lt_s select + tee_local $2 + i32.const 192 + i32.load tee_local $3 i32.add get_local $1 @@ -485,9 +487,9 @@ return end get_local $0 - get_local $3 - i32.const 192 get_local $2 + i32.const 192 + get_local $3 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -852,9 +854,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -862,14 +861,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -877,14 +876,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -892,14 +891,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -907,6 +906,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -961,9 +963,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -971,14 +970,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -986,14 +985,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -1001,14 +1000,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -1016,6 +1015,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -1062,9 +1064,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -1072,14 +1071,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -1087,14 +1086,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -1102,14 +1101,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -1117,6 +1116,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -1670,11 +1672,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1689,11 +1691,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1707,11 +1709,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -1729,47 +1731,44 @@ (local $6 i32) (local $7 i64) block $break|0 + get_local $2 + i32.load + tee_local $6 + set_local $5 + get_local $6 + i32.eqz + br_if $break|0 block $case5|0 block $case4|0 block $case3|0 block $case2|0 block $case1|0 - get_local $2 - i32.load - tee_local $6 - set_local $5 - get_local $6 - i32.eqz - br_if $break|0 - block $tablify|0 - get_local $5 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 $tablify|0 - end - br $case5|0 + get_local $5 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 end get_local $2 i32.load16_u offset=4 set_local $5 - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $4 - block $break|1 - i32.const 0 - set_local $0 - loop $repeat|1 + i32.const 0 + set_local $0 + loop $repeat|1 + block $break|1 get_local $0 get_local $3 i32.ge_s br_if $break|1 - get_local $4 get_local $0 i32.const 1 i32.shl + get_local $4 i32.add get_local $5 i32.store16 offset=4 @@ -1778,33 +1777,31 @@ i32.add set_local $0 br $repeat|1 - unreachable end - unreachable end br $break|0 end get_local $2 i32.load offset=4 set_local $4 - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $5 - block $break|2 - i32.const 0 - set_local $0 - loop $repeat|2 + i32.const 0 + set_local $0 + loop $repeat|2 + block $break|2 get_local $0 get_local $3 i32.ge_s br_if $break|2 - get_local $5 get_local $0 i32.const 2 i32.shl + get_local $5 i32.add get_local $4 i32.store offset=4 @@ -1813,9 +1810,7 @@ i32.add set_local $0 br $repeat|2 - unreachable end - unreachable end br $break|0 end @@ -1825,31 +1820,31 @@ get_local $2 i32.load16_u offset=8 set_local $4 - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 - block $break|3 - i32.const 0 - set_local $1 - loop $repeat|3 + i32.const 0 + set_local $1 + loop $repeat|3 + block $break|3 get_local $1 get_local $3 i32.ge_s br_if $break|3 - get_local $0 get_local $1 i32.const 2 i32.shl + get_local $0 i32.add get_local $5 i32.store offset=4 - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add get_local $4 i32.store16 offset=8 @@ -1858,31 +1853,29 @@ i32.add set_local $1 br $repeat|3 - unreachable end - unreachable end br $break|0 end get_local $2 i64.load offset=4 set_local $7 - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add set_local $0 - block $break|4 - loop $repeat|4 + loop $repeat|4 + block $break|4 get_local $4 get_local $3 i32.ge_s br_if $break|4 - get_local $0 get_local $4 i32.const 3 i32.shl + get_local $0 i32.add get_local $7 i64.store offset=4 @@ -1891,9 +1884,7 @@ i32.add set_local $4 br $repeat|4 - unreachable end - unreachable end br $break|0 end @@ -1909,50 +1900,48 @@ i32.const 4 i32.add set_local $5 - block $break|5 - i32.const 0 - set_local $1 - get_local $6 - i32.const 1 - i32.shl - tee_local $0 - get_local $3 - i32.mul - set_local $2 - loop $repeat|5 + i32.const 0 + set_local $1 + get_local $6 + i32.const 1 + i32.shl + tee_local $0 + get_local $3 + i32.mul + set_local $2 + loop $repeat|5 + block $break|5 get_local $1 get_local $2 i32.ge_s br_if $break|5 - get_local $4 get_local $1 + get_local $4 i32.add get_local $5 get_local $0 call $~lib/internal/memory/memmove - get_local $1 get_local $0 + get_local $1 i32.add set_local $1 br $repeat|5 - unreachable end - unreachable end end ) (func $~lib/internal/string/copyUnsafe (; 14 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add i32.const 4 i32.add - get_local $2 get_local $3 i32.const 1 i32.shl + get_local $2 i32.add i32.const 4 i32.add @@ -2220,24 +2209,24 @@ i32.const -1 return end - block $break|0 - get_local $2 - i32.const 0 - get_local $2 - i32.const 0 - i32.gt_s - select - tee_local $2 - get_local $3 - get_local $4 - i32.sub - tee_local $3 - get_local $2 - get_local $3 - i32.lt_s - select - set_local $2 - loop $repeat|0 + get_local $2 + i32.const 0 + get_local $2 + i32.const 0 + i32.gt_s + select + tee_local $2 + get_local $3 + get_local $4 + i32.sub + tee_local $3 + get_local $2 + get_local $3 + i32.lt_s + select + set_local $2 + loop $repeat|0 + block $break|0 get_local $2 i32.const 0 i32.lt_s @@ -2258,9 +2247,7 @@ return end unreachable - unreachable end - unreachable end i32.const -1 ) @@ -3013,8 +3000,8 @@ tee_local $2 i32.eqz if - get_local $3 get_local $1 + get_local $3 i32.mul i32.const 268435456 i32.gt_s @@ -3050,8 +3037,8 @@ get_local $0 return end - get_local $3 get_local $1 + get_local $3 i32.mul call $~lib/internal/string/allocateUnsafe tee_local $2 @@ -3158,24 +3145,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -3260,12 +3247,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -3407,8 +3394,8 @@ i32.add get_local $2 call $~lib/internal/memory/memmove - get_local $4 get_local $2 + get_local $4 i32.add get_local $1 get_local $2 @@ -3482,10 +3469,10 @@ get_local $0 get_local $3 i32.store offset=4 - get_local $4 get_local $2 i32.const 2 i32.shl + get_local $4 i32.add get_local $1 i32.store offset=8 @@ -3570,28 +3557,27 @@ tee_local $4 i32.load set_local $7 - block $break|0 - i32.const 0 - set_local $2 - loop $repeat|0 - get_local $2 - get_local $3 - i32.ge_s - br_if $break|0 + i32.const 0 + set_local $2 + loop $repeat|0 + get_local $2 + get_local $3 + i32.lt_s + if i32.const 1 call $~lib/internal/string/allocateUnsafe tee_local $1 - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add i32.load16_u offset=4 i32.store16 offset=4 - get_local $7 get_local $2 i32.const 2 i32.shl + get_local $7 i32.add get_local $1 i32.store offset=8 @@ -3600,9 +3586,7 @@ i32.add set_local $2 br $repeat|0 - unreachable end - unreachable end get_local $4 return @@ -3654,8 +3638,8 @@ get_local $5 return end - get_local $9 get_local $8 + get_local $9 i32.add set_local $6 br $continue|1 @@ -3795,28 +3779,28 @@ i32.const 10000 i32.div_u set_local $1 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 100 i32.div_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -3838,18 +3822,18 @@ i32.const 100 i32.div_u set_local $1 - get_local $0 get_local $2 i32.const 2 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -3858,27 +3842,27 @@ i32.const 10 i32.ge_u if - get_local $0 get_local $2 i32.const 2 i32.sub i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $1 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 i32.store offset=4 else - get_local $0 get_local $2 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add get_local $1 i32.const 48 @@ -4030,15 +4014,14 @@ i32.const 100 i32.rem_u set_local $5 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $4 i32.const 10000 i32.rem_u @@ -4047,38 +4030,39 @@ i32.div_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 i64.shl i64.or i64.store offset=4 - get_local $0 get_local $2 i32.const 4 i32.sub tee_local $2 i32.const 1 i32.shl + get_local $0 i32.add - get_local $3 get_local $6 i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 - get_local $3 get_local $5 i32.const 2 i32.shl + get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -4200,7 +4184,6 @@ get_local $1 i64.sub set_local $8 - get_local $3 i64.const 1 i32.const 0 get_local $4 @@ -4213,6 +4196,7 @@ i64.const 1 i64.sub tee_local $14 + get_local $3 i64.and set_local $1 get_local $3 @@ -4359,10 +4343,10 @@ i32.const 1 i32.add set_local $6 - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add get_local $4 i32.const 65535 @@ -4390,22 +4374,22 @@ get_local $9 i32.add set_global $~lib/internal/number/_K - get_local $12 get_local $9 i32.const 2 i32.shl + get_local $12 i32.add i64.load32_u offset=8 get_local $11 i64.extend_s/i32 i64.shl set_local $1 - get_local $0 get_local $6 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add tee_local $2 i32.load16_u offset=4 @@ -4425,8 +4409,8 @@ end get_local $0 if - get_local $3 get_local $1 + get_local $3 i64.add get_local $8 i64.lt_u @@ -4436,8 +4420,8 @@ get_local $8 get_local $3 i64.sub - get_local $3 get_local $1 + get_local $3 i64.add get_local $8 i64.sub @@ -4451,8 +4435,8 @@ i32.const 1 i32.sub set_local $7 - get_local $3 get_local $1 + get_local $3 i64.add set_local $3 br $continue|2 @@ -4491,10 +4475,10 @@ i32.const 1 i32.add set_local $6 - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add get_local $3 i32.wrap/i64 @@ -4519,23 +4503,23 @@ get_local $9 i32.add set_global $~lib/internal/number/_K - get_local $8 - get_local $12 i32.const 0 get_local $9 i32.sub i32.const 2 i32.shl + get_local $12 i32.add i64.load32_u offset=8 + get_local $8 i64.mul set_local $8 - get_local $0 get_local $6 i32.const 1 i32.sub i32.const 1 i32.shl + get_local $0 i32.add tee_local $4 i32.load16_u offset=4 @@ -4603,10 +4587,10 @@ get_local $2 i32.eqz if - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add i32.const 3145774 i32.store offset=4 @@ -4630,18 +4614,18 @@ end get_local $3 if (result i32) - block $break|0 - get_local $1 - set_local $3 - loop $repeat|0 + get_local $1 + set_local $3 + loop $repeat|0 + block $break|0 get_local $3 get_local $4 i32.ge_s br_if $break|0 - get_local $0 get_local $3 i32.const 1 i32.shl + get_local $0 i32.add i32.const 48 i32.store16 offset=4 @@ -4650,14 +4634,12 @@ i32.add set_local $3 br $repeat|0 - unreachable end - unreachable end - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add i32.const 3145774 i32.store offset=4 @@ -4677,10 +4659,10 @@ end get_local $3 if (result i32) - get_local $0 get_local $4 i32.const 1 i32.shl + get_local $0 i32.add tee_local $3 i32.const 6 @@ -4733,18 +4715,18 @@ get_local $0 i32.const 3014704 i32.store offset=4 - block $break|1 - i32.const 2 - set_local $2 - loop $repeat|1 + i32.const 2 + set_local $2 + loop $repeat|1 + block $break|1 get_local $2 get_local $3 i32.ge_s br_if $break|1 - get_local $0 get_local $2 i32.const 1 i32.shl + get_local $0 i32.add i32.const 48 i32.store16 offset=4 @@ -4753,9 +4735,7 @@ i32.add set_local $2 br $repeat|1 - unreachable end - unreachable end get_local $1 get_local $3 @@ -4873,18 +4853,18 @@ (local $5 i32) (local $6 i64) (local $7 i64) - (local $8 i64) + (local $8 i32) (local $9 i64) (local $10 i64) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i32) (local $15 i64) get_local $1 f64.const 0 f64.lt - tee_local $12 + tee_local $13 if get_local $1 f64.neg @@ -4901,25 +4881,26 @@ i64.const 52 i64.shr_u i32.wrap/i64 - tee_local $13 + set_local $8 + get_local $2 + i64.const 4503599627370495 + i64.and + get_local $8 i32.const 0 i32.ne tee_local $5 i64.extend_u/i32 i64.const 52 i64.shl - get_local $2 - i64.const 4503599627370495 - i64.and i64.add set_local $2 - get_local $13 + get_local $8 i32.const 1 get_local $5 select i32.const 1075 i32.sub - tee_local $13 + tee_local $8 i32.const 1 i32.sub set_local $5 @@ -4948,7 +4929,7 @@ i64.shl i64.const 1 i64.sub - get_local $13 + get_local $8 get_local $14 i32.sub get_local $5 @@ -4998,10 +4979,10 @@ i32.add i64.load offset=8 set_global $~lib/internal/number/_frc_pow - get_local $4 get_local $5 i32.const 1 i32.shl + get_local $4 i32.add i32.load16_s offset=8 set_global $~lib/internal/number/_exp_pow @@ -5020,22 +5001,22 @@ tee_local $6 i64.const 4294967295 i64.and - tee_local $8 + tee_local $9 i64.mul - set_local $9 - get_local $7 + set_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $10 + tee_local $11 + get_local $7 i64.mul get_local $2 i64.const 32 i64.shr_u - tee_local $11 - get_local $8 - i64.mul + tee_local $12 get_local $9 + i64.mul + get_local $10 i64.const 32 i64.shr_u i64.add @@ -5043,43 +5024,42 @@ i64.const 4294967295 i64.and i64.add - set_local $2 + tee_local $2 + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u get_local $11 - get_local $10 + get_local $12 i64.mul get_local $3 i64.const 32 i64.shr_u i64.add - get_local $2 - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u i64.add set_local $2 + get_local $6 + i64.const 4294967295 + i64.and + tee_local $11 get_global $~lib/internal/number/_frc_plus tee_local $3 i64.const 4294967295 i64.and - tee_local $9 - get_local $6 - i64.const 4294967295 - i64.and tee_local $10 i64.mul set_local $7 - get_local $9 + get_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $8 + tee_local $9 i64.mul + get_local $11 get_local $3 i64.const 32 i64.shr_u - tee_local $11 - get_local $10 + tee_local $12 i64.mul get_local $7 i64.const 32 @@ -5089,19 +5069,18 @@ i64.const 4294967295 i64.and i64.add - set_local $7 - get_local $11 - get_local $8 + tee_local $7 + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + get_local $9 + get_local $12 i64.mul get_local $3 i64.const 32 i64.shr_u i64.add - get_local $7 - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u i64.add set_local $15 get_global $~lib/internal/number/_frc_minus @@ -5112,22 +5091,22 @@ get_local $6 i64.const 4294967295 i64.and - tee_local $8 + tee_local $9 i64.mul - set_local $9 - get_local $7 + set_local $10 get_local $6 i64.const 32 i64.shr_u - tee_local $10 + tee_local $11 + get_local $7 i64.mul get_local $3 i64.const 32 i64.shr_u - tee_local $11 - get_local $8 - i64.mul + tee_local $12 get_local $9 + i64.mul + get_local $10 i64.const 32 i64.shr_u i64.add @@ -5141,7 +5120,7 @@ i64.sub tee_local $7 get_local $11 - get_local $10 + get_local $12 i64.mul get_local $3 i64.const 32 @@ -5157,14 +5136,14 @@ i64.add i64.sub set_local $3 - get_local $0 - get_local $12 + get_local $13 i32.const 1 i32.shl + get_local $0 i32.add get_local $0 get_local $2 - get_local $13 + get_local $8 get_local $4 i32.sub get_global $~lib/internal/number/_exp_pow @@ -5174,19 +5153,19 @@ i32.sub tee_local $5 get_local $7 - get_global $~lib/internal/number/_exp get_local $4 + get_global $~lib/internal/number/_exp i32.add i32.const -64 i32.sub get_local $3 - get_local $12 + get_local $13 call $~lib/internal/number/genDigits - get_local $12 + get_local $13 i32.sub get_global $~lib/internal/number/_K call $~lib/internal/number/prettify - get_local $12 + get_local $13 i32.add ) (func $~lib/string/String#substring (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) @@ -5250,9 +5229,9 @@ i32.eqz tee_local $2 if - get_local $1 get_local $0 i32.load + get_local $1 i32.eq set_local $2 end diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 6b5db84d..a5ab748b 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -217,24 +217,24 @@ if return end - get_local $0 i32.const 0 get_local $0 i32.sub i32.const 3 i32.and tee_local $2 + get_local $0 i32.add tee_local $0 i32.const 0 i32.store - get_local $0 get_local $1 get_local $2 i32.sub i32.const -4 i32.and tee_local $1 + get_local $0 i32.add i32.const 4 i32.sub @@ -319,12 +319,12 @@ i32.const 0 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $2 + get_local $0 i32.add set_local $0 get_local $1 @@ -449,22 +449,22 @@ (local $3 i32) i32.const -2128831035 set_local $2 - block $break|0 - get_local $0 - i32.load - i32.const 1 - i32.shl - set_local $3 - loop $repeat|0 + get_local $0 + i32.load + i32.const 1 + i32.shl + set_local $3 + loop $repeat|0 + block $break|0 get_local $1 get_local $3 i32.ge_u br_if $break|0 - get_local $2 get_local $0 get_local $1 i32.add i32.load8_u offset=4 + get_local $2 i32.xor i32.const 16777619 i32.mul @@ -474,9 +474,7 @@ i32.add set_local $1 br $repeat|0 - unreachable end - unreachable end get_local $2 ) @@ -559,9 +557,9 @@ (func $~lib/map/Map#find (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -662,7 +660,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 i32.load call $~lib/internal/hash/hashStr @@ -670,6 +667,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -784,9 +782,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -833,9 +831,9 @@ (func $~lib/map/Map#find (; 14 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) get_local $0 i32.load - get_local $2 get_local $0 i32.load offset=4 + get_local $2 i32.and i32.const 2 i32.shl @@ -936,7 +934,6 @@ i32.load offset=4 i32.store offset=4 get_local $3 - get_local $4 get_local $2 i32.load call $~lib/internal/hash/hash32 @@ -944,6 +941,7 @@ i32.and i32.const 2 i32.shl + get_local $4 i32.add tee_local $8 i32.load offset=8 @@ -1058,9 +1056,9 @@ get_local $3 get_local $0 i32.load - get_local $5 get_local $0 i32.load offset=4 + get_local $5 i32.and i32.const 2 i32.shl @@ -1436,9 +1434,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 1 i32.add @@ -1446,14 +1441,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 5 i32.add @@ -1461,14 +1456,14 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 24 - i32.shr_u get_local $1 i32.const 9 i32.add @@ -1476,14 +1471,14 @@ tee_local $3 i32.const 8 i32.shl + get_local $5 + i32.const 24 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 24 - i32.shr_u get_local $1 i32.const 13 i32.add @@ -1491,6 +1486,9 @@ tee_local $5 i32.const 8 i32.shl + get_local $3 + i32.const 24 + i32.shr_u i32.or i32.store get_local $1 @@ -1545,9 +1543,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 2 i32.add @@ -1555,14 +1550,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 6 i32.add @@ -1570,14 +1565,14 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 16 - i32.shr_u get_local $1 i32.const 10 i32.add @@ -1585,14 +1580,14 @@ tee_local $3 i32.const 16 i32.shl + get_local $5 + i32.const 16 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 16 - i32.shr_u get_local $1 i32.const 14 i32.add @@ -1600,6 +1595,9 @@ tee_local $5 i32.const 16 i32.shl + get_local $3 + i32.const 16 + i32.shr_u i32.or i32.store get_local $1 @@ -1646,9 +1644,6 @@ i32.ge_u if get_local $0 - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 3 i32.add @@ -1656,14 +1651,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 4 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 7 i32.add @@ -1671,14 +1666,14 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 8 i32.add - get_local $5 - i32.const 8 - i32.shr_u get_local $1 i32.const 11 i32.add @@ -1686,14 +1681,14 @@ tee_local $3 i32.const 24 i32.shl + get_local $5 + i32.const 8 + i32.shr_u i32.or i32.store get_local $0 i32.const 12 i32.add - get_local $3 - i32.const 8 - i32.shr_u get_local $1 i32.const 15 i32.add @@ -1701,6 +1696,9 @@ tee_local $5 i32.const 24 i32.shl + get_local $3 + i32.const 8 + i32.shr_u i32.or i32.store get_local $1 @@ -2254,11 +2252,11 @@ if return end - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2273,11 +2271,11 @@ i32.const 8 i32.ge_u if - get_local $0 get_local $2 i32.const 8 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2291,11 +2289,11 @@ loop $continue|5 get_local $2 if - get_local $0 get_local $2 i32.const 1 i32.sub tee_local $2 + get_local $0 i32.add get_local $1 get_local $2 @@ -2308,10 +2306,10 @@ end ) (func $~lib/internal/string/copyUnsafe (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 get_local $1 i32.const 1 i32.shl + get_local $0 i32.add i32.const 4 i32.add diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 4812dfbf..84b4a823 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -245,11 +245,11 @@ i32.mul tee_local $1 i32.store - get_local $0 get_local $2 i32.const -4 i32.and tee_local $2 + get_local $0 i32.add i32.const 4 i32.sub @@ -334,12 +334,12 @@ get_local $1 i32.store get_local $0 - get_local $0 i32.const 4 i32.and i32.const 24 i32.add tee_local $3 + get_local $0 i32.add set_local $0 get_local $2 @@ -600,9 +600,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -636,9 +636,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -672,9 +672,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -710,11 +710,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 1 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -750,11 +750,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 1 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -790,11 +790,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 2 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -830,11 +830,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 2 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -870,11 +870,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 3 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -910,11 +910,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 3 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -950,11 +950,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 2 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -990,11 +990,11 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 i32.const 3 i32.shr_u - get_local $0 i32.ne if i32.const 0 @@ -1076,8 +1076,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $2 get_local $1 + get_local $2 i32.add tee_local $2 get_local $3 @@ -1312,28 +1312,27 @@ i32.const 0 get_local $4 call $~lib/internal/memory/memset - block $break|0 - get_local $2 - i32.const 1 - i32.sub - set_local $5 - loop $repeat|0 - get_local $5 - i32.const 0 - i32.le_s - br_if $break|0 + get_local $2 + i32.const 1 + i32.sub + set_local $5 + loop $repeat|0 + get_local $5 + i32.const 0 + i32.gt_s + if get_local $5 set_local $4 loop $continue|1 get_local $4 i32.const 1 i32.and - get_local $9 get_local $4 i32.const 6 i32.shr_s i32.const 2 i32.shl + get_local $9 i32.add i32.load get_local $4 @@ -1366,10 +1365,10 @@ i32.add f64.load offset=8 set_local $8 - get_local $10 get_local $5 i32.const 3 i32.shl + get_local $10 i32.add f64.load offset=8 set_local $7 @@ -1382,12 +1381,12 @@ i32.const 0 i32.lt_s if - get_local $9 get_local $5 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $9 i32.add tee_local $4 get_local $4 @@ -1409,10 +1408,10 @@ i32.add get_local $8 f64.store offset=8 - get_local $4 get_local $6 i32.const 3 i32.shl + get_local $4 i32.add get_local $7 f64.store offset=8 @@ -1422,20 +1421,17 @@ i32.sub set_local $5 br $repeat|0 - unreachable end - unreachable end - block $break|2 - get_local $2 - i32.const 1 - i32.sub - set_local $5 - loop $repeat|2 - get_local $5 - i32.const 2 - i32.lt_s - br_if $break|2 + get_local $2 + i32.const 1 + i32.sub + set_local $5 + loop $repeat|2 + get_local $5 + i32.const 2 + i32.ge_s + if get_local $0 get_local $1 i32.add @@ -1443,29 +1439,28 @@ f64.load offset=8 set_local $7 get_local $2 - get_local $2 get_local $5 i32.const 3 i32.shl + tee_local $4 + get_local $2 i32.add - tee_local $2 f64.load offset=8 f64.store offset=8 get_local $2 + get_local $4 + i32.add get_local $7 f64.store offset=8 i32.const 1 set_local $6 loop $continue|3 - get_local $6 - i32.const 1 - i32.shl - get_local $9 get_local $6 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $9 i32.add i32.load get_local $6 @@ -1474,6 +1469,9 @@ i32.shr_u i32.const 1 i32.and + get_local $6 + i32.const 1 + i32.shl i32.add tee_local $4 get_local $5 @@ -1495,10 +1493,10 @@ tee_local $2 f64.load offset=8 set_local $7 - get_local $2 get_local $6 i32.const 3 i32.shl + get_local $2 i32.add f64.load offset=8 set_local $8 @@ -1511,12 +1509,12 @@ i32.const 0 i32.lt_s if - get_local $9 get_local $6 i32.const 5 i32.shr_s i32.const 2 i32.shl + get_local $9 i32.add tee_local $2 get_local $2 @@ -1554,9 +1552,7 @@ i32.sub set_local $5 br $repeat|2 - unreachable end - unreachable end get_local $0 get_local $1 @@ -1603,15 +1599,15 @@ i32.const 2 i32.eq if - get_local $3 get_local $2 + get_local $3 i32.add i32.const 8 i32.add f64.load offset=8 set_local $5 - get_local $3 get_local $2 + get_local $3 i32.add f64.load offset=8 set_local $6 @@ -1624,8 +1620,8 @@ i32.const 0 i32.lt_s if - get_local $3 get_local $2 + get_local $3 i32.add tee_local $1 i32.const 8 @@ -1725,12 +1721,12 @@ call $~lib/env/abort unreachable end + get_local $1 get_local $0 i32.load get_local $0 i32.load offset=4 i32.add - get_local $1 i32.add get_local $2 i32.store8 offset=8 @@ -1766,12 +1762,12 @@ call $~lib/env/abort unreachable end + get_local $1 get_local $0 i32.load get_local $0 i32.load offset=4 i32.add - get_local $1 i32.add i32.load8_u offset=8 ) @@ -1793,8 +1789,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $2 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -1816,8 +1812,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $3 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -1837,8 +1833,8 @@ tee_local $3 i32.lt_s if - get_local $6 get_local $2 + get_local $6 i32.add get_local $7 i32.add @@ -1865,12 +1861,12 @@ call $~lib/env/abort unreachable end + get_local $1 get_local $0 i32.load get_local $0 i32.load offset=4 i32.add - get_local $1 i32.add i32.load8_s offset=8 ) @@ -1878,7 +1874,6 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) get_local $0 i32.load offset=8 get_local $1 @@ -1888,21 +1883,19 @@ i32.const 0 return end - block $break|0 - get_local $0 - i32.load offset=8 - set_local $4 - loop $repeat|0 - get_local $2 - get_local $4 - i32.ge_s - br_if $break|0 + get_local $0 + i32.load offset=8 + set_local $4 + loop $repeat|0 + get_local $2 + get_local $4 + i32.lt_s + if get_local $0 get_local $2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and - set_local $5 get_local $2 get_local $1 i32.load @@ -1910,16 +1903,14 @@ i32.load i32.lt_u if (result i32) - get_local $3 get_local $2 + get_local $3 i32.add i32.load8_s offset=8 else unreachable end - set_local $3 - get_local $5 - get_local $3 + tee_local $3 i32.const 255 i32.and i32.ne @@ -1934,9 +1925,7 @@ br $repeat|0 end unreachable - unreachable end - unreachable end i32.const 1 ) @@ -1981,8 +1970,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $2 get_local $1 + get_local $2 i32.add tee_local $2 get_local $3 @@ -2044,8 +2033,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $2 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -2067,8 +2056,8 @@ i32.const 0 i32.lt_s if (result i32) - get_local $4 get_local $3 + get_local $4 i32.add tee_local $5 i32.const 0 @@ -2114,33 +2103,30 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) + get_local $1 + i32.load offset=4 get_local $0 i32.load offset=8 i32.const 2 i32.shr_u - get_local $1 - i32.load offset=4 i32.ne if i32.const 0 return end - block $break|0 - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - set_local $4 - loop $repeat|0 - get_local $2 - get_local $4 - i32.ge_s - br_if $break|0 + get_local $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + set_local $4 + loop $repeat|0 + get_local $2 + get_local $4 + i32.lt_s + if get_local $0 get_local $2 call $~lib/internal/typedarray/TypedArray#__get - set_local $5 get_local $2 get_local $1 i32.load @@ -2150,18 +2136,16 @@ i32.shr_u i32.lt_u if (result i32) - get_local $3 get_local $2 i32.const 2 i32.shl + get_local $3 i32.add i32.load offset=8 else unreachable end - set_local $3 - get_local $5 - get_local $3 + tee_local $3 i32.ne if i32.const 0 @@ -2174,9 +2158,7 @@ br $repeat|0 end unreachable - unreachable end - unreachable end i32.const 1 )