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 5162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5173 m.Return(m.Float64Sub(m.Float64Constant(-0.0), | 5173 m.Return(m.Float64Sub(m.Float64Constant(-0.0), |
5174 m.Float64RoundDown(m.Float64Sub(m.Float64Constant(-0.0), | 5174 m.Float64RoundDown(m.Float64Sub(m.Float64Constant(-0.0), |
5175 m.Parameter(0))))); | 5175 m.Parameter(0))))); |
5176 | 5176 |
5177 for (size_t i = 0; i < arraysize(kValues); ++i) { | 5177 for (size_t i = 0; i < arraysize(kValues); ++i) { |
5178 CHECK_EQ(std::ceil(kValues[i]), m.Call(kValues[i])); | 5178 CHECK_EQ(std::ceil(kValues[i]), m.Call(kValues[i])); |
5179 } | 5179 } |
5180 } | 5180 } |
5181 | 5181 |
5182 | 5182 |
| 5183 TEST(RunFloat32RoundUp) { |
| 5184 BufferedRawMachineAssemblerTester<float> m(kMachFloat32); |
| 5185 if (!m.machine()->Float32RoundUp().IsSupported()) return; |
| 5186 m.Return(m.Float32RoundUp(m.Parameter(0))); |
| 5187 |
| 5188 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(std::ceil(*i), m.Call(*i)); } |
| 5189 } |
| 5190 |
| 5191 |
5183 TEST(RunFloat64RoundUp) { | 5192 TEST(RunFloat64RoundUp) { |
5184 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); | 5193 BufferedRawMachineAssemblerTester<double> m(kMachFloat64); |
5185 if (!m.machine()->Float64RoundUp().IsSupported()) return; | 5194 if (!m.machine()->Float64RoundUp().IsSupported()) return; |
5186 m.Return(m.Float64RoundUp(m.Parameter(0))); | 5195 m.Return(m.Float64RoundUp(m.Parameter(0))); |
5187 | 5196 |
5188 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::ceil(*i), m.Call(*i)); } | 5197 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::ceil(*i), m.Call(*i)); } |
5189 } | 5198 } |
5190 | 5199 |
5191 | 5200 |
5192 TEST(RunFloat64RoundTiesEven) { | 5201 TEST(RunFloat64RoundTiesEven) { |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5668 Node* call = r.AddNode(r.common()->Call(desc), phi); | 5677 Node* call = r.AddNode(r.common()->Call(desc), phi); |
5669 r.Return(call); | 5678 r.Return(call); |
5670 | 5679 |
5671 CHECK_EQ(33, r.Call(1)); | 5680 CHECK_EQ(33, r.Call(1)); |
5672 CHECK_EQ(44, r.Call(0)); | 5681 CHECK_EQ(44, r.Call(0)); |
5673 } | 5682 } |
5674 | 5683 |
5675 } // namespace compiler | 5684 } // namespace compiler |
5676 } // namespace internal | 5685 } // namespace internal |
5677 } // namespace v8 | 5686 } // namespace v8 |
OLD | NEW |