diff options
Diffstat (limited to 'test/wasm2js')
-rw-r--r-- | test/wasm2js/br_table_temp.2asm.js.opt | 111 | ||||
-rw-r--r-- | test/wasm2js/float-ops.2asm.js.opt | 4 | ||||
-rw-r--r-- | test/wasm2js/get-set-local.2asm.js.opt | 6 | ||||
-rw-r--r-- | test/wasm2js/i64-add-sub.2asm.js.opt | 60 | ||||
-rw-r--r-- | test/wasm2js/i64-lowering.2asm.js.opt | 160 | ||||
-rw-r--r-- | test/wasm2js/i64-rotate.2asm.js.opt | 4 | ||||
-rw-r--r-- | test/wasm2js/i64-shifts.2asm.js.opt | 90 | ||||
-rw-r--r-- | test/wasm2js/reinterpret.2asm.js.opt | 16 | ||||
-rw-r--r-- | test/wasm2js/stack-modified.2asm.js.opt | 56 | ||||
-rw-r--r-- | test/wasm2js/unaligned.2asm.js.opt | 57 | ||||
-rw-r--r-- | test/wasm2js/unary-ops.2asm.js.opt | 40 |
11 files changed, 280 insertions, 324 deletions
diff --git a/test/wasm2js/br_table_temp.2asm.js.opt b/test/wasm2js/br_table_temp.2asm.js.opt index 3364ce9ae..b6325ab2e 100644 --- a/test/wasm2js/br_table_temp.2asm.js.opt +++ b/test/wasm2js/br_table_temp.2asm.js.opt @@ -20,7 +20,7 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - function $1() { + function dummy() { } @@ -101,12 +101,6 @@ function asmFunc(global, env, buffer) { function $14($0) { $0 = $0 | 0; - var $1_1 = 0, $2 = 0, $3 = 0, $4 = 0, $5_1 = 0; - $1_1 = 200; - $2 = $1_1; - $3 = $1_1; - $4 = $1_1; - $5_1 = $1_1; block : { block6 : { block7 : { @@ -125,15 +119,15 @@ function asmFunc(global, env, buffer) { break block; }; } - return $1_1 + 10 | 0; + return 210 | 0; } - return $5_1 + 11 | 0; + return 211 | 0; } - return $4 + 12 | 0; + return 212 | 0; } - return $3 + 13 | 0; + return 213 | 0; } - return $2 + 14 | 0; + return 214 | 0; } function $15($0) { @@ -12491,33 +12485,33 @@ function asmFunc(global, env, buffer) { return 7 | 0; } - function $32($0, $1_1) { + function $32($0, $1) { $0 = $0 | 0; - $1_1 = $1_1 | 0; + $1 = $1 | 0; if ($0) { - $1_1 = 3 + $1 = 3 } - return $1_1 | 0; + return $1 | 0; } - function $33($0, $1_1) { + function $33($0, $1) { $0 = $0 | 0; - $1_1 = $1_1 | 0; + $1 = $1 | 0; if (!$0) { - $1_1 = 4 + $1 = 4 } - return $1_1 | 0; + return $1 | 0; } - function $34($0, $1_1) { + function $34($0, $1) { $0 = $0 | 0; - $1_1 = $1_1 | 0; + $1 = $1 | 0; return 5 | 0; } - function $35($0, $1_1) { + function $35($0, $1) { $0 = $0 | 0; - $1_1 = $1_1 | 0; + $1 = $1 | 0; return 6 | 0; } @@ -12595,10 +12589,9 @@ function asmFunc(global, env, buffer) { function $60($0) { $0 = $0 | 0; - var $1_1 = 0, $2 = 0, $3 = 0; - $1_1 = 16; - $2 = $1_1; - $3 = $1_1; + var $1 = 0, $2 = 0; + $1 = 16; + $2 = 16; block : { block11 : { block12 : { @@ -12611,18 +12604,18 @@ function asmFunc(global, env, buffer) { break block; }; } - $3 = $1_1 + 2 | 0; + $2 = 18; } - $2 = $3 + 1 | 0; + $1 = $2 + 1 | 0; } - return $2 | 0; + return $1 | 0; } function $61($0) { $0 = $0 | 0; - var $1_1 = 0, $2 = 0; - $1_1 = 8; - $2 = $1_1; + var $1 = 0, $2 = 0; + $1 = 8; + $2 = 8; block : { block13 : { block14 : { @@ -12635,18 +12628,18 @@ function asmFunc(global, env, buffer) { break block14; }; } - $1_1 = 16; + $2 = 16; } - $2 = $1_1 + 1 | 0; + $1 = $2 + 1 | 0; } - return $2 | 0; + return $1 | 0; } function $62($0) { $0 = $0 | 0; - var $1_1 = 0, $2 = 0; - $1_1 = 8; - $2 = $1_1; + var $1 = 0, $2 = 0; + $1 = 8; + $2 = 8; block : { block15 : { block16 : { @@ -12659,33 +12652,29 @@ function asmFunc(global, env, buffer) { break block; }; } - $1_1 = 16; + $2 = 16; } - $2 = $1_1 + 1 | 0; + $1 = $2 + 1 | 0; } - return $2 | 0; + return $1 | 0; } function $63($0) { $0 = $0 | 0; - var $1_1 = 0, $2 = 0; - $2 = 8; - $1_1 = $2; - block : { - if (!($0 - 1 | 0)) { - break block - } - $1_1 = $2 + 1 | 0; + if ($0 - 1 | 0) { + $0 = 9 + } else { + $0 = 8 } - return $1_1 | 0; + return $0 | 0; } var FUNCTION_TABLE = []; return { - "type_i32": $1, - "type_i64": $1, - "type_f32": $1, - "type_f64": $1, + "type_i32": dummy, + "type_i64": dummy, + "type_f32": dummy, + "type_f64": dummy, "type_i32_value": $5, "type_i64_value": $6, "type_f32_value": $7, @@ -12697,18 +12686,18 @@ function asmFunc(global, env, buffer) { "multiple": $13, "multiple_value": $14, "large": $15, - "as_block_first": $1, - "as_block_mid": $1, - "as_block_last": $1, + "as_block_first": dummy, + "as_block_mid": dummy, + "as_block_last": dummy, "as_block_value": $6, "as_loop_first": $20, "as_loop_mid": $21, "as_loop_last": $22, "as_br_value": $23, - "as_br_if_cond": $1, + "as_br_if_cond": dummy, "as_br_if_value": $25, "as_br_if_value_cond": $23, - "as_br_table_index": $1, + "as_br_table_index": dummy, "as_br_table_value": $28, "as_br_table_value_index": $29, "as_return_value": $30, diff --git a/test/wasm2js/float-ops.2asm.js.opt b/test/wasm2js/float-ops.2asm.js.opt index cc8f90643..416f144d2 100644 --- a/test/wasm2js/float-ops.2asm.js.opt +++ b/test/wasm2js/float-ops.2asm.js.opt @@ -246,12 +246,12 @@ function asmFunc(global, env, buffer) { function $47($0) { $0 = Math_fround($0); - return !(~~$0 >>> 0 | (Math_fround(Math_abs($0)) >= Math_fround(1.0) ? ($0 > Math_fround(0.0) ? ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround($0 / Math_fround(4294967296.0)))), Math_fround(4294967296.0))) >>> 0 : ~~Math_fround(Math_ceil(Math_fround(Math_fround($0 - Math_fround(~~$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0) : 0)) | 0; + return !((Math_fround(Math_abs($0)) >= Math_fround(1.0) ? ($0 > Math_fround(0.0) ? ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround($0 / Math_fround(4294967296.0)))), Math_fround(4294967296.0))) >>> 0 : ~~Math_fround(Math_ceil(Math_fround(Math_fround($0 - Math_fround(~~$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0) : 0) | ~~$0 >>> 0) | 0; } function $48($0) { $0 = +$0; - return !(~~$0 >>> 0 | (Math_abs($0) >= 1.0 ? ($0 > 0.0 ? ~~Math_min(Math_floor($0 / 4294967296.0), 4294967295.0) >>> 0 : ~~Math_ceil(($0 - +(~~$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0) : 0)) | 0; + return !((Math_abs($0) >= 1.0 ? ($0 > 0.0 ? ~~Math_min(Math_floor($0 / 4294967296.0), 4294967295.0) >>> 0 : ~~Math_ceil(($0 - +(~~$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0) : 0) | ~~$0 >>> 0) | 0; } function legalstub$43($0, $1_1) { diff --git a/test/wasm2js/get-set-local.2asm.js.opt b/test/wasm2js/get-set-local.2asm.js.opt index 40a422604..134da55b0 100644 --- a/test/wasm2js/get-set-local.2asm.js.opt +++ b/test/wasm2js/get-set-local.2asm.js.opt @@ -21,7 +21,11 @@ function asmFunc(global, env, buffer) { var nan = global.NaN; var infinity = global.Infinity; function legalstub$1($0, $1, $2) { - return !$2 & ($0 | 0) == ($1 | 0); + var $3 = 0; + $3 = $1; + $1 = $2; + $2 = $3 | 0; + return !$1 & ($0 | 0) == ($2 | 0); } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/i64-add-sub.2asm.js.opt b/test/wasm2js/i64-add-sub.2asm.js.opt index a663c5394..3f4ba759a 100644 --- a/test/wasm2js/i64-add-sub.2asm.js.opt +++ b/test/wasm2js/i64-add-sub.2asm.js.opt @@ -36,52 +36,48 @@ function asmFunc(global, env, buffer) { } function legalstub$1($0, $1_1, $2, $3, $4, $5) { - var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0; - $6 = $0; - $8 = 32; - $0 = $8 & 31; - if (32 >>> 0 <= $8 >>> 0) { - $7 = $1_1 << $0; + var $6 = 0, $7 = 0; + $7 = $0; + $6 = 32; + $0 = $6 & 31; + if (32 >>> 0 <= $6 >>> 0) { + $6 = $1_1 << $0; $0 = 0; } else { - $7 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $7 << $0; + $6 = (1 << $0) - 1 & $1_1 >>> 32 - $0; $0 = $1_1 << $0; } - $8 = $6 | $0; - $7 = $7 | $9; - $6 = $2; - $2 = 0; - $1_1 = $3; - $3 = 32; - $0 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { - $2 = $1_1 << $0; + $7 = $7 | $0; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { + $1_1 = $3 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2 << $0; - $0 = $1_1 << $0; + $1_1 = (1 << $0) - 1 & $3 >>> 32 - $0; + $0 = $3 << $0; } - $6 = $6 | $0; - $9 = $2 | $10; - $2 = 0; - $1_1 = $5; - $0 = 32 & 31; - if (32 >>> 0 <= $3 >>> 0) { - $2 = $1_1 << $0; + $3 = $0 | $2; + $2 = $1_1; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { + $1_1 = $5 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2 << $0; - $0 = $1_1 << $0; + $1_1 = (1 << $0) - 1 & $5 >>> 32 - $0; + $0 = $5 << $0; } - return $1($8, $7, $6, $9, $0 | $4, $2 | $11); + return $1($7, $6, $3, $2, $0 | $4, $1_1); } function legalstub$2($0, $1_1, $2, $3, $4, $5) { var $6 = 0; - $6 = $2; - $2 = $3; - $3 = $6 | 0; - return ($4 | 0) == ($0 - $3 | 0) & ($5 | 0) == ($1_1 - (($0 >>> 0 < $3 >>> 0) + $2 | 0) | 0); + $6 = $0; + $0 = $1_1; + $1_1 = $3; + $3 = $2; + return ($4 | 0) == ($6 - $3 | 0) & ($5 | 0) == ($0 - (($6 >>> 0 < $3 >>> 0) + $1_1 | 0) | 0); } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/i64-lowering.2asm.js.opt b/test/wasm2js/i64-lowering.2asm.js.opt index 99d9885ae..e948447ce 100644 --- a/test/wasm2js/i64-lowering.2asm.js.opt +++ b/test/wasm2js/i64-lowering.2asm.js.opt @@ -61,151 +61,135 @@ function asmFunc(global, env, buffer) { } function legalstub$3($0, $1, $2, $3_1) { - var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7 = 0, $8 = 0; - $6_1 = $0; - $5_1 = 32; - $0 = $5_1 & 31; - if (32 >>> 0 <= $5_1 >>> 0) { + var $4_1 = 0, $5_1 = 0; + $5_1 = $0; + $4_1 = 32; + $0 = $4_1 & 31; + if (32 >>> 0 <= $4_1 >>> 0) { $4_1 = $1 << $0; $0 = 0; } else { - $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0 | $4_1 << $0; + $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0; $0 = $1 << $0; } - $5_1 = $6_1 | $0; - $4_1 = $4_1 | $7; - $6_1 = $2; - $2 = 0; - $1 = $3_1; - $3_1 = 32; - $0 = $3_1 & 31; - if (32 >>> 0 <= $3_1 >>> 0) { - $2 = $1 << $0; + $5_1 = $5_1 | $0; + $1 = 32; + $0 = $1 & 31; + if (32 >>> 0 <= $1 >>> 0) { + $1 = $3_1 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1 >>> 32 - $0 | $2 << $0; - $0 = $1 << $0; + $1 = (1 << $0) - 1 & $3_1 >>> 32 - $0; + $0 = $3_1 << $0; } - return $3($5_1, $4_1, $6_1 | $0, $2 | $8); + return $3($5_1, $4_1, $0 | $2, $1); } function legalstub$4($0, $1, $2, $3_1) { - var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7 = 0, $8 = 0; - $6_1 = $0; - $5_1 = 32; - $0 = $5_1 & 31; - if (32 >>> 0 <= $5_1 >>> 0) { + var $4_1 = 0, $5_1 = 0; + $5_1 = $0; + $4_1 = 32; + $0 = $4_1 & 31; + if (32 >>> 0 <= $4_1 >>> 0) { $4_1 = $1 << $0; $0 = 0; } else { - $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0 | $4_1 << $0; + $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0; $0 = $1 << $0; } - $5_1 = $6_1 | $0; - $4_1 = $4_1 | $7; - $6_1 = $2; - $2 = 0; - $1 = $3_1; - $3_1 = 32; - $0 = $3_1 & 31; - if (32 >>> 0 <= $3_1 >>> 0) { - $2 = $1 << $0; + $5_1 = $5_1 | $0; + $1 = 32; + $0 = $1 & 31; + if (32 >>> 0 <= $1 >>> 0) { + $1 = $3_1 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1 >>> 32 - $0 | $2 << $0; - $0 = $1 << $0; + $1 = (1 << $0) - 1 & $3_1 >>> 32 - $0; + $0 = $3_1 << $0; } - return $4($5_1, $4_1, $6_1 | $0, $2 | $8); + return $4($5_1, $4_1, $0 | $2, $1); } function legalstub$5($0, $1, $2, $3_1) { - var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7 = 0, $8 = 0; - $6_1 = $0; - $5_1 = 32; - $0 = $5_1 & 31; - if (32 >>> 0 <= $5_1 >>> 0) { + var $4_1 = 0, $5_1 = 0; + $5_1 = $0; + $4_1 = 32; + $0 = $4_1 & 31; + if (32 >>> 0 <= $4_1 >>> 0) { $4_1 = $1 << $0; $0 = 0; } else { - $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0 | $4_1 << $0; + $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0; $0 = $1 << $0; } - $5_1 = $6_1 | $0; - $4_1 = $4_1 | $7; - $6_1 = $2; - $2 = 0; - $1 = $3_1; - $3_1 = 32; - $0 = $3_1 & 31; - if (32 >>> 0 <= $3_1 >>> 0) { - $2 = $1 << $0; + $5_1 = $5_1 | $0; + $1 = 32; + $0 = $1 & 31; + if (32 >>> 0 <= $1 >>> 0) { + $1 = $3_1 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1 >>> 32 - $0 | $2 << $0; - $0 = $1 << $0; + $1 = (1 << $0) - 1 & $3_1 >>> 32 - $0; + $0 = $3_1 << $0; } - return $5($5_1, $4_1, $6_1 | $0, $2 | $8); + return $5($5_1, $4_1, $0 | $2, $1); } function legalstub$6($0, $1, $2, $3_1) { - var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7 = 0, $8 = 0; - $6_1 = $0; - $5_1 = 32; - $0 = $5_1 & 31; - if (32 >>> 0 <= $5_1 >>> 0) { + var $4_1 = 0, $5_1 = 0; + $5_1 = $0; + $4_1 = 32; + $0 = $4_1 & 31; + if (32 >>> 0 <= $4_1 >>> 0) { $4_1 = $1 << $0; $0 = 0; } else { - $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0 | $4_1 << $0; + $4_1 = (1 << $0) - 1 & $1 >>> 32 - $0; $0 = $1 << $0; } - $5_1 = $6_1 | $0; - $4_1 = $4_1 | $7; - $6_1 = $2; - $2 = 0; - $1 = $3_1; - $3_1 = 32; - $0 = $3_1 & 31; - if (32 >>> 0 <= $3_1 >>> 0) { - $2 = $1 << $0; + $5_1 = $5_1 | $0; + $1 = 32; + $0 = $1 & 31; + if (32 >>> 0 <= $1 >>> 0) { + $1 = $3_1 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1 >>> 32 - $0 | $2 << $0; - $0 = $1 << $0; + $1 = (1 << $0) - 1 & $3_1 >>> 32 - $0; + $0 = $3_1 << $0; } - return $6($5_1, $4_1, $6_1 | $0, $2 | $8); + return $6($5_1, $4_1, $0 | $2, $1); } function legalstub$7($0, $1, $2, $3_1) { var $4_1 = 0; - $4_1 = $2; - $2 = $3_1; - $3_1 = $4_1 | 0; - return ($1 | 0) == ($2 | 0) & $0 >>> 0 >= $3_1 >>> 0 | $1 >>> 0 > $2 >>> 0; + $4_1 = $0; + $0 = $1; + $1 = $3_1; + return ($0 | 0) == ($1 | 0) & $4_1 >>> 0 >= $2 >>> 0 | $0 >>> 0 > $1 >>> 0; } function legalstub$8($0, $1, $2, $3_1) { var $4_1 = 0; - $4_1 = $2; - $2 = $3_1; - $3_1 = $4_1 | 0; - return ($1 | 0) == ($2 | 0) & $0 >>> 0 > $3_1 >>> 0 | $1 >>> 0 > $2 >>> 0; + $4_1 = $0; + $0 = $1; + $1 = $3_1; + return ($0 | 0) == ($1 | 0) & $4_1 >>> 0 > $2 >>> 0 | $0 >>> 0 > $1 >>> 0; } function legalstub$9($0, $1, $2, $3_1) { var $4_1 = 0; - $4_1 = $2; - $2 = $3_1; - $3_1 = $4_1 | 0; - return ($1 | 0) == ($2 | 0) & $0 >>> 0 <= $3_1 >>> 0 | $1 >>> 0 < $2 >>> 0; + $4_1 = $0; + $0 = $1; + $1 = $3_1; + return ($0 | 0) == ($1 | 0) & $4_1 >>> 0 <= $2 >>> 0 | $0 >>> 0 < $1 >>> 0; } function legalstub$10($0, $1, $2, $3_1) { var $4_1 = 0; - $4_1 = $2; - $2 = $3_1; - $3_1 = $4_1 | 0; - return ($1 | 0) == ($2 | 0) & $0 >>> 0 < $3_1 >>> 0 | $1 >>> 0 < $2 >>> 0; + $4_1 = $0; + $0 = $1; + $1 = $3_1; + return ($0 | 0) == ($1 | 0) & $4_1 >>> 0 < $2 >>> 0 | $0 >>> 0 < $1 >>> 0; } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/i64-rotate.2asm.js.opt b/test/wasm2js/i64-rotate.2asm.js.opt index 238728c4e..d2a2c81ad 100644 --- a/test/wasm2js/i64-rotate.2asm.js.opt +++ b/test/wasm2js/i64-rotate.2asm.js.opt @@ -54,7 +54,7 @@ function asmFunc(global, env, buffer) { $4 = 0 - $2 & 63; $3 = $4; $2 = $3 & 31; - if (32 >>> 0 <= ($3 & 63) >>> 0) { + if (32 >>> 0 <= $3 >>> 0) { $3 = -1 << $2; $2 = 0; } else { @@ -100,7 +100,7 @@ function asmFunc(global, env, buffer) { $7 = $4; $3 = 0 - $2 & 63; $5 = $3 & 31; - if (32 >>> 0 <= ($3 & 63) >>> 0) { + if (32 >>> 0 <= $3 >>> 0) { $4 = 0; $2 = -1 >>> $5; } else { diff --git a/test/wasm2js/i64-shifts.2asm.js.opt b/test/wasm2js/i64-shifts.2asm.js.opt index bd51d9273..a6606ec41 100644 --- a/test/wasm2js/i64-shifts.2asm.js.opt +++ b/test/wasm2js/i64-shifts.2asm.js.opt @@ -57,79 +57,69 @@ function asmFunc(global, env, buffer) { } function legalstub$1($0, $1_1, $2_1, $3, $4, $5) { - var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0; - $6 = $0; - $8 = 32; - $0 = $8 & 31; - if (32 >>> 0 <= $8 >>> 0) { - $7 = $1_1 << $0; + var $6 = 0, $7 = 0; + $7 = $0; + $6 = 32; + $0 = $6 & 31; + if (32 >>> 0 <= $6 >>> 0) { + $6 = $1_1 << $0; $0 = 0; } else { - $7 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $7 << $0; + $6 = (1 << $0) - 1 & $1_1 >>> 32 - $0; $0 = $1_1 << $0; } - $8 = $6 | $0; - $7 = $7 | $9; - $6 = $2_1; - $2_1 = 0; - $1_1 = $3; - $3 = 32; - $0 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { + $7 = $7 | $0; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { $0 = 0 } else { - $0 = $1_1 << $0 + $0 = $3 << $0 } - $6 = $6 | $0; - $2_1 = 0; - $1_1 = $5; - $0 = 32 & 31; - if (32 >>> 0 <= $3 >>> 0) { - $2_1 = $1_1 << $0; + $2_1 = $0 | $2_1; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { + $1_1 = $5 << $0; $0 = 0; } else { - $2_1 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2_1 << $0; - $0 = $1_1 << $0; + $1_1 = (1 << $0) - 1 & $5 >>> 32 - $0; + $0 = $5 << $0; } - return $1($8, $7, $6, $0 | $4, $2_1 | $10); + return $1($7, $6, $2_1, $0 | $4, $1_1); } function legalstub$2($0, $1_1, $2_1, $3, $4, $5) { - var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0; - $6 = $0; - $8 = 32; - $0 = $8 & 31; - if (32 >>> 0 <= $8 >>> 0) { - $7 = $1_1 << $0; + var $6 = 0, $7 = 0; + $7 = $0; + $6 = 32; + $0 = $6 & 31; + if (32 >>> 0 <= $6 >>> 0) { + $6 = $1_1 << $0; $0 = 0; } else { - $7 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $7 << $0; + $6 = (1 << $0) - 1 & $1_1 >>> 32 - $0; $0 = $1_1 << $0; } - $8 = $6 | $0; - $7 = $7 | $9; - $6 = $2_1; - $2_1 = 0; - $1_1 = $3; - $3 = 32; - $0 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { + $7 = $7 | $0; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { $0 = 0 } else { - $0 = $1_1 << $0 + $0 = $3 << $0 } - $6 = $6 | $0; - $2_1 = 0; - $1_1 = $5; - $0 = 32 & 31; - if (32 >>> 0 <= $3 >>> 0) { - $2_1 = $1_1 << $0; + $2_1 = $0 | $2_1; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { + $1_1 = $5 << $0; $0 = 0; } else { - $2_1 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2_1 << $0; - $0 = $1_1 << $0; + $1_1 = (1 << $0) - 1 & $5 >>> 32 - $0; + $0 = $5 << $0; } - return $2($8, $7, $6, $0 | $4, $2_1 | $10); + return $2($7, $6, $2_1, $0 | $4, $1_1); } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/reinterpret.2asm.js.opt b/test/wasm2js/reinterpret.2asm.js.opt index 0088be0be..4c9856ca0 100644 --- a/test/wasm2js/reinterpret.2asm.js.opt +++ b/test/wasm2js/reinterpret.2asm.js.opt @@ -52,7 +52,7 @@ function asmFunc(global, env, buffer) { var infinity = global.Infinity; function $1($0) { $0 = $0 | 0; - return ($0 | 0) == ((wasm2js_scratch_store_f32((wasm2js_scratch_store_i32(0, $0), wasm2js_scratch_load_f32())), wasm2js_scratch_load_i32(0)) | 0) | 0; + return ((wasm2js_scratch_store_f32((wasm2js_scratch_store_i32(0, $0), wasm2js_scratch_load_f32())), wasm2js_scratch_load_i32(0)) | 0) == ($0 | 0) | 0; } function $2($0, $1_1) { @@ -67,18 +67,18 @@ function asmFunc(global, env, buffer) { } function legalstub$2($0, $1_1) { - var $2_1 = 0, $3 = 0, $4 = 0, $5 = 0; - $4 = $0; - $3 = 32; - $0 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { + var $2_1 = 0, $3 = 0; + $3 = $0; + $2_1 = 32; + $0 = $2_1 & 31; + if (32 >>> 0 <= $2_1 >>> 0) { $2_1 = $1_1 << $0; $0 = 0; } else { - $2_1 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2_1 << $0; + $2_1 = (1 << $0) - 1 & $1_1 >>> 32 - $0; $0 = $1_1 << $0; } - return $2($4 | $0, $2_1 | $5); + return $2($3 | $0, $2_1); } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/stack-modified.2asm.js.opt b/test/wasm2js/stack-modified.2asm.js.opt index b31f4f147..baabfe868 100644 --- a/test/wasm2js/stack-modified.2asm.js.opt +++ b/test/wasm2js/stack-modified.2asm.js.opt @@ -45,53 +45,53 @@ function asmFunc(global, env, buffer) { } function legalstub$0($0_1, $1) { - var $2 = 0, $3 = 0, $4 = 0, $5 = 0; - $4 = $0_1; - $3 = 32; - $0_1 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { + var $2 = 0, $3 = 0; + $3 = $0_1; + $2 = 32; + $0_1 = $2 & 31; + if (32 >>> 0 <= $2 >>> 0) { $2 = $1 << $0_1; $0_1 = 0; } else { - $2 = (1 << $0_1) - 1 & $1 >>> 32 - $0_1 | $2 << $0_1; + $2 = (1 << $0_1) - 1 & $1 >>> 32 - $0_1; $0_1 = $1 << $0_1; } - $1 = $0($4 | $0_1, $2 | $5); - $2 = i64toi32_i32$HIGH_BITS; - $0_1 = 32 & 31; - setTempRet0((32 >>> 0 <= $3 >>> 0 ? $2 >>> $0_1 : ((1 << $0_1) - 1 & $2) << 32 - $0_1 | $1 >>> $0_1) | 0); - return $1; + $0_1 = $0($3 | $0_1, $2); + $1 = i64toi32_i32$HIGH_BITS; + $3 = 32; + $2 = $3 & 31; + setTempRet0((32 >>> 0 <= $3 >>> 0 ? $1 >>> $2 : ((1 << $2) - 1 & $1) << 32 - $2 | $0_1 >>> $2) | 0); + return $0_1; } function _ZN17compiler_builtins3int3mul3Mul3mul17h070e9a1c69faec5bE($0_1, $1, $2, $3) { var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0; - $5 = $2 >>> 16; - $6 = $0_1 >>> 16; - $4 = Math_imul($5, $6); - $8 = $2 & 65535; - $7 = $0_1 & 65535; - $9 = Math_imul($8, $7); - $6 = ($9 >>> 16) + Math_imul($6, $8) | 0; - $5 = ($6 & 65535) + Math_imul($5, $7) | 0; - $8 = 0; - $10 = $4; - $7 = $0_1; - $4 = 32; - $0_1 = $4 & 31; - $4 = $10 + Math_imul(32 >>> 0 <= $4 >>> 0 ? $1 >>> $0_1 : ((1 << $0_1) - 1 & $1) << 32 - $0_1 | $7 >>> $0_1, $2) | 0; + $6 = $2 >>> 16; + $10 = $0_1; + $7 = $0_1 >>> 16; + $5 = Math_imul($6, $7); + $4 = $2 & 65535; + $8 = $0_1 & 65535; + $9 = Math_imul($4, $8); + $7 = ($9 >>> 16) + Math_imul($4, $7) | 0; + $6 = ($7 & 65535) + Math_imul($6, $8) | 0; + $8 = $5; + $5 = 32; + $4 = $5 & 31; + $5 = $8 + Math_imul(32 >>> 0 <= $5 >>> 0 ? $1 >>> $4 : ((1 << $4) - 1 & $1) << 32 - $4 | $0_1 >>> $4, $2) | 0; $1 = $2; $2 = 32; $0_1 = $2 & 31; - $1 = (($4 + Math_imul($7, 32 >>> 0 <= $2 >>> 0 ? $3 >>> $0_1 : ((1 << $0_1) - 1 & $3) << 32 - $0_1 | $1 >>> $0_1) | 0) + ($6 >>> 16) | 0) + ($5 >>> 16) | 0; + $1 = (($5 + Math_imul($10, 32 >>> 0 <= $2 >>> 0 ? $3 >>> $0_1 : ((1 << $0_1) - 1 & $3) << 32 - $0_1 | $1 >>> $0_1) | 0) + ($7 >>> 16) | 0) + ($6 >>> 16) | 0; $0_1 = 32 & 31; if (32 >>> 0 <= $2 >>> 0) { $2 = $1 << $0_1; $0_1 = 0; } else { - $2 = (1 << $0_1) - 1 & $1 >>> 32 - $0_1 | $8 << $0_1; + $2 = (1 << $0_1) - 1 & $1 >>> 32 - $0_1; $0_1 = $1 << $0_1; } - $0_1 = $0_1 | ($9 & 65535 | $5 << 16); + $0_1 = $0_1 | ($9 & 65535 | $6 << 16); i64toi32_i32$HIGH_BITS = $2; return $0_1; } diff --git a/test/wasm2js/unaligned.2asm.js.opt b/test/wasm2js/unaligned.2asm.js.opt index 379067cca..bbca2c8bf 100644 --- a/test/wasm2js/unaligned.2asm.js.opt +++ b/test/wasm2js/unaligned.2asm.js.opt @@ -50,64 +50,57 @@ function asmFunc(global, env, buffer) { var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; function $0() { - var $0_1 = 0; - return HEAPU8[0 | 0] | HEAPU8[$0_1 + 1 | 0] << 8 | (HEAPU8[$0_1 + 2 | 0] << 16 | HEAPU8[$0_1 + 3 | 0] << 24); + return HEAPU8[0 | 0] | HEAPU8[1 | 0] << 8 | (HEAPU8[2 | 0] << 16 | HEAPU8[3 | 0] << 24); } function $1() { - var $0_1 = 0, $1_1 = 0; - $0_1 = HEAPU8[0 | 0] | HEAPU8[$0_1 + 1 | 0] << 8 | (HEAPU8[$0_1 + 2 | 0] << 16 | HEAPU8[$0_1 + 3 | 0] << 24); - i64toi32_i32$HIGH_BITS = HEAPU8[$1_1 + 4 | 0] | HEAPU8[$1_1 + 5 | 0] << 8 | (HEAPU8[$1_1 + 6 | 0] << 16 | HEAPU8[$1_1 + 7 | 0] << 24); - return $0_1 | 0; + i64toi32_i32$HIGH_BITS = HEAPU8[4 | 0] | HEAPU8[5 | 0] << 8 | (HEAPU8[6 | 0] << 16 | HEAPU8[7 | 0] << 24); + return HEAPU8[0 | 0] | HEAPU8[1 | 0] << 8 | (HEAPU8[2 | 0] << 16 | HEAPU8[3 | 0] << 24); } function $2() { - var $0_1 = 0; - return Math_fround((wasm2js_scratch_store_i32(0, HEAPU8[0 | 0] | HEAPU8[$0_1 + 1 | 0] << 8 | (HEAPU8[$0_1 + 2 | 0] << 16 | HEAPU8[$0_1 + 3 | 0] << 24)), wasm2js_scratch_load_f32())); + return Math_fround((wasm2js_scratch_store_i32(0, HEAPU8[0 | 0] | HEAPU8[1 | 0] << 8 | (HEAPU8[2 | 0] << 16 | HEAPU8[3 | 0] << 24)), wasm2js_scratch_load_f32())); } function $3() { - var $0_1 = 0, $1_1 = 0; - $1_1 = HEAPU8[0 | 0] | HEAPU8[$1_1 + 1 | 0] << 8 | (HEAPU8[$1_1 + 2 | 0] << 16 | HEAPU8[$1_1 + 3 | 0] << 24); - $0_1 = HEAPU8[$0_1 + 4 | 0] | HEAPU8[$0_1 + 5 | 0] << 8 | (HEAPU8[$0_1 + 6 | 0] << 16 | HEAPU8[$0_1 + 7 | 0] << 24); - wasm2js_scratch_store_i32(0 | 0, $1_1 | 0); + var $0_1 = 0; + $0_1 = HEAPU8[4 | 0] | HEAPU8[5 | 0] << 8 | (HEAPU8[6 | 0] << 16 | HEAPU8[7 | 0] << 24); + wasm2js_scratch_store_i32(0 | 0, HEAPU8[0 | 0] | HEAPU8[1 | 0] << 8 | (HEAPU8[2 | 0] << 16 | HEAPU8[3 | 0] << 24)); wasm2js_scratch_store_i32(1 | 0, $0_1 | 0); return +wasm2js_scratch_load_f64(); } function $4() { - var $0_1 = 0, $1_1 = 0; HEAP8[0 | 0] = 0; - HEAP8[$0_1 + 1 | 0] = $1_1 >>> 8; - HEAP8[$0_1 + 2 | 0] = $1_1 >>> 16; - HEAP8[$0_1 + 3 | 0] = $1_1 >>> 24; + HEAP8[1 | 0] = 0; + HEAP8[2 | 0] = 0; + HEAP8[3 | 0] = 0; } function $5() { - var $0_1 = 0, $1_1 = 0, $2_1 = 0; HEAP8[0 | 0] = 0; - HEAP8[$0_1 + 1 | 0] = $2_1 >>> 8; - HEAP8[$0_1 + 2 | 0] = $2_1 >>> 16; - HEAP8[$0_1 + 3 | 0] = $2_1 >>> 24; - HEAP8[$1_1 + 4 | 0] = 0; - HEAP8[$1_1 + 5 | 0] = $0_1 >>> 8; - HEAP8[$1_1 + 6 | 0] = $0_1 >>> 16; - HEAP8[$1_1 + 7 | 0] = $0_1 >>> 24; + HEAP8[1 | 0] = 0; + HEAP8[2 | 0] = 0; + HEAP8[3 | 0] = 0; + HEAP8[4 | 0] = 0; + HEAP8[5 | 0] = 0; + HEAP8[6 | 0] = 0; + HEAP8[7 | 0] = 0; } function $7() { - var $0_1 = 0, $1_1 = 0, $2_1 = 0, $3_1 = 0; + var $0_1 = 0, $1_1 = 0; wasm2js_scratch_store_f64(0.0); $0_1 = wasm2js_scratch_load_i32(1 | 0) | 0; $1_1 = wasm2js_scratch_load_i32(0 | 0) | 0; HEAP8[0 | 0] = $1_1; - HEAP8[$3_1 + 1 | 0] = $1_1 >>> 8; - HEAP8[$3_1 + 2 | 0] = $1_1 >>> 16; - HEAP8[$3_1 + 3 | 0] = $1_1 >>> 24; - HEAP8[$2_1 + 4 | 0] = $0_1; - HEAP8[$2_1 + 5 | 0] = $0_1 >>> 8; - HEAP8[$2_1 + 6 | 0] = $0_1 >>> 16; - HEAP8[$2_1 + 7 | 0] = $0_1 >>> 24; + HEAP8[1 | 0] = $1_1 >>> 8; + HEAP8[2 | 0] = $1_1 >>> 16; + HEAP8[3 | 0] = $1_1 >>> 24; + HEAP8[4 | 0] = $0_1; + HEAP8[5 | 0] = $0_1 >>> 8; + HEAP8[6 | 0] = $0_1 >>> 16; + HEAP8[7 | 0] = $0_1 >>> 24; } function legalstub$1() { diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt index 56bf1eae2..7dcc1c85c 100644 --- a/test/wasm2js/unary-ops.2asm.js.opt +++ b/test/wasm2js/unary-ops.2asm.js.opt @@ -34,7 +34,7 @@ function asmFunc(global, env, buffer) { function $7($0) { $0 = $0 | 0; if ($0) { - $0 = 31 - Math_clz32($0 ^ $0 + -1) | 0 + $0 = 31 - Math_clz32($0 + -1 ^ $0) | 0 } else { $0 = 32 } @@ -57,7 +57,11 @@ function asmFunc(global, env, buffer) { } function legalstub$3($0, $1_1, $2) { - return !$2 & ($0 | 0) == ($1_1 | 0); + var $3 = 0; + $3 = $1_1; + $1_1 = $2; + $2 = $3 | 0; + return !$1_1 & ($0 | 0) == ($2 | 0); } function legalstub$4($0, $1_1, $2) { @@ -69,32 +73,28 @@ function asmFunc(global, env, buffer) { } function legalstub$8($0, $1_1, $2, $3) { - var $4 = 0, $5 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0; - $6_1 = $0; - $5 = 32; - $0 = $5 & 31; - if (32 >>> 0 <= $5 >>> 0) { + var $4 = 0, $5 = 0; + $5 = $0; + $4 = 32; + $0 = $4 & 31; + if (32 >>> 0 <= $4 >>> 0) { $4 = $1_1 << $0; $0 = 0; } else { - $4 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $4 << $0; + $4 = (1 << $0) - 1 & $1_1 >>> 32 - $0; $0 = $1_1 << $0; } - $5 = $6_1 | $0; - $4 = $4 | $7_1; - $6_1 = $2; - $2 = 0; - $1_1 = $3; - $3 = 32; - $0 = $3 & 31; - if (32 >>> 0 <= $3 >>> 0) { - $2 = $1_1 << $0; + $5 = $5 | $0; + $1_1 = 32; + $0 = $1_1 & 31; + if (32 >>> 0 <= $1_1 >>> 0) { + $1_1 = $3 << $0; $0 = 0; } else { - $2 = (1 << $0) - 1 & $1_1 >>> 32 - $0 | $2 << $0; - $0 = $1_1 << $0; + $1_1 = (1 << $0) - 1 & $3 >>> 32 - $0; + $0 = $3 << $0; } - return $8($5, $4, $6_1 | $0, $2 | $8_1); + return $8($5, $4, $0 | $2, $1_1); } function legalstub$9($0, $1_1, $2, $3) { |