diff options
Diffstat (limited to 'test/hello_world.2asm.js')
-rw-r--r-- | test/hello_world.2asm.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/hello_world.2asm.js b/test/hello_world.2asm.js index c11126e24..f118213f4 100644 --- a/test/hello_world.2asm.js +++ b/test/hello_world.2asm.js @@ -18,6 +18,44 @@ function asmFunc(global, env, buffer) { return x + y | 0 | 0; } + function __wasm_ctz_i32(x) { + x = x | 0; + var wasm2asm_i32$0 = 0; + if ((x | 0) == (0 | 0)) wasm2asm_i32$0 = 32; else wasm2asm_i32$0 = 31 - Math_clz32(x ^ (x - 1 | 0) | 0) | 0; + return wasm2asm_i32$0 | 0; + } + + function __wasm_popcnt_i32(x) { + x = x | 0; + var count = 0, wasm2asm_i32$0 = 0; + count = 0; + b : { + l : do { + if ((x | 0) == (0 | 0)) { + wasm2asm_i32$0 = count; + break b; + } + x = x & (x - 1 | 0) | 0; + count = count + 1 | 0; + continue l; + break l; + } while (1); + }; + return wasm2asm_i32$0 | 0; + } + + function __wasm_rotl_i32(x, k) { + x = x | 0; + k = k | 0; + return ((4294967295 >>> (k & 31 | 0) | 0) & x | 0) << (k & 31 | 0) | 0 | (((4294967295 << (32 - (k & 31 | 0) | 0) | 0) & x | 0) >>> (32 - (k & 31 | 0) | 0) | 0) | 0 | 0; + } + + function __wasm_rotr_i32(x, k) { + x = x | 0; + k = k | 0; + return ((4294967295 << (k & 31 | 0) | 0) & x | 0) >>> (k & 31 | 0) | 0 | (((4294967295 >>> (32 - (k & 31 | 0) | 0) | 0) & x | 0) << (32 - (k & 31 | 0) | 0) | 0) | 0 | 0; + } + return { add: add }; |