diff options
author | Max Graey <maxgraey@gmail.com> | 2020-11-10 21:41:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 11:41:22 -0800 |
commit | 0c20d9f427b63a6fdc354bb917c11f382068eaec (patch) | |
tree | 750a49a311872f566d6c5b91a29d19d5f2a2e3c1 /test | |
parent | 5d2c13f16af2183a5d1861828e512fe0f964990c (diff) | |
download | binaryen-0c20d9f427b63a6fdc354bb917c11f382068eaec.tar.gz binaryen-0c20d9f427b63a6fdc354bb917c11f382068eaec.tar.bz2 binaryen-0c20d9f427b63a6fdc354bb917c11f382068eaec.zip |
Canonicalize subtraction with constant on the right to addition (#3321)
Using addition in more places is better for gzip, and helps simplify the
optimizer as well.
Add a FinalOptimizer phase to do optimizations like our signed LEB tweaks, to
reduce binary size in the rare case when we do want a subtraction.
Diffstat (limited to 'test')
23 files changed, 217 insertions, 217 deletions
diff --git a/test/passes/O.bin.txt b/test/passes/O.bin.txt index 0e6d2d9a2..40ab1940f 100644 --- a/test/passes/O.bin.txt +++ b/test/passes/O.bin.txt @@ -93,9 +93,9 @@ (br_if $label$3 (i64.gt_s (local.tee $0 - (i64.add + (i64.sub (local.get $0) - (i64.const -1) + (i64.const 1) ) ) (i64.const 1) diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt index f148cacd8..ce7ea2333 100644 --- a/test/passes/O3_low-memory-unused_metrics.txt +++ b/test/passes/O3_low-memory-unused_metrics.txt @@ -799,14 +799,14 @@ total ) ) (local.set $5 - (i32.add + (i32.sub (i32.shl (i32.load offset=48 (local.get $2) ) (i32.const 12) ) - (i32.const -30720) + (i32.const 30720) ) ) (local.set $3 @@ -2534,14 +2534,14 @@ total ) ) (local.tee $4 - (i32.add + (i32.sub (i32.shl (i32.load offset=76 (local.get $2) ) (i32.const 1) ) - (i32.const -2) + (i32.const 2) ) ) ) diff --git a/test/passes/asyncify_mod-asyncify-never-unwind_O.txt b/test/passes/asyncify_mod-asyncify-never-unwind_O.txt index bb233812c..d4840bfda 100644 --- a/test/passes/asyncify_mod-asyncify-never-unwind_O.txt +++ b/test/passes/asyncify_mod-asyncify-never-unwind_O.txt @@ -27,11 +27,11 @@ (block (result i32) (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (i32.load diff --git a/test/passes/asyncify_optimize-level=1.txt b/test/passes/asyncify_optimize-level=1.txt index 19e0cd160..c61ab8b04 100644 --- a/test/passes/asyncify_optimize-level=1.txt +++ b/test/passes/asyncify_optimize-level=1.txt @@ -29,11 +29,11 @@ (block (result i32) (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (i32.load @@ -91,11 +91,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $0 @@ -120,11 +120,11 @@ (block (result i32) (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (i32.load @@ -215,11 +215,11 @@ (block (result i32) (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (i32.load @@ -282,11 +282,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -308,11 +308,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $2 @@ -418,11 +418,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -494,11 +494,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -520,11 +520,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $2 @@ -656,11 +656,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -768,11 +768,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -794,11 +794,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $2 @@ -920,11 +920,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $0 @@ -946,11 +946,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $1 @@ -1046,11 +1046,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $0 @@ -1072,11 +1072,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $2 @@ -1171,11 +1171,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $0 @@ -1276,11 +1276,11 @@ (block (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (local.set $0 @@ -1384,11 +1384,11 @@ (block (result i32) (i32.store (global.get $__asyncify_data) - (i32.add + (i32.sub (i32.load (global.get $__asyncify_data) ) - (i32.const -4) + (i32.const 4) ) ) (i32.load diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt index fe69552fc..bb68dd500 100644 --- a/test/passes/converge_O3_metrics.bin.txt +++ b/test/passes/converge_O3_metrics.bin.txt @@ -85,11 +85,11 @@ total (i32.load offset=24 (i32.add (i32.load - (i32.add + (i32.sub (i32.load (i32.const 18100) ) - (i32.const -12) + (i32.const 12) ) ) (i32.const 18100) @@ -163,11 +163,11 @@ total (i32.load (i32.add (i32.load - (i32.add + (i32.sub (i32.load (i32.const 18100) ) - (i32.const -12) + (i32.const 12) ) ) (i32.const 18124) @@ -326,11 +326,11 @@ total (i32.load offset=24 (i32.add (i32.load - (i32.add + (i32.sub (i32.load (i32.const 18100) ) - (i32.const -12) + (i32.const 12) ) ) (i32.const 18100) @@ -404,11 +404,11 @@ total (i32.load (i32.add (i32.load - (i32.add + (i32.sub (i32.load (i32.const 18100) ) - (i32.const -12) + (i32.const 12) ) ) (i32.const 18124) diff --git a/test/passes/fannkuch3_manyopts_dwarf.bin.txt b/test/passes/fannkuch3_manyopts_dwarf.bin.txt index 9b9319c3e..dc002a6fb 100644 --- a/test/passes/fannkuch3_manyopts_dwarf.bin.txt +++ b/test/passes/fannkuch3_manyopts_dwarf.bin.txt @@ -4850,11 +4850,11 @@ file_names[ 4]: ;; code offset: 0x7d (local.tee $4 ;; code offset: 0x7c - (i32.add + (i32.sub ;; code offset: 0x78 (local.get $2) ;; code offset: 0x7a - (i32.const -1) + (i32.const 1) ) ) ) @@ -4912,11 +4912,11 @@ file_names[ 4]: ;; code offset: 0xaa (local.tee $1 ;; code offset: 0xa9 - (i32.add + (i32.sub ;; code offset: 0xa5 (local.get $2) ;; code offset: 0xa7 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0xac @@ -5020,11 +5020,11 @@ file_names[ 4]: ;; code offset: 0x101 (local.set $1 ;; code offset: 0x100 - (i32.add + (i32.sub ;; code offset: 0xfc (local.get $6) ;; code offset: 0xfe - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x105 @@ -5102,11 +5102,11 @@ file_names[ 4]: ;; code offset: 0x13d (local.tee $1 ;; code offset: 0x13c - (i32.add + (i32.sub ;; code offset: 0x138 (local.get $1) ;; code offset: 0x13a - (i32.const -1) + (i32.const 1) ) ) ) @@ -5301,7 +5301,7 @@ file_names[ 4]: ) ) ;; code offset: 0x1d5 - (i32.add + (i32.sub ;; code offset: 0x1d1 (local.tee $1 ;; code offset: 0x1ce @@ -5311,7 +5311,7 @@ file_names[ 4]: ) ) ;; code offset: 0x1d3 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x1de @@ -5379,11 +5379,11 @@ file_names[ 4]: ;; code offset: 0x20c (local.tee $4 ;; code offset: 0x20b - (i32.add + (i32.sub ;; code offset: 0x207 (local.get $2) ;; code offset: 0x209 - (i32.const -1) + (i32.const 1) ) ) ) @@ -5432,11 +5432,11 @@ file_names[ 4]: ;; code offset: 0x233 (local.tee $1 ;; code offset: 0x232 - (i32.add + (i32.sub ;; code offset: 0x22e (local.get $2) ;; code offset: 0x230 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x235 @@ -5530,11 +5530,11 @@ file_names[ 4]: ;; code offset: 0x282 (local.set $1 ;; code offset: 0x281 - (i32.add + (i32.sub ;; code offset: 0x27d (local.get $7) ;; code offset: 0x27f - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x286 @@ -5612,11 +5612,11 @@ file_names[ 4]: ;; code offset: 0x2be (local.tee $1 ;; code offset: 0x2bd - (i32.add + (i32.sub ;; code offset: 0x2b9 (local.get $1) ;; code offset: 0x2bb - (i32.const -1) + (i32.const 1) ) ) ) @@ -5811,7 +5811,7 @@ file_names[ 4]: ) ) ;; code offset: 0x356 - (i32.add + (i32.sub ;; code offset: 0x352 (local.tee $1 ;; code offset: 0x34f @@ -5821,7 +5821,7 @@ file_names[ 4]: ) ) ;; code offset: 0x354 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x35f @@ -5965,11 +5965,11 @@ file_names[ 4]: ;; code offset: 0x3d7 (local.set $2 ;; code offset: 0x3d6 - (i32.add + (i32.sub ;; code offset: 0x3d2 (local.get $3) ;; code offset: 0x3d4 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x3db @@ -6243,11 +6243,11 @@ file_names[ 4]: ;; code offset: 0x4aa (local.tee $0 ;; code offset: 0x4a9 - (i32.add + (i32.sub ;; code offset: 0x4a5 (local.get $2) ;; code offset: 0x4a7 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x4ac @@ -6292,11 +6292,11 @@ file_names[ 4]: ;; code offset: 0x4d2 (local.set $6 ;; code offset: 0x4d1 - (i32.add + (i32.sub ;; code offset: 0x4cd (local.get $6) ;; code offset: 0x4cf - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x4d4 @@ -6417,7 +6417,7 @@ file_names[ 4]: ) ) ;; code offset: 0x532 - (i32.add + (i32.sub ;; code offset: 0x52e (local.tee $0 ;; code offset: 0x52b @@ -6427,7 +6427,7 @@ file_names[ 4]: ) ) ;; code offset: 0x530 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x53b @@ -6504,11 +6504,11 @@ file_names[ 4]: ;; code offset: 0x56c (local.tee $0 ;; code offset: 0x56b - (i32.add + (i32.sub ;; code offset: 0x567 (local.get $2) ;; code offset: 0x569 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x56e @@ -6553,11 +6553,11 @@ file_names[ 4]: ;; code offset: 0x594 (local.set $6 ;; code offset: 0x593 - (i32.add + (i32.sub ;; code offset: 0x58f (local.get $6) ;; code offset: 0x591 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x596 @@ -6678,7 +6678,7 @@ file_names[ 4]: ) ) ;; code offset: 0x5f4 - (i32.add + (i32.sub ;; code offset: 0x5f0 (local.tee $0 ;; code offset: 0x5ed @@ -6688,7 +6688,7 @@ file_names[ 4]: ) ) ;; code offset: 0x5f2 - (i32.const -1) + (i32.const 1) ) ) ;; code offset: 0x5fd diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt index d9a621099..c63b3baa3 100644 --- a/test/passes/inlining-optimizing_optimize-level=3.txt +++ b/test/passes/inlining-optimizing_optimize-level=3.txt @@ -2467,7 +2467,7 @@ (if (result i32) (i32.lt_u (local.tee $8 - (i32.add + (i32.sub (local.tee $12 (i32.load8_s (local.tee $10 @@ -2478,7 +2478,7 @@ ) ) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2562,9 +2562,9 @@ (i32.and (i32.shl (i32.const 1) - (i32.add + (i32.sub (local.get $6) - (i32.const -32) + (i32.const 32) ) ) (i32.const 75913) @@ -2583,7 +2583,7 @@ (i32.or (i32.shl (i32.const 1) - (i32.add + (i32.sub (i32.shr_s (i32.shl (local.get $1) @@ -2591,7 +2591,7 @@ ) (i32.const 24) ) - (i32.const -32) + (i32.const 32) ) ) (local.get $12) @@ -2642,7 +2642,7 @@ (br_if $__rjti$0 (i32.ge_u (local.tee $12 - (i32.add + (i32.sub (i32.load8_s (local.tee $6 (i32.add @@ -2651,7 +2651,7 @@ ) ) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2681,11 +2681,11 @@ (i32.add (local.get $3) (i32.shl - (i32.add + (i32.sub (i32.load8_s (local.get $6) ) - (i32.const -48) + (i32.const 48) ) (i32.const 3) ) @@ -2790,7 +2790,7 @@ (if (result i32) (i32.lt_u (local.tee $6 - (i32.add + (i32.sub (i32.shr_s (i32.shl (local.get $6) @@ -2798,7 +2798,7 @@ ) (i32.const 24) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2820,7 +2820,7 @@ (if (i32.lt_u (local.tee $9 - (i32.add + (i32.sub (i32.load8_s (local.tee $10 (i32.add @@ -2829,7 +2829,7 @@ ) ) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2907,9 +2907,9 @@ (if (result i32) (i32.lt_u (local.tee $9 - (i32.add + (i32.sub (local.get $8) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2947,7 +2947,7 @@ ) (i32.ge_u (local.tee $6 - (i32.add + (i32.sub (i32.load8_s (local.tee $10 (i32.add @@ -2956,7 +2956,7 @@ ) ) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -2970,7 +2970,7 @@ (if (i32.lt_u (local.tee $8 - (i32.add + (i32.sub (i32.load8_s (local.tee $6 (i32.add @@ -2979,7 +2979,7 @@ ) ) ) - (i32.const -48) + (i32.const 48) ) ) (i32.const 10) @@ -3008,11 +3008,11 @@ (i32.add (local.get $3) (i32.shl - (i32.add + (i32.sub (i32.load8_s (local.get $6) ) - (i32.const -48) + (i32.const 48) ) (i32.const 3) ) @@ -3095,11 +3095,11 @@ (if (i32.gt_u (local.tee $11 - (i32.add + (i32.sub (i32.load8_s (local.get $8) ) - (i32.const -65) + (i32.const 65) ) ) (i32.const 57) @@ -3119,7 +3119,7 @@ ) (if (result i32) (i32.lt_u - (i32.add + (i32.sub (local.tee $11 (i32.and (local.tee $15 @@ -3139,7 +3139,7 @@ (i32.const 255) ) ) - (i32.const -1) + (i32.const 1) ) (i32.const 8) ) @@ -3548,9 +3548,9 @@ (loop $while-in32 (i32.store8 (local.tee $8 - (i32.add + (i32.sub (local.get $8) - (i32.const -1) + (i32.const 1) ) ) (i32.or @@ -3926,11 +3926,11 @@ ) (i32.store (local.get $21) - (i32.add + (i32.sub (i32.load (local.get $21) ) - (i32.const -1) + (i32.const 1) ) ) ) @@ -3990,9 +3990,9 @@ ) (br_if $while-in54 (local.tee $5 - (i32.add + (i32.sub (local.get $5) - (i32.const -1) + (i32.const 1) ) ) ) @@ -4079,9 +4079,9 @@ ) ) (i32.store8 - (i32.add + (i32.sub (local.get $5) - (i32.const -1) + (i32.const 1) ) (i32.add (i32.and @@ -4096,9 +4096,9 @@ ) (i32.store8 (local.tee $8 - (i32.add + (i32.sub (local.get $5) - (i32.const -2) + (i32.const 2) ) ) (i32.add @@ -4375,11 +4375,11 @@ (i32.store (local.get $21) (local.tee $5 - (i32.add + (i32.sub (i32.load (local.get $21) ) - (i32.const -28) + (i32.const 28) ) ) ) @@ -4490,9 +4490,9 @@ (if (i32.ge_u (local.tee $9 - (i32.add + (i32.sub (local.get $7) - (i32.const -4) + (i32.const 4) ) ) (local.get $5) @@ -4548,9 +4548,9 @@ (br_if $while-in66 (i32.ge_u (local.tee $9 - (i32.add + (i32.sub (local.get $9) - (i32.const -4) + (i32.const 4) ) ) (local.get $5) @@ -4564,9 +4564,9 @@ ) (i32.store (local.tee $5 - (i32.add + (i32.sub (local.get $5) - (i32.const -4) + (i32.const 4) ) ) (local.get $11) @@ -4583,9 +4583,9 @@ (i32.eqz (i32.load (local.tee $9 - (i32.add + (i32.sub (local.get $7) - (i32.const -4) + (i32.const 4) ) ) ) @@ -4686,12 +4686,12 @@ ) (block $do-once71 (local.set $11 - (i32.add + (i32.sub (i32.shl (i32.const 1) (local.get $15) ) - (i32.const -1) + (i32.const 1) ) ) (local.set $35 @@ -4946,7 +4946,7 @@ ) ) ) - (i32.add + (i32.sub (i32.mul (i32.shr_s (i32.sub @@ -4957,7 +4957,7 @@ ) (i32.const 9) ) - (i32.const -9) + (i32.const 9) ) ) (block (result i32) @@ -5017,7 +5017,7 @@ (local.tee $8 (i32.load (local.tee $6 - (i32.add + (i32.sub (i32.add (local.get $20) (i32.shl @@ -5025,7 +5025,7 @@ (i32.const 2) ) ) - (i32.const -4092) + (i32.const 4092) ) ) ) @@ -5167,18 +5167,18 @@ (if (i32.lt_u (local.tee $6 - (i32.add + (i32.sub (local.get $6) - (i32.const -4) + (i32.const 4) ) ) (local.get $5) ) (i32.store (local.tee $5 - (i32.add + (i32.sub (local.get $5) - (i32.const -4) + (i32.const 4) ) ) (i32.const 0) @@ -5306,9 +5306,9 @@ (if (result i32) (i32.load (local.tee $7 - (i32.add + (i32.sub (local.get $5) - (i32.const -4) + (i32.const 4) ) ) ) @@ -5363,28 +5363,28 @@ (block (result i32) (local.set $19 (i32.sub - (i32.add + (i32.sub (local.get $5) - (i32.const -1) + (i32.const 1) ) (local.get $8) ) ) - (i32.add + (i32.sub (local.get $16) - (i32.const -1) + (i32.const 1) ) ) (block (result i32) (local.set $19 - (i32.add + (i32.sub (local.get $5) - (i32.const -1) + (i32.const 1) ) ) - (i32.add + (i32.sub (local.get $16) - (i32.const -2) + (i32.const 2) ) ) ) @@ -5407,9 +5407,9 @@ (i32.eqz (local.tee $16 (i32.load - (i32.add + (i32.sub (local.get $9) - (i32.const -4) + (i32.const 4) ) ) ) @@ -5474,7 +5474,7 @@ ) ) (local.set $6 - (i32.add + (i32.sub (i32.mul (i32.shr_s (i32.sub @@ -5485,7 +5485,7 @@ ) (i32.const 9) ) - (i32.const -9) + (i32.const 9) ) ) (if (result i32) @@ -5643,9 +5643,9 @@ (loop $while-in98 (i32.store8 (local.tee $6 - (i32.add + (i32.sub (local.get $6) - (i32.const -1) + (i32.const 1) ) ) (i32.const 48) @@ -5662,9 +5662,9 @@ ) ) (i32.store8 - (i32.add + (i32.sub (local.get $6) - (i32.const -1) + (i32.const 1) ) (i32.add (i32.and @@ -5679,9 +5679,9 @@ ) (i32.store8 (local.tee $16 - (i32.add + (i32.sub (local.get $6) - (i32.const -2) + (i32.const 2) ) ) (local.get $7) @@ -5779,9 +5779,9 @@ (loop $while-in106 (i32.store8 (local.tee $7 - (i32.add + (i32.sub (local.get $7) - (i32.const -1) + (i32.const 1) ) ) (i32.const 48) @@ -5886,9 +5886,9 @@ (loop $while-in112 (i32.store8 (local.tee $6 - (i32.add + (i32.sub (local.get $6) - (i32.const -1) + (i32.const 1) ) ) (i32.const 48) @@ -5926,9 +5926,9 @@ ) ) (local.set $6 - (i32.add + (i32.sub (local.get $5) - (i32.const -9) + (i32.const 9) ) ) (if (result i32) @@ -6085,9 +6085,9 @@ (loop $while-in118 (i32.store8 (local.tee $5 - (i32.add + (i32.sub (local.get $5) - (i32.const -1) + (i32.const 1) ) ) (i32.const 48) @@ -6359,9 +6359,9 @@ (loop $while-in123 (result i32) (i32.store8 (local.tee $8 - (i32.add + (i32.sub (local.get $8) - (i32.const -1) + (i32.const 1) ) ) (i32.or @@ -7353,9 +7353,9 @@ (loop $while-in (i32.store8 (local.tee $2 - (i32.add + (i32.sub (local.get $2) - (i32.const -1) + (i32.const 1) ) ) (i32.or @@ -7398,9 +7398,9 @@ (loop $while-in1 (i32.store8 (local.tee $2 - (i32.add + (i32.sub (local.get $2) - (i32.const -1) + (i32.const 1) ) ) (i32.or diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 4a58c210f..a5cc470fb 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -818,16 +818,16 @@ (local.get $0) ) (i32.store offset=2 - (i32.add + (i32.sub (local.get $0) - (i32.const -11) + (i32.const 11) ) (local.get $0) ) (i32.store offset=2 - (i32.add + (i32.sub (local.get $0) - (i32.const -13) + (i32.const 13) ) (local.get $0) ) @@ -1369,12 +1369,12 @@ ) ) (drop - (i32.add + (i32.sub (i32.shl (local.get $1) (i32.const 3) ) - (i32.const -66) + (i32.const 66) ) ) (drop @@ -2529,25 +2529,25 @@ ) ) (func $optimizeAddedConstants-filters-through-nonzero (result i32) - (i32.add + (i32.sub (i32.shl (i32.const -536870912) (i32.wrap_i64 (i64.const 0) ) ) - (i32.const -31744) + (i32.const 31744) ) ) (func $optimizeAddedConstants-filters-through-nonzero-b (result i32) - (i32.add + (i32.sub (i32.shl (i32.const -536870912) (i32.wrap_i64 (i64.const -1) ) ) - (i32.const -31744) + (i32.const 31744) ) ) (func $return-proper-value-from-shift-left-by-zero (result i32) @@ -3424,7 +3424,7 @@ ) (drop (i32.eq - (i32.sub + (i32.add (local.get $x32) (i32.const 30) ) @@ -4205,15 +4205,15 @@ ) (func $rhs-is-neg-one (param $x i32) (param $y i64) (param $fx f32) (param $fy f64) (drop - (i32.sub + (i32.add (local.get $x) - (i32.const -1) + (i32.const 1) ) ) (drop - (i64.sub + (i64.add (local.get $y) - (i64.const -1) + (i64.const 1) ) ) (drop diff --git a/test/passes/optimize-instructions_optimize-level=2_all-features_ignore-implicit-traps.txt b/test/passes/optimize-instructions_optimize-level=2_all-features_ignore-implicit-traps.txt index 235944062..e450f9cc8 100644 --- a/test/passes/optimize-instructions_optimize-level=2_all-features_ignore-implicit-traps.txt +++ b/test/passes/optimize-instructions_optimize-level=2_all-features_ignore-implicit-traps.txt @@ -261,9 +261,9 @@ (i32.and (i32.shr_s (i32.shl - (i32.add + (i32.sub (local.get $1) - (i32.const -1) + (i32.const 1) ) (i32.const 24) ) @@ -300,9 +300,9 @@ (i32.and (i32.shr_s (i32.shl - (i32.add + (i32.sub (local.get $0) - (i32.const -1) + (i32.const 1) ) (i32.const 24) ) diff --git a/test/wasm2js/atomics_32.2asm.js b/test/wasm2js/atomics_32.2asm.js index 12cdbe8ff..d3c1ba22b 100644 --- a/test/wasm2js/atomics_32.2asm.js +++ b/test/wasm2js/atomics_32.2asm.js @@ -147,7 +147,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "aGVsbG8s"); memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29ybGQh"); diff --git a/test/wasm2js/atomics_32.2asm.js.opt b/test/wasm2js/atomics_32.2asm.js.opt index 4a7a5d85f..a12b684dc 100644 --- a/test/wasm2js/atomics_32.2asm.js.opt +++ b/test/wasm2js/atomics_32.2asm.js.opt @@ -143,7 +143,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "aGVsbG8s"); memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29ybGQh"); diff --git a/test/wasm2js/bulk-memory.2asm.js b/test/wasm2js/bulk-memory.2asm.js index 2b7431486..c847dbdfd 100644 --- a/test/wasm2js/bulk-memory.2asm.js +++ b/test/wasm2js/bulk-memory.2asm.js @@ -180,7 +180,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 0, "qrvM3Q=="); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); } @@ -287,7 +287,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM3Q=="); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); } @@ -405,7 +405,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(0), 0, ""); base64DecodeToExistingUint8Array(bufferView, 0, ""); diff --git a/test/wasm2js/bulk-memory.2asm.js.opt b/test/wasm2js/bulk-memory.2asm.js.opt index 77e682c41..4e6ccc529 100644 --- a/test/wasm2js/bulk-memory.2asm.js.opt +++ b/test/wasm2js/bulk-memory.2asm.js.opt @@ -180,7 +180,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 0, "qrvM3Q=="); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); } @@ -287,7 +287,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM3Q=="); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); } diff --git a/test/wasm2js/dynamicLibrary.2asm.js b/test/wasm2js/dynamicLibrary.2asm.js index b570fab36..22d483f45 100644 --- a/test/wasm2js/dynamicLibrary.2asm.js +++ b/test/wasm2js/dynamicLibrary.2asm.js @@ -81,7 +81,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, memoryBase, "ZHluYW1pYyBkYXRh"); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); }, diff --git a/test/wasm2js/dynamicLibrary.2asm.js.opt b/test/wasm2js/dynamicLibrary.2asm.js.opt index 4d7b4ac42..cd959acb8 100644 --- a/test/wasm2js/dynamicLibrary.2asm.js.opt +++ b/test/wasm2js/dynamicLibrary.2asm.js.opt @@ -73,7 +73,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, memoryBase, "ZHluYW1pYyBkYXRh"); var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); }, diff --git a/test/wasm2js/emscripten-grow-no.2asm.js b/test/wasm2js/emscripten-grow-no.2asm.js index 998527287..4d6bb4c77 100644 --- a/test/wasm2js/emscripten-grow-no.2asm.js +++ b/test/wasm2js/emscripten-grow-no.2asm.js @@ -63,7 +63,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj"); return asmFunc(asmLibraryArg, wasmMemory.buffer) diff --git a/test/wasm2js/emscripten-grow-no.2asm.js.opt b/test/wasm2js/emscripten-grow-no.2asm.js.opt index 998527287..4d6bb4c77 100644 --- a/test/wasm2js/emscripten-grow-no.2asm.js.opt +++ b/test/wasm2js/emscripten-grow-no.2asm.js.opt @@ -63,7 +63,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj"); return asmFunc(asmLibraryArg, wasmMemory.buffer) diff --git a/test/wasm2js/emscripten-grow-yes.2asm.js b/test/wasm2js/emscripten-grow-yes.2asm.js index 3cb5371b1..213524377 100644 --- a/test/wasm2js/emscripten-grow-yes.2asm.js +++ b/test/wasm2js/emscripten-grow-yes.2asm.js @@ -87,7 +87,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj"); return asmFunc(asmLibraryArg, wasmMemory.buffer) diff --git a/test/wasm2js/emscripten-grow-yes.2asm.js.opt b/test/wasm2js/emscripten-grow-yes.2asm.js.opt index 3cb5371b1..213524377 100644 --- a/test/wasm2js/emscripten-grow-yes.2asm.js.opt +++ b/test/wasm2js/emscripten-grow-yes.2asm.js.opt @@ -87,7 +87,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj"); return asmFunc(asmLibraryArg, wasmMemory.buffer) diff --git a/test/wasm2js/emscripten.2asm.js b/test/wasm2js/emscripten.2asm.js index 9d08b03a2..e71aaaa83 100644 --- a/test/wasm2js/emscripten.2asm.js +++ b/test/wasm2js/emscripten.2asm.js @@ -220,7 +220,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1024, "aGVsbG8sIHdvcmxkIQoAAJwMAAAtKyAgIDBYMHgAKG51bGwpAAAAAAAAAAAAAAAAEQAKABEREQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAARAA8KERERAwoHAAETCQsLAAAJBgsAAAsABhEAAAAREREAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAEQAKChEREQAKAAACAAkLAAAACQALAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAADAAAAAAJDAAAAAAADAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAANAAAABA0AAAAACQ4AAAAAAA4AAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAADwAAAAAPAAAAAAkQAAAAAAAQAAAQAAASAAAAEhISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAASEhIAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAKAAAAAAoAAAAACQsAAAAAAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAwMTIzNDU2Nzg5QUJDREVGLTBYKzBYIDBYLTB4KzB4IDB4AGluZgBJTkYAbmFuAE5BTgAuAA=="); base64DecodeToExistingUint8Array(bufferView, 1600, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="); diff --git a/test/wasm2js/emscripten.2asm.js.opt b/test/wasm2js/emscripten.2asm.js.opt index 0e438f81d..05ecfea7d 100644 --- a/test/wasm2js/emscripten.2asm.js.opt +++ b/test/wasm2js/emscripten.2asm.js.opt @@ -201,7 +201,7 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2; if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)]; } - return uint8Array; + return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 1024, "aGVsbG8sIHdvcmxkIQoAAJwMAAAtKyAgIDBYMHgAKG51bGwp"); base64DecodeToExistingUint8Array(bufferView, 1072, "EQAKABEREQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAARAA8KERERAwoHAAETCQsLAAAJBgsAAAsABhEAAAARERE="); diff --git a/test/wasm2js/i64-ctz.2asm.js.opt b/test/wasm2js/i64-ctz.2asm.js.opt index aaacbfc51..9cda827f4 100644 --- a/test/wasm2js/i64-ctz.2asm.js.opt +++ b/test/wasm2js/i64-ctz.2asm.js.opt @@ -30,8 +30,8 @@ function asmFunc(env) { function __wasm_ctz_i64($0, $1) { var $2 = 0, $3 = 0; if ($0 | $1) { - $2 = $1 + -1 | 0; - $3 = $0 + -1 | 0; + $2 = $1 - 1 | 0; + $3 = $0 - 1 | 0; $2 = ($3 | 0) != -1 ? $2 + 1 | 0 : $2; $3 = Math_clz32($0 ^ $3) + 32 | 0; $0 = Math_clz32($1 ^ $2); diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt index b854489b6..272ea822c 100644 --- a/test/wasm2js/unary-ops.2asm.js.opt +++ b/test/wasm2js/unary-ops.2asm.js.opt @@ -26,7 +26,7 @@ function asmFunc(env) { function $7($0) { $0 = $0 | 0; if ($0) { - $0 = 31 - Math_clz32($0 + -1 ^ $0) | 0 + $0 = 31 - Math_clz32($0 - 1 ^ $0) | 0 } else { $0 = 32 } @@ -71,8 +71,8 @@ function asmFunc(env) { function __wasm_ctz_i64($0, $1_1) { var $2 = 0, $3 = 0; if ($0 | $1_1) { - $2 = $1_1 + -1 | 0; - $3 = $0 + -1 | 0; + $2 = $1_1 - 1 | 0; + $3 = $0 - 1 | 0; $2 = ($3 | 0) != -1 ? $2 + 1 | 0 : $2; $3 = Math_clz32($0 ^ $3) + 32 | 0; $0 = Math_clz32($1_1 ^ $2); |