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

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

Issue 1479713003: [turbofan] Implemented the TruncateFloat32ToUint64 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 662cde72004f0ac8230c3881f89a89319e3beae3..bf2084a70a3bbbcb22995c59fbee10dceb469b90 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5420,6 +5420,24 @@ TEST(RunTruncateFloat64ToInt64) {
}
+TEST(RunTruncateFloat32ToUint64) {
+ BufferedRawMachineAssemblerTester<uint64_t> m(kMachFloat32);
+ m.Return(m.TruncateFloat32ToUint64(m.Parameter(0)));
+
+ FOR_UINT64_INPUTS(i) {
+ float input = static_cast<float>(*i);
+ if (input < 18446744073709551616.0) {
+ CHECK_EQ(static_cast<uint64_t>(input), m.Call(input));
+ }
+ }
+ FOR_FLOAT32_INPUTS(j) {
+ if (*j < 18446744073709551616.0 && *j >= 0) {
+ CHECK_EQ(static_cast<uint64_t>(*j), m.Call(*j));
+ }
+ }
+}
+
+
TEST(RunTruncateFloat64ToUint64) {
BufferedRawMachineAssemblerTester<uint64_t> m(kMachFloat64);
m.Return(m.TruncateFloat64ToUint64(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