summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-07 15:29:47 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-07 15:29:47 -0800
commit4ddbf14c65b0217720cc794838a75df8faaeb8c7 (patch)
treeab6c921529c0651faee5164bc5d7213d17f5f0d9
parentf9782b01cd76e76d5921a7e526e2e4577dbf29e4 (diff)
downloadbinaryen-4ddbf14c65b0217720cc794838a75df8faaeb8c7.tar.gz
binaryen-4ddbf14c65b0217720cc794838a75df8faaeb8c7.tar.bz2
binaryen-4ddbf14c65b0217720cc794838a75df8faaeb8c7.zip
emit Math.fround in wasm2asm
-rw-r--r--src/wasm2asm.h1
-rw-r--r--test/emcc_O2_hello_world.2asm.js1
-rw-r--r--test/hello_world.2asm.js1
-rw-r--r--test/min.2asm.js1
-rw-r--r--test/unit.2asm.js1
5 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h
index 9921c3e3e..8555e49ec 100644
--- a/src/wasm2asm.h
+++ b/src/wasm2asm.h
@@ -242,6 +242,7 @@ void Wasm2AsmBuilder::addBasics(Ref ast) {
);
};
addMath(MATH_IMUL, IMUL);
+ addMath(MATH_FROUND, FROUND);
}
void Wasm2AsmBuilder::addImport(Ref ast, Import *import) {
diff --git a/test/emcc_O2_hello_world.2asm.js b/test/emcc_O2_hello_world.2asm.js
index d8b1d0c11..32f41ba64 100644
--- a/test/emcc_O2_hello_world.2asm.js
+++ b/test/emcc_O2_hello_world.2asm.js
@@ -9,6 +9,7 @@ function asmFunc(global, env, 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 abort = env.abort;
var _pthread_cleanup_pop = env._pthread_cleanup_pop;
var _pthread_self = env._pthread_self;
diff --git a/test/hello_world.2asm.js b/test/hello_world.2asm.js
index 46cd7465b..650a4f551 100644
--- a/test/hello_world.2asm.js
+++ b/test/hello_world.2asm.js
@@ -9,6 +9,7 @@ function asmFunc(global, env, 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;
function add(x, y) {
x = x | 0;
y = y | 0;
diff --git a/test/min.2asm.js b/test/min.2asm.js
index 84175c490..512af46fe 100644
--- a/test/min.2asm.js
+++ b/test/min.2asm.js
@@ -9,6 +9,7 @@ function asmFunc(global, env, 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;
function floats(f) {
f = Math_fround(f);
var t = Math_fround(0);
diff --git a/test/unit.2asm.js b/test/unit.2asm.js
index 4c6d4fc2b..1c06b34a4 100644
--- a/test/unit.2asm.js
+++ b/test/unit.2asm.js
@@ -9,6 +9,7 @@ function asmFunc(global, env, 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 f64_to_int = asm2wasm.f64_to_int;
var f64_rem = asm2wasm.f64_rem;
function big_negative() {