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

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

Issue 1477753002: [turbofan] Implemented the optional Float32RoundTiesEven operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@f32trunc
Patch Set: Merging with the changed codebase 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 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 5177 matching lines...) Expand 10 before | Expand all | Expand 10 after
5188 5188
5189 TEST(RunFloat64RoundUp) { 5189 TEST(RunFloat64RoundUp) {
5190 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); 5190 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5191 if (!m.machine()->Float64RoundUp().IsSupported()) return; 5191 if (!m.machine()->Float64RoundUp().IsSupported()) return;
5192 m.Return(m.Float64RoundUp(m.Parameter(0))); 5192 m.Return(m.Float64RoundUp(m.Parameter(0)));
5193 5193
5194 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), m.Call(*i)); } 5194 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), m.Call(*i)); }
5195 } 5195 }
5196 5196
5197 5197
5198 TEST(RunFloat32RoundTiesEven) {
5199 BufferedRawMachineAssemblerTester<float> m(kMachFloat32);
5200 if (!m.machine()->Float32RoundTiesEven().IsSupported()) return;
5201 m.Return(m.Float32RoundTiesEven(m.Parameter(0)));
5202
5203 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(nearbyint(*i), m.Call(*i)); }
5204 }
5205
5206
5198 TEST(RunFloat64RoundTiesEven) { 5207 TEST(RunFloat64RoundTiesEven) {
5199 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); 5208 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5200 if (!m.machine()->Float64RoundTiesEven().IsSupported()) return; 5209 if (!m.machine()->Float64RoundTiesEven().IsSupported()) return;
5201 m.Return(m.Float64RoundTiesEven(m.Parameter(0))); 5210 m.Return(m.Float64RoundTiesEven(m.Parameter(0)));
5202 5211
5203 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), m.Call(*i)); } 5212 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), m.Call(*i)); }
5204 } 5213 }
5205 5214
5206 5215
5207 TEST(RunFloat32RoundTruncate) { 5216 TEST(RunFloat32RoundTruncate) {
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
5684 Node* call = r.AddNode(r.common()->Call(desc), phi); 5693 Node* call = r.AddNode(r.common()->Call(desc), phi);
5685 r.Return(call); 5694 r.Return(call);
5686 5695
5687 CHECK_EQ(33, r.Call(1)); 5696 CHECK_EQ(33, r.Call(1));
5688 CHECK_EQ(44, r.Call(0)); 5697 CHECK_EQ(44, r.Call(0));
5689 } 5698 }
5690 5699
5691 } // namespace compiler 5700 } // namespace compiler
5692 } // namespace internal 5701 } // namespace internal
5693 } // namespace v8 5702 } // 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