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

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

Issue 1457373002: [turbofan] Implemented the TruncateFloat64ToUint64 TurboFan operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed typos. 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 c6ed018a3a8705e17f92f3b501b6322fc5a1de66..2268ac5371a50a4b66c4b443213967143ec05385 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5364,6 +5364,26 @@ TEST(RunChangeFloat64ToInt64) {
}
+TEST(RunTruncateFloat64ToUint64) {
+ BufferedRawMachineAssemblerTester<uint64_t> m(kMachFloat64);
+ m.Return(m.TruncateFloat64ToUint64(m.Parameter(0)));
+
+ FOR_UINT64_INPUTS(j) {
+ double input = static_cast<double>(*j);
+
+ if (input < 18446744073709551616.0) {
+ CHECK_EQ(static_cast<uint64_t>(input), m.Call(input));
+ }
+ }
+
+ FOR_FLOAT64_INPUTS(i) {
+ if (*i < 18446744073709551616.0 && *i >= 0) {
+ CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i));
+ }
+ }
+}
+
+
TEST(RunRoundInt64ToFloat32) {
BufferedRawMachineAssemblerTester<float> m(kMachInt64);
m.Return(m.RoundInt64ToFloat32(m.Parameter(0)));
« 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