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

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

Issue 1455983002: [turbofan] Implemented the ChangeFloat64ToInt64 TurboFan operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/x64/instruction-selector-x64.cc ('k') | no next file » | 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 08f8f3f4c31da4fb474c7dc3fb056af7c0cfaa53..c6ed018a3a8705e17f92f3b501b6322fc5a1de66 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5346,18 +5346,20 @@ TEST(RunBitcastInt64ToFloat64) {
TEST(RunBitcastFloat64ToInt64) {
- double input = 0;
- int64_t output = 0;
- RawMachineAssemblerTester<int32_t> m;
- m.StoreToPointer(
- &output, kMachInt64,
- m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64)));
- m.Return(m.Int32Constant(11));
- FOR_FLOAT64_INPUTS(i) {
- input = *i;
- CHECK_EQ(11, m.Call());
- double expected = bit_cast<int64_t>(input);
- CHECK_EQ(expected, output);
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64);
+
+ m.Return(m.BitcastFloat64ToInt64(m.Parameter(0)));
+ FOR_FLOAT64_INPUTS(i) { CHECK_EQ(bit_cast<int64_t>(*i), m.Call(*i)); }
+}
+
+
+TEST(RunChangeFloat64ToInt64) {
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64);
+ m.Return(m.ChangeFloat64ToInt64(m.Parameter(0)));
+
+ FOR_INT64_INPUTS(i) {
+ double input = static_cast<double>(*i);
+ CHECK_EQ(static_cast<int64_t>(input), m.Call(input));
}
}
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698