Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: test/cctest/wasm/test-run-wasm.cc

Issue 1661463002: [wasm] Provide backoff implementations for the Fxx rounding instructions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@trunc64-external-reference
Patch Set: rebase. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api-fast-accessor-builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index 66e8206627510b915480d2e5cc72391ea5bfd1d5..088f9fc9e35dc6127e0937c141c491d97ade0cfc 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -2955,41 +2955,34 @@ TEST(Run_Wasm_CallIndirect_NoTable) {
CHECK_TRAP(r.Call(2));
}
-TEST(Run_Wasm_F32Trunc) {
- WasmRunner<float> r(MachineType::Float32());
- BUILD(r, WASM_F32_TRUNC(WASM_GET_LOCAL(0)));
-
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(trunc(*i), r.Call(*i)); }
-}
-
-
-// TODO(titzer): Fix for nosee4 and re-enable.
-#if 0
-
TEST(Run_Wasm_F32Floor) {
WasmRunner<float> r(MachineType::Float32());
BUILD(r, WASM_F32_FLOOR(WASM_GET_LOCAL(0)));
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floor(*i), r.Call(*i)); }
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floorf(*i), r.Call(*i)); }
}
-
TEST(Run_Wasm_F32Ceil) {
WasmRunner<float> r(MachineType::Float32());
BUILD(r, WASM_F32_CEIL(WASM_GET_LOCAL(0)));
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(ceil(*i), r.Call(*i)); }
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(ceilf(*i), r.Call(*i)); }
}
+TEST(Run_Wasm_F32Trunc) {
+ WasmRunner<float> r(MachineType::Float32());
+ BUILD(r, WASM_F32_TRUNC(WASM_GET_LOCAL(0)));
+
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(truncf(*i), r.Call(*i)); }
+}
TEST(Run_Wasm_F32NearestInt) {
WasmRunner<float> r(MachineType::Float32());
BUILD(r, WASM_F32_NEARESTINT(WASM_GET_LOCAL(0)));
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(nearbyint(*i), r.Call(*i)); }
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(nearbyintf(*i), r.Call(*i)); }
}
-
TEST(Run_Wasm_F64Floor) {
WasmRunner<double> r(MachineType::Float64());
BUILD(r, WASM_F64_FLOOR(WASM_GET_LOCAL(0)));
@@ -2997,7 +2990,6 @@ TEST(Run_Wasm_F64Floor) {
FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(floor(*i), r.Call(*i)); }
}
-
TEST(Run_Wasm_F64Ceil) {
WasmRunner<double> r(MachineType::Float64());
BUILD(r, WASM_F64_CEIL(WASM_GET_LOCAL(0)));
@@ -3005,21 +2997,18 @@ TEST(Run_Wasm_F64Ceil) {
FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), r.Call(*i)); }
}
-
-TEST(Run_Wasm_F64NearestInt) {
+TEST(Run_Wasm_F64Trunc) {
WasmRunner<double> r(MachineType::Float64());
- BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0)));
+ BUILD(r, WASM_F64_TRUNC(WASM_GET_LOCAL(0)));
- FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); }
+ FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(trunc(*i), r.Call(*i)); }
}
-#endif
-
-TEST(Run_Wasm_F64Trunc) {
+TEST(Run_Wasm_F64NearestInt) {
WasmRunner<double> r(MachineType::Float64());
- BUILD(r, WASM_F64_TRUNC(WASM_GET_LOCAL(0)));
+ BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0)));
- FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(trunc(*i), r.Call(*i)); }
+ FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); }
}
TEST(Run_Wasm_F32Min) {
« no previous file with comments | « test/cctest/test-api-fast-accessor-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698