diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-04-18 13:06:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-18 13:06:23 -0700 |
commit | a9808ac6982e88262fc652d0634bf17119e1ee5f (patch) | |
tree | d37487959c6a407f92bbb112a0cea79b1eb2633e /test/wasm2js/float-ops.2asm.js | |
parent | 8dc68bc96db046127d648644daa89f524a668863 (diff) | |
download | binaryen-a9808ac6982e88262fc652d0634bf17119e1ee5f.tar.gz binaryen-a9808ac6982e88262fc652d0634bf17119e1ee5f.tar.bz2 binaryen-a9808ac6982e88262fc652d0634bf17119e1ee5f.zip |
wasm2js: do not try to be smart with not emitting if braces, the corner cases are tricky (#2026)
leave them for later optimizers/minifiers
Diffstat (limited to 'test/wasm2js/float-ops.2asm.js')
-rw-r--r-- | test/wasm2js/float-ops.2asm.js | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/test/wasm2js/float-ops.2asm.js b/test/wasm2js/float-ops.2asm.js index b733043c2..01c6739d1 100644 --- a/test/wasm2js/float-ops.2asm.js +++ b/test/wasm2js/float-ops.2asm.js @@ -333,9 +333,17 @@ function asmFunc(global, env, buffer) { var i64toi32_i32$0 = Math_fround(0), $3_1 = 0, $4_1 = 0, i64toi32_i32$1 = 0; i64toi32_i32$0 = $0; if (Math_fround(Math_abs(i64toi32_i32$0)) >= Math_fround(1.0)) { - if (i64toi32_i32$0 > Math_fround(0.0)) $3_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0; else $3_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0; - $4_1 = $3_1; - } else $4_1 = 0; + { + if (i64toi32_i32$0 > Math_fround(0.0)) { + $3_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 + } else { + $3_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 + } + $4_1 = $3_1; + } + } else { + $4_1 = 0 + } i64toi32_i32$1 = $4_1; return (~~i64toi32_i32$0 >>> 0 | 0) == (0 | 0) & (i64toi32_i32$1 | 0) == (0 | 0) | 0 | 0; } @@ -345,9 +353,17 @@ function asmFunc(global, env, buffer) { var i64toi32_i32$0 = 0.0, $3_1 = 0, $4_1 = 0, i64toi32_i32$1 = 0; i64toi32_i32$0 = $0; if (Math_abs(i64toi32_i32$0) >= 1.0) { - if (i64toi32_i32$0 > 0.0) $3_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0; else $3_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0; - $4_1 = $3_1; - } else $4_1 = 0; + { + if (i64toi32_i32$0 > 0.0) { + $3_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 + } else { + $3_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 + } + $4_1 = $3_1; + } + } else { + $4_1 = 0 + } i64toi32_i32$1 = $4_1; return (~~i64toi32_i32$0 >>> 0 | 0) == (0 | 0) & (i64toi32_i32$1 | 0) == (0 | 0) | 0 | 0; } @@ -357,9 +373,17 @@ function asmFunc(global, env, buffer) { var i64toi32_i32$0 = Math_fround(0), $3_1 = 0, $4_1 = 0, i64toi32_i32$1 = 0; i64toi32_i32$0 = $0; if (Math_fround(Math_abs(i64toi32_i32$0)) >= Math_fround(1.0)) { - if (i64toi32_i32$0 > Math_fround(0.0)) $3_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0; else $3_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0; - $4_1 = $3_1; - } else $4_1 = 0; + { + if (i64toi32_i32$0 > Math_fround(0.0)) { + $3_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 + } else { + $3_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 + } + $4_1 = $3_1; + } + } else { + $4_1 = 0 + } i64toi32_i32$1 = $4_1; return (~~i64toi32_i32$0 >>> 0 | 0) == (0 | 0) & (i64toi32_i32$1 | 0) == (0 | 0) | 0 | 0; } @@ -369,9 +393,17 @@ function asmFunc(global, env, buffer) { var i64toi32_i32$0 = 0.0, $3_1 = 0, $4_1 = 0, i64toi32_i32$1 = 0; i64toi32_i32$0 = $0; if (Math_abs(i64toi32_i32$0) >= 1.0) { - if (i64toi32_i32$0 > 0.0) $3_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0; else $3_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0; - $4_1 = $3_1; - } else $4_1 = 0; + { + if (i64toi32_i32$0 > 0.0) { + $3_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 + } else { + $3_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 + } + $4_1 = $3_1; + } + } else { + $4_1 = 0 + } i64toi32_i32$1 = $4_1; return (~~i64toi32_i32$0 >>> 0 | 0) == (0 | 0) & (i64toi32_i32$1 | 0) == (0 | 0) | 0 | 0; } |