diff --git a/package-lock.json b/package-lock.json index 184f4f2e12..1dea1f3aa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1163,9 +1163,9 @@ "optional": true }, "binaryen": { - "version": "97.0.0-nightly.20200929", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-97.0.0-nightly.20200929.tgz", - "integrity": "sha512-HQ7VTISqwfVOylWJAE2jIyhuO5zrxTD2Vvc0cwtXTUqfmlbZdt/Z0vxUZD+uFYHRLM0p9ddJc7RPVGsvPI2oEQ==" + "version": "97.0.0-nightly.20201006", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-97.0.0-nightly.20201006.tgz", + "integrity": "sha512-/xZwg4pDUQYg8BIn1F6OypJGwADNTIEDm48O5KuSE250bPj1tGCvAinYmm2JAoiio7DovTkwb5I3w0G+CvG8Jg==" }, "bluebird": { "version": "3.7.2", diff --git a/package.json b/package.json index ea2fdc2d33..ae2e6c45e1 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "url": "https://github.com/AssemblyScript/assemblyscript/issues" }, "dependencies": { - "binaryen": "97.0.0-nightly.20200929", + "binaryen": "97.0.0-nightly.20201006", "long": "^4.0.0", "source-map-support": "^0.5.19", "ts-node": "^6.2.0" diff --git a/src/glue/binaryen.d.ts b/src/glue/binaryen.d.ts index 84db410bd1..69131c3a1d 100644 --- a/src/glue/binaryen.d.ts +++ b/src/glue/binaryen.d.ts @@ -970,6 +970,8 @@ export declare function _BinaryenGetDebugInfo(): bool; export declare function _BinaryenSetDebugInfo(on: bool): void; export declare function _BinaryenGetLowMemoryUnused(): bool; export declare function _BinaryenSetLowMemoryUnused(on: bool): void; +export declare function _BinaryenGetFastMath(): bool; +export declare function _BinaryenSetFastMath(on: bool): void; export declare function _BinaryenGetPassArgument(key: BinaryenString): BinaryenString; export declare function _BinaryenSetPassArgument(key: BinaryenString, value: BinaryenString): void; export declare function _BinaryenClearPassArguments(): void; diff --git a/src/module.ts b/src/module.ts index c2093b252c..e841e8c8f7 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1386,6 +1386,14 @@ export class Module { binaryen._BinaryenSetLowMemoryUnused(on); } + getFastMath(): bool { + return binaryen._BinaryenGetFastMath(); + } + + setFastMath(on: bool): void { + binaryen._BinaryenSetFastMath(on); + } + getPassArgument(key: string): string | null { var cStr = this.allocStringCached(key); var ptr = binaryen._BinaryenGetPassArgument(cStr); @@ -1477,6 +1485,7 @@ export class Module { this.setOptimizeLevel(optimizeLevel); this.setShrinkLevel(shrinkLevel); this.setDebugInfo(debugInfo); + this.setFastMath(true); this.clearPassArguments(); // Tweak inlining limits based on optimization levels diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 565621a65f..9ce607790f 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -238,11 +238,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -254,11 +252,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index a67611b82c..1e44aeff87 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -163,11 +163,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -179,11 +177,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 8680bc669c..39526bcc54 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -235,11 +235,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -251,11 +249,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index 9c33c3adf4..2a041ed9ba 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -170,11 +170,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -186,11 +184,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index 4913000374..dc9d165cbc 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -155,11 +155,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -171,11 +169,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index 717e09b3a0..fca8fc6fdd 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -156,11 +156,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -172,11 +170,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index ce3a0a2d5d..05199f8f24 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -153,11 +153,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -169,11 +167,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index ba0ca816f5..0653a40882 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -158,11 +158,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -174,11 +172,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index 42a5e9eaa8..576afcd3f7 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -162,11 +162,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -178,11 +176,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index a3e22c6a0e..9f089cdb6d 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -153,11 +153,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -169,11 +167,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index ed8cf871e1..436a592b73 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -153,11 +153,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -169,11 +167,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index 28dd6e3978..89c3ad7ac7 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -153,11 +153,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -169,11 +167,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index 995319d8fa..de0e4a8c39 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -243,11 +243,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -259,11 +257,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 1082f8c402..bba71a6ad7 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -156,11 +156,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -172,11 +170,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index e2dcc99097..920591da7e 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -155,11 +155,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -171,11 +169,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 86bb1d91ff..70b31956b7 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -182,11 +182,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -198,11 +196,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 686f1bd9d3..d159108b58 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -180,11 +180,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -196,11 +194,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index 2265222389..71cd498d5a 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -158,11 +158,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -174,11 +172,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index cad0f1fc39..8ab51d3213 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -178,11 +178,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -194,11 +192,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index b1cfbd7047..a65a8a749a 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -156,11 +156,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -172,11 +170,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 0360098a44..5f6c400c9a 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -208,11 +208,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -224,11 +222,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index feee7718d4..bac30e3e1e 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -539,11 +539,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -555,11 +553,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 74e1c922e2..d760e617c4 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -170,11 +170,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -186,11 +184,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index f710a3aca4..bb449b2557 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -178,11 +178,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -194,11 +192,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 117298a2c0..edf3789bad 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -177,11 +177,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -193,11 +191,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 9eaec6027b..b23e9028df 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -187,16 +187,14 @@ i64.reinterpret_f64 i64.const 63 i64.shr_u - i64.const 0 - i64.ne + i32.wrap_i64 i32.const 0 i32.ne local.get $1 i64.reinterpret_f64 i64.const 63 i64.shr_u - i64.const 0 - i64.ne + i32.wrap_i64 i32.const 0 i32.ne i32.eq @@ -11085,8 +11083,7 @@ local.get $1 i64.const 1 i64.and - i64.const 0 - i64.ne + i32.wrap_i64 select local.set $2 local.get $1 diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index efcadc7858..949c44df9b 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -174,11 +174,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -190,11 +188,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index 9e5adce441..36ac1dd593 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -208,11 +208,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -224,11 +222,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 362ee9491f..1fec3cc790 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -500,11 +500,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -516,11 +514,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 47d0c5f5b2..f31db14354 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -241,11 +241,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -257,11 +255,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 9d5f4b26f1..2f254f57b9 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -828,11 +828,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -844,11 +842,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index dad96f2d68..0ca0c1d2d2 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -473,11 +473,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -489,11 +487,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end @@ -8985,17 +8981,15 @@ (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 2 - i32.rem_s + i32.const 1 + i32.and i32.eqz - local.set $0 - call $~lib/rt/pure/__release - local.get $0 ) (func $~lib/typedarray/Int8Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9132,17 +9126,15 @@ (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release local.get $0 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 2 - i32.rem_s + i32.const 1 + i32.and i32.eqz - local.set $0 - call $~lib/rt/pure/__release - local.get $0 ) (func $~lib/typedarray/Int16Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9281,13 +9273,11 @@ (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain - local.get $0 - i32.const 2 - i32.rem_s - i32.eqz - local.set $0 call $~lib/rt/pure/__release local.get $0 + i32.const 1 + i32.and + i32.eqz ) (func $~lib/typedarray/Int32Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9359,13 +9349,11 @@ (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release local.get $0 - i64.const 2 - i64.rem_s + i64.const 1 + i64.and i64.eqz - local.set $2 - call $~lib/rt/pure/__release - local.get $2 ) (func $~lib/typedarray/Int64Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 2d68ddf8bf..971454d569 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -243,11 +243,9 @@ i32.add local.tee $4 i32.load offset=4 - i32.const 1 + i32.const -2 local.get $2 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and local.set $1 local.get $4 @@ -259,11 +257,9 @@ local.get $0 local.get $0 i32.load - i32.const 1 + i32.const -2 local.get $3 - i32.shl - i32.const -1 - i32.xor + i32.rotl i32.and i32.store end