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

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

Issue 1440293002: [turbofan] Added the optional Float64RoundTiesEven operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@f64roundup
Patch Set: Disabled F64RoundTiesEven on mips32 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 unified diff | Download patch
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this 1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 // TODO(jochen): Remove this after the setting is turned on globally. 5 // TODO(jochen): Remove this after the setting is turned on globally.
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <functional> 9 #include <functional>
10 #include <limits> 10 #include <limits>
(...skipping 5158 matching lines...) Expand 10 before | Expand all | Expand 10 after
5169 5169
5170 TEST(RunFloat64RoundUp) { 5170 TEST(RunFloat64RoundUp) {
5171 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); 5171 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5172 if (!m.machine()->Float64RoundUp().IsSupported()) return; 5172 if (!m.machine()->Float64RoundUp().IsSupported()) return;
5173 m.Return(m.Float64RoundUp(m.Parameter(0))); 5173 m.Return(m.Float64RoundUp(m.Parameter(0)));
5174 5174
5175 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::ceil(*i), m.Call(*i)); } 5175 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::ceil(*i), m.Call(*i)); }
5176 } 5176 }
5177 5177
5178 5178
5179 TEST(RunFloat64RoundTiesEven) {
5180 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5181 if (!m.machine()->Float64RoundTiesEven().IsSupported()) return;
5182 m.Return(m.Float64RoundTiesEven(m.Parameter(0)));
5183
5184 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), m.Call(*i)); }
5185 }
5186
5187
5179 TEST(RunFloat64RoundTruncate) { 5188 TEST(RunFloat64RoundTruncate) {
5180 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); 5189 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5181 if (!m.machine()->Float64RoundTruncate().IsSupported()) return; 5190 if (!m.machine()->Float64RoundTruncate().IsSupported()) return;
5182 m.Return(m.Float64RoundTruncate(m.Parameter(0))); 5191 m.Return(m.Float64RoundTruncate(m.Parameter(0)));
5183 for (size_t i = 0; i < arraysize(kValues); ++i) { 5192 for (size_t i = 0; i < arraysize(kValues); ++i) {
5184 CHECK_EQ(trunc(kValues[i]), m.Call(kValues[i])); 5193 CHECK_EQ(trunc(kValues[i]), m.Call(kValues[i]));
5185 } 5194 }
5186 } 5195 }
5187 5196
5188 5197
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
5604 Node* call = r.AddNode(r.common()->Call(desc), phi); 5613 Node* call = r.AddNode(r.common()->Call(desc), phi);
5605 r.Return(call); 5614 r.Return(call);
5606 5615
5607 CHECK_EQ(33, r.Call(1)); 5616 CHECK_EQ(33, r.Call(1));
5608 CHECK_EQ(44, r.Call(0)); 5617 CHECK_EQ(44, r.Call(0));
5609 } 5618 }
5610 5619
5611 } // namespace compiler 5620 } // namespace compiler
5612 } // namespace internal 5621 } // namespace internal
5613 } // namespace v8 5622 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698