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

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

Issue 1471913006: [turbofan] Implemented the optional Float32RoundDown operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed a debugging printf. 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
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 5126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5137 -two_52, 5137 -two_52,
5138 -two_52 - 0.1, 5138 -two_52 - 0.1,
5139 -two_52 - 0.5, 5139 -two_52 - 0.5,
5140 -two_52 - 0.7, 5140 -two_52 - 0.7,
5141 -two_52 + 1, 5141 -two_52 + 1,
5142 -two_52 + 1 - 0.1, 5142 -two_52 + 1 - 0.1,
5143 -two_52 + 1 - 0.5, 5143 -two_52 + 1 - 0.5,
5144 -two_52 + 1 - 0.7}; 5144 -two_52 + 1 - 0.7};
5145 5145
5146 5146
5147 TEST(RunFloat32RoundDown) {
5148 BufferedRawMachineAssemblerTester<float> m(kMachFloat32);
5149 if (!m.machine()->Float32RoundDown().IsSupported()) return;
5150
5151 m.Return(m.Float32RoundDown(m.Parameter(0)));
5152
5153 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floorf(*i), m.Call(*i)); }
jbramley 2015/11/25 10:46:16 Again, why not std::floor?
5154 }
5155
5156
5147 TEST(RunFloat64RoundDown1) { 5157 TEST(RunFloat64RoundDown1) {
5148 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); 5158 BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
5149 if (!m.machine()->Float64RoundDown().IsSupported()) return; 5159 if (!m.machine()->Float64RoundDown().IsSupported()) return;
5150 5160
5151 m.Return(m.Float64RoundDown(m.Parameter(0))); 5161 m.Return(m.Float64RoundDown(m.Parameter(0)));
5152 5162
5153 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::floor(*i), m.Call(*i)); } 5163 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::floor(*i), m.Call(*i)); }
5154 } 5164 }
5155 5165
5156 5166
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
5655 Node* call = r.AddNode(r.common()->Call(desc), phi); 5665 Node* call = r.AddNode(r.common()->Call(desc), phi);
5656 r.Return(call); 5666 r.Return(call);
5657 5667
5658 CHECK_EQ(33, r.Call(1)); 5668 CHECK_EQ(33, r.Call(1));
5659 CHECK_EQ(44, r.Call(0)); 5669 CHECK_EQ(44, r.Call(0));
5660 } 5670 }
5661 5671
5662 } // namespace compiler 5672 } // namespace compiler
5663 } // namespace internal 5673 } // namespace internal
5664 } // namespace v8 5674 } // namespace v8
OLDNEW
« src/ia32/assembler-ia32.cc ('K') | « test/cctest/compiler/codegen-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698