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

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

Issue 1507703002: [turbofan] Change TruncateFloat64ToUint64 to TryTruncateFloatToUint64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added mips64 implementation, fixed nits. Created 5 years 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/mips64/macro-assembler-mips64.cc ('k') | test/cctest/compiler/value-helper.h » ('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 24007a83f6cbc4652f367315815354b054864b26..9de669fffeac9303988826dfee818132d62aba52 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5430,7 +5430,7 @@ TEST(RunTryTruncateFloat64ToInt64WithCheck) {
FOR_FLOAT64_INPUTS(i) {
if (*i < 9223372036854775808.0 && *i > -9223372036854775809.0) {
- // Conversions within this range
+ // Conversions within this range should succeed.
CHECK_EQ(static_cast<int64_t>(*i), m.Call(*i));
CHECK_NE(0, success);
} else {
@@ -5459,7 +5459,7 @@ TEST(RunTruncateFloat32ToUint64) {
}
-TEST(RunTruncateFloat64ToUint64) {
+TEST(RunTryTruncateFloat64ToUint64WithoutCheck) {
BufferedRawMachineAssemblerTester<uint64_t> m(kMachFloat64);
m.Return(m.TruncateFloat64ToUint64(m.Parameter(0)));
@@ -5470,10 +5470,26 @@ TEST(RunTruncateFloat64ToUint64) {
CHECK_EQ(static_cast<uint64_t>(input), m.Call(input));
}
}
+}
+
+
+TEST(RunTryTruncateFloat64ToUint64WithCheck) {
+ int64_t success = 0;
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64);
+ Node* trunc = m.TryTruncateFloat64ToUint64(m.Parameter(0));
+ Node* val = m.Projection(0, trunc);
+ Node* check = m.Projection(1, trunc);
+ m.StoreToPointer(&success, kMachInt64, check);
+ m.Return(val);
FOR_FLOAT64_INPUTS(i) {
if (*i < 18446744073709551616.0 && *i >= 0) {
+ // Conversions within this range should succeed.
CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i));
+ CHECK_NE(0, success);
+ } else {
+ m.Call(*i);
+ CHECK_EQ(0, success);
}
}
}
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698