summaryrefslogtreecommitdiff
path: root/test/float_ops_precise.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-11-04 14:55:32 -0700
committerGitHub <noreply@github.com>2016-11-04 14:55:32 -0700
commit5af71eea09abfa9078c62633cea89b121ec4ec08 (patch)
tree73b6ed0baa0c644a1fa7e34228546587a1f297d4 /test/float_ops_precise.cpp
parent22699ebad0972fa7604dd8ffd26f9f6607e82fb0 (diff)
downloadbinaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.tar.gz
binaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.tar.bz2
binaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.zip
Fixes fround of an unsigned integer (#821)
* fix fround of unsigned * add testing for f32 ops, and remove a duplicate test (now that f32 is on by default in wasm, we don't need to check with and without PRECISE_F32) * update wasm.js and binaryen.js
Diffstat (limited to 'test/float_ops_precise.cpp')
-rw-r--r--test/float_ops_precise.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/test/float_ops_precise.cpp b/test/float_ops_precise.cpp
deleted file mode 100644
index ddd8bcae6..000000000
--- a/test/float_ops_precise.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <cmath>
-#include <algorithm>
-#include <emscripten.h>
-
-extern "C" {
-
-// unary
-double EMSCRIPTEN_KEEPALIVE dneg(double x) { return -x; }
-double EMSCRIPTEN_KEEPALIVE dfloor(double x) { return floor(x); }
-
-// binary
-double EMSCRIPTEN_KEEPALIVE dadd(double x, double y) { return x + y; }
-double EMSCRIPTEN_KEEPALIVE dsub(double x, double y) { return x - y; }
-double EMSCRIPTEN_KEEPALIVE dmul(double x, double y) { return x * y; }
-double EMSCRIPTEN_KEEPALIVE ddiv(double x, double y) { return x / y; }
-double EMSCRIPTEN_KEEPALIVE dcopysign(double x, double y) { return std::copysign(x, y); }
-double EMSCRIPTEN_KEEPALIVE dmin(double x, double y) { return std::min(x, y); }
-double EMSCRIPTEN_KEEPALIVE dmax(double x, double y) { return std::max(x, y); }
-
-// comparisons
-int EMSCRIPTEN_KEEPALIVE deq(double x, double y) { return x == y; }
-int EMSCRIPTEN_KEEPALIVE dne(double x, double y) { return x != y; }
-int EMSCRIPTEN_KEEPALIVE dlt(double x, double y) { return x < y; }
-int EMSCRIPTEN_KEEPALIVE dle(double x, double y) { return x <= y; }
-int EMSCRIPTEN_KEEPALIVE dgt(double x, double y) { return x > y; }
-int EMSCRIPTEN_KEEPALIVE dge(double x, double y) { return x >= y; }
-
-double EMSCRIPTEN_KEEPALIVE int_to_double(int x) {
- double d = x;
- return d + 1.23;
-}
-
-double EMSCRIPTEN_KEEPALIVE uint_to_double(unsigned x) {
- double d = x;
- return d + 1.23;
-}
-
-int EMSCRIPTEN_KEEPALIVE double_to_int(double d) {
- d += 1.23;
- int x = d;
- return x;
-}
-
-}
-