OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <functional> | 5 #include <functional> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" |
10 #include "test/cctest/cctest.h" | 10 #include "test/cctest/cctest.h" |
(...skipping 4257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4268 m.TruncateFloat64ToFloat32(m.LoadFromPointer(&input, kMachFloat64))); | 4268 m.TruncateFloat64ToFloat32(m.LoadFromPointer(&input, kMachFloat64))); |
4269 m.Return(m.Int32Constant(0)); | 4269 m.Return(m.Int32Constant(0)); |
4270 FOR_FLOAT64_INPUTS(i) { | 4270 FOR_FLOAT64_INPUTS(i) { |
4271 input = *i; | 4271 input = *i; |
4272 volatile double expected = DoubleToFloat32(input); | 4272 volatile double expected = DoubleToFloat32(input); |
4273 CHECK_EQ(0, m.Call()); | 4273 CHECK_EQ(0, m.Call()); |
4274 CHECK_EQ(expected, actual); | 4274 CHECK_EQ(expected, actual); |
4275 } | 4275 } |
4276 } | 4276 } |
4277 | 4277 |
| 4278 |
| 4279 TEST(RunFloat32Constant) { |
| 4280 FOR_FLOAT32_INPUTS(i) { |
| 4281 float expected = *i; |
| 4282 float actual = *i; |
| 4283 RawMachineAssemblerTester<int32_t> m; |
| 4284 m.StoreToPointer(&actual, kMachFloat32, m.Float32Constant(expected)); |
| 4285 m.Return(m.Int32Constant(0)); |
| 4286 CHECK_EQ(0, m.Call()); |
| 4287 CHECK_EQ(expected, actual); |
| 4288 } |
| 4289 } |
| 4290 |
4278 #endif // V8_TURBOFAN_TARGET | 4291 #endif // V8_TURBOFAN_TARGET |
OLD | NEW |