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

Side by Side Diff: test/cctest/compiler/test-run-machops.cc

Issue 1225993002: [turbofan] Add TruncationMode for TruncateFloat64ToInt32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 #include <functional> 6 #include <functional>
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
(...skipping 4822 matching lines...) Expand 10 before | Expand all | Expand 10 after
4833 {9.6714157802890681e+24, -2147483648.0}, 4833 {9.6714157802890681e+24, -2147483648.0},
4834 {-9.6714157802890681e+24, -2147483648.0}, 4834 {-9.6714157802890681e+24, -2147483648.0},
4835 {1.9342813113834065e+25, 2147483648.0}, 4835 {1.9342813113834065e+25, 2147483648.0},
4836 {-1.9342813113834065e+25, 2147483648.0}, 4836 {-1.9342813113834065e+25, 2147483648.0},
4837 {3.868562622766813e+25, 0}, 4837 {3.868562622766813e+25, 0},
4838 {-3.868562622766813e+25, 0}, 4838 {-3.868562622766813e+25, 0},
4839 {1.7976931348623157e+308, 0}, 4839 {1.7976931348623157e+308, 0},
4840 {-1.7976931348623157e+308, 0}}; 4840 {-1.7976931348623157e+308, 0}};
4841 double input = -1.0; 4841 double input = -1.0;
4842 RawMachineAssemblerTester<int32_t> m; 4842 RawMachineAssemblerTester<int32_t> m;
4843 m.Return(m.TruncateFloat64ToInt32(m.LoadFromPointer(&input, kMachFloat64))); 4843 m.Return(m.TruncateFloat64ToInt32(TruncationMode::kJavaScript,
4844 m.LoadFromPointer(&input, kMachFloat64)));
4844 for (size_t i = 0; i < arraysize(kValues); ++i) { 4845 for (size_t i = 0; i < arraysize(kValues); ++i) {
4845 input = kValues[i].from; 4846 input = kValues[i].from;
4846 uint64_t expected = static_cast<int64_t>(kValues[i].raw); 4847 uint64_t expected = static_cast<int64_t>(kValues[i].raw);
4847 CHECK_EQ(static_cast<int>(expected), m.Call()); 4848 CHECK_EQ(static_cast<int>(expected), m.Call());
4848 } 4849 }
4849 } 4850 }
4850 4851
4851 4852
4852 TEST(RunChangeFloat32ToFloat64) { 4853 TEST(RunChangeFloat32ToFloat64) {
4853 double actual = 0.0f; 4854 double actual = 0.0f;
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
5268 param, param, param, param)); 5269 param, param, param, param));
5269 FOR_INT32_INPUTS(i) { 5270 FOR_INT32_INPUTS(i) {
5270 int32_t const x = *i; 5271 int32_t const x = *i;
5271 CHECK_EQ(x * 8, m.Call(x)); 5272 CHECK_EQ(x * 8, m.Call(x));
5272 } 5273 }
5273 } 5274 }
5274 5275
5275 #endif // USE_SIMULATOR 5276 #endif // USE_SIMULATOR
5276 5277
5277 #endif // V8_TURBOFAN_TARGET 5278 #endif // V8_TURBOFAN_TARGET
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | test/unittests/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698