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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 1468303005: [turbofan] Implemented the optional Float32RoundTruncate operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@f32roundup
Patch Set: Apparently std::nearbyint does not exist on all platforms. Created 5 years, 1 month 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 | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index 872c0d8b7bf547352face30ba1d419b8ebae98fc..56f1c4f6fe038eeea5dd4fb7c2c529fa422c595d 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5160,7 +5160,7 @@ TEST(RunFloat64RoundDown1) {
m.Return(m.Float64RoundDown(m.Parameter(0)));
- FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::floor(*i), m.Call(*i)); }
+ FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(floor(*i), m.Call(*i)); }
}
@@ -5172,7 +5172,7 @@ TEST(RunFloat64RoundDown2) {
m.Parameter(0)))));
for (size_t i = 0; i < arraysize(kValues); ++i) {
- CHECK_EQ(std::ceil(kValues[i]), m.Call(kValues[i]));
+ CHECK_EQ(ceil(kValues[i]), m.Call(kValues[i]));
}
}
@@ -5182,7 +5182,7 @@ TEST(RunFloat32RoundUp) {
if (!m.machine()->Float32RoundUp().IsSupported()) return;
m.Return(m.Float32RoundUp(m.Parameter(0)));
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(std::ceil(*i), m.Call(*i)); }
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(ceilf(*i), m.Call(*i)); }
}
@@ -5191,7 +5191,7 @@ TEST(RunFloat64RoundUp) {
if (!m.machine()->Float64RoundUp().IsSupported()) return;
m.Return(m.Float64RoundUp(m.Parameter(0)));
- FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::ceil(*i), m.Call(*i)); }
+ FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), m.Call(*i)); }
}
@@ -5204,6 +5204,16 @@ TEST(RunFloat64RoundTiesEven) {
}
+TEST(RunFloat32RoundTruncate) {
+ BufferedRawMachineAssemblerTester<float> m(kMachFloat32);
+ if (!m.machine()->Float32RoundTruncate().IsSupported()) return;
+
+ m.Return(m.Float32RoundTruncate(m.Parameter(0)));
+
+ FOR_FLOAT32_INPUTS(i) { CheckFloatEq(truncf(*i), m.Call(*i)); }
+}
+
+
TEST(RunFloat64RoundTruncate) {
BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
if (!m.machine()->Float64RoundTruncate().IsSupported()) return;
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698