| 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 5177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |