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

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

Issue 1533503002: [turbofan] Fixed the second return value of TryTruncateFloatXXToUint64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code cleanup 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 2c093f987c049571bfef06a60b592e5731780ff3..77e6142dd8f1a44a92797d2000948c0ae3e82032 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5529,21 +5529,18 @@ TEST(RunTryTruncateFloat64ToInt64WithCheck) {
}
-TEST(RunTruncateFloat32ToUint64) {
+TEST(RunTryTruncateFloat32ToUint64WithoutCheck) {
BufferedRawMachineAssemblerTester<uint64_t> m(MachineType::Float32());
m.Return(m.TryTruncateFloat32ToUint64(m.Parameter(0)));
FOR_UINT64_INPUTS(i) {
float input = static_cast<float>(*i);
- if (input < 18446744073709551616.0) {
+ // This condition on 'input' is required because
+ // static_cast<float>(UINT64_MAX) results in a value outside uint64 range.
+ if (input < static_cast<float>(UINT64_MAX)) {
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));
- }
- }
}
@@ -5557,7 +5554,7 @@ TEST(RunTryTruncateFloat32ToUint64WithCheck) {
m.Return(val);
FOR_FLOAT32_INPUTS(i) {
- if (*i < 18446744073709551616.0 && *i >= 0.0) {
+ if (*i < static_cast<float>(UINT64_MAX) && *i > -1.0) {
// Conversions within this range should succeed.
CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i));
CHECK_NE(0, success);
@@ -5576,7 +5573,7 @@ TEST(RunTryTruncateFloat64ToUint64WithoutCheck) {
FOR_UINT64_INPUTS(j) {
double input = static_cast<double>(*j);
- if (input < 18446744073709551616.0) {
+ if (input < static_cast<float>(UINT64_MAX)) {
CHECK_EQ(static_cast<uint64_t>(input), m.Call(input));
}
}
@@ -5593,7 +5590,7 @@ TEST(RunTryTruncateFloat64ToUint64WithCheck) {
m.Return(val);
FOR_FLOAT64_INPUTS(i) {
- if (*i < 18446744073709551616.0 && *i >= 0) {
+ if (*i < 18446744073709551616.0 && *i > -1) {
// Conversions within this range should succeed.
CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i));
CHECK_NE(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