OLD | NEW |
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 Loading... |
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()) { |
| 5150 printf("not supported\n"); |
| 5151 return; |
| 5152 } |
| 5153 |
| 5154 m.Return(m.Float32RoundDown(m.Parameter(0))); |
| 5155 |
| 5156 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floorf(*i), m.Call(*i)); } |
| 5157 } |
| 5158 |
| 5159 |
5147 TEST(RunFloat64RoundDown1) { | 5160 TEST(RunFloat64RoundDown1) { |
5148 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); | 5161 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); |
5149 if (!m.machine()->Float64RoundDown().IsSupported()) return; | 5162 if (!m.machine()->Float64RoundDown().IsSupported()) return; |
5150 | 5163 |
5151 m.Return(m.Float64RoundDown(m.Parameter(0))); | 5164 m.Return(m.Float64RoundDown(m.Parameter(0))); |
5152 | 5165 |
5153 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::floor(*i), m.Call(*i)); } | 5166 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::floor(*i), m.Call(*i)); } |
5154 } | 5167 } |
5155 | 5168 |
5156 | 5169 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5655 Node* call = r.AddNode(r.common()->Call(desc), phi); | 5668 Node* call = r.AddNode(r.common()->Call(desc), phi); |
5656 r.Return(call); | 5669 r.Return(call); |
5657 | 5670 |
5658 CHECK_EQ(33, r.Call(1)); | 5671 CHECK_EQ(33, r.Call(1)); |
5659 CHECK_EQ(44, r.Call(0)); | 5672 CHECK_EQ(44, r.Call(0)); |
5660 } | 5673 } |
5661 | 5674 |
5662 } // namespace compiler | 5675 } // namespace compiler |
5663 } // namespace internal | 5676 } // namespace internal |
5664 } // namespace v8 | 5677 } // namespace v8 |
OLD | NEW |