diff options
Diffstat (limited to 'test/wasm2js/i64-ctz.2asm.js.opt')
-rw-r--r-- | test/wasm2js/i64-ctz.2asm.js.opt | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/test/wasm2js/i64-ctz.2asm.js.opt b/test/wasm2js/i64-ctz.2asm.js.opt index 5fe370d39..fc2e030b9 100644 --- a/test/wasm2js/i64-ctz.2asm.js.opt +++ b/test/wasm2js/i64-ctz.2asm.js.opt @@ -17,52 +17,48 @@ function asmFunc(env) { var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; function legalstub$popcnt64($0, $1) { - $0 = __wasm_popcnt_i64($0, $1); + var $2 = 0, $3 = 0, $4 = 0, $5 = 0; + $2 = $1; + while (1) { + $1 = $3; + $5 = $4; + if ($0 | $2) { + $1 = $0; + $0 = $0 - 1 & $0; + $2 = $2 - ($1 >>> 0 < 1) & $2; + $3 = $3 + 1 | 0; + $4 = $3 >>> 0 < 1 ? $4 + 1 | 0 : $4; + continue; + } + break; + }; + i64toi32_i32$HIGH_BITS = $5; + $0 = $1; setTempRet0(i64toi32_i32$HIGH_BITS | 0); return $0; } function legalstub$ctz64($0, $1) { - $0 = __wasm_ctz_i64($0, $1); - setTempRet0(i64toi32_i32$HIGH_BITS | 0); - return $0; - } - - function __wasm_ctz_i64($0, $1) { - var $2 = 0, $3 = 0; - if ($0 | $1) { - $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); - $0 = ($0 | 0) == 32 ? $3 : $0; - $1 = 63 - $0 | 0; - i64toi32_i32$HIGH_BITS = 0 - ($0 >>> 0 > 63) | 0; - return $1; - } - i64toi32_i32$HIGH_BITS = 0; - return 64; - } - - function __wasm_popcnt_i64($0, $1) { var $2 = 0, $3 = 0, $4 = 0, $5 = 0; - while (1) { - $5 = $4; - $2 = $3; + __inlined_func$__wasm_ctz_i64 : { if ($0 | $1) { - $2 = $0; - $0 = $2 - 1 & $2; - $1 = $1 - ($2 >>> 0 < 1) & $1; - $2 = $4 + 1 | 0; - $3 = $2 >>> 0 < 1 ? $3 + 1 | 0 : $3; + $2 = $1 - 1 | 0; + $3 = $2 + 1 | 0; $4 = $2; - continue; + $2 = $0 - 1 | 0; + $5 = Math_clz32($0 ^ $2) + 32 | 0; + $0 = Math_clz32($1 ^ (($2 | 0) != -1 ? $3 : $4)); + $0 = ($0 | 0) == 32 ? $5 : $0; + $1 = 63 - $0 | 0; + i64toi32_i32$HIGH_BITS = 0 - ($0 >>> 0 > 63) | 0; + $0 = $1; + break __inlined_func$__wasm_ctz_i64; } - break; - }; - i64toi32_i32$HIGH_BITS = $2; - return $5; + i64toi32_i32$HIGH_BITS = 0; + $0 = 64; + } + setTempRet0(i64toi32_i32$HIGH_BITS | 0); + return $0; } return { |