diff options
author | Alex Crichton <alex@alexcrichton.com> | 2018-05-19 16:14:00 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-05-19 14:14:00 -0700 |
commit | d0ce93f8d7a08017618839498a9b920bbb132267 (patch) | |
tree | 752e836fcd09e37c6e7963622ac5d35aa2021d18 /test/wasm2asm/f64_cmp.2asm.js | |
parent | cb64ec3879db3422ac4afd3119938f8dfe7b7b05 (diff) | |
download | binaryen-d0ce93f8d7a08017618839498a9b920bbb132267.tar.gz binaryen-d0ce93f8d7a08017618839498a9b920bbb132267.tar.bz2 binaryen-d0ce93f8d7a08017618839498a9b920bbb132267.zip |
wasm2asm: Finish f32/f64 operations (#1554)
Diffstat (limited to 'test/wasm2asm/f64_cmp.2asm.js')
-rw-r--r-- | test/wasm2asm/f64_cmp.2asm.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/wasm2asm/f64_cmp.2asm.js b/test/wasm2asm/f64_cmp.2asm.js new file mode 100644 index 000000000..7f2df56ff --- /dev/null +++ b/test/wasm2asm/f64_cmp.2asm.js @@ -0,0 +1,66 @@ +function asmFunc(global, env, buffer) { + "use asm"; + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var i64toi32_i32$HIGH_BITS = 0; + function $0(x, y) { + x = +x; + y = +y; + return x == y | 0; + } + + function $1(x, y) { + x = +x; + y = +y; + return x != y | 0; + } + + function $2(x, y) { + x = +x; + y = +y; + return x < y | 0; + } + + function $3(x, y) { + x = +x; + y = +y; + return x <= y | 0; + } + + function $4(x, y) { + x = +x; + y = +y; + return x > y | 0; + } + + function $5(x, y) { + x = +x; + y = +y; + return x >= y | 0; + } + + return { + eq: $0, + ne: $1, + lt: $2, + le: $3, + gt: $4, + ge: $5 + }; +} + |