| 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 5330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5341 m.Return(m.Int32Constant(11)); | 5341 m.Return(m.Int32Constant(11)); |
| 5342 FOR_FLOAT64_INPUTS(i) { | 5342 FOR_FLOAT64_INPUTS(i) { |
| 5343 input = *i; | 5343 input = *i; |
| 5344 CHECK_EQ(11, m.Call()); | 5344 CHECK_EQ(11, m.Call()); |
| 5345 double expected = bit_cast<int64_t>(input); | 5345 double expected = bit_cast<int64_t>(input); |
| 5346 CHECK_EQ(expected, output); | 5346 CHECK_EQ(expected, output); |
| 5347 } | 5347 } |
| 5348 } | 5348 } |
| 5349 | 5349 |
| 5350 | 5350 |
| 5351 TEST(RunRoundInt64ToFloat32) { |
| 5352 BufferedRawMachineAssemblerTester<float> m(kMachInt64); |
| 5353 m.Return(m.RoundInt64ToFloat32(m.Parameter(0))); |
| 5354 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<float>(*i), m.Call(*i)); } |
| 5355 } |
| 5356 |
| 5357 |
| 5351 TEST(RunRoundInt64ToFloat64) { | 5358 TEST(RunRoundInt64ToFloat64) { |
| 5352 BufferedRawMachineAssemblerTester<double> m(kMachInt64); | 5359 BufferedRawMachineAssemblerTester<double> m(kMachInt64); |
| 5353 m.Return(m.RoundInt64ToFloat64(m.Parameter(0))); | 5360 m.Return(m.RoundInt64ToFloat64(m.Parameter(0))); |
| 5354 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<double>(*i), m.Call(*i)); } | 5361 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<double>(*i), m.Call(*i)); } |
| 5355 } | 5362 } |
| 5356 | 5363 |
| 5357 | 5364 |
| 5358 #endif | 5365 #endif |
| 5359 | 5366 |
| 5360 | 5367 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5433 Node* call = r.AddNode(r.common()->Call(desc), phi); | 5440 Node* call = r.AddNode(r.common()->Call(desc), phi); |
| 5434 r.Return(call); | 5441 r.Return(call); |
| 5435 | 5442 |
| 5436 CHECK_EQ(33, r.Call(1)); | 5443 CHECK_EQ(33, r.Call(1)); |
| 5437 CHECK_EQ(44, r.Call(0)); | 5444 CHECK_EQ(44, r.Call(0)); |
| 5438 } | 5445 } |
| 5439 | 5446 |
| 5440 } // namespace compiler | 5447 } // namespace compiler |
| 5441 } // namespace internal | 5448 } // namespace internal |
| 5442 } // namespace v8 | 5449 } // namespace v8 |
| OLD | NEW |