OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "src/compiler/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 // kExprI32ConvertI64: | 390 // kExprI32ConvertI64: |
391 TEST_F(Int64LoweringTest, I32ConvertI64) { | 391 TEST_F(Int64LoweringTest, I32ConvertI64) { |
392 LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(), | 392 LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(), |
393 Int64Constant(value(0))), | 393 Int64Constant(value(0))), |
394 MachineRepresentation::kWord32); | 394 MachineRepresentation::kWord32); |
395 EXPECT_THAT(graph()->end()->InputAt(1), | 395 EXPECT_THAT(graph()->end()->InputAt(1), |
396 IsReturn(IsInt32Constant(low_word_value(0)), start(), start())); | 396 IsReturn(IsInt32Constant(low_word_value(0)), start(), start())); |
397 } | 397 } |
398 // kExprI64SConvertI32: | 398 // kExprI64SConvertI32: |
| 399 TEST_F(Int64LoweringTest, I64SConvertI32) { |
| 400 LowerGraph(graph()->NewNode(machine()->ChangeInt32ToInt64(), |
| 401 Int32Constant(low_word_value(0))), |
| 402 MachineRepresentation::kWord64); |
| 403 |
| 404 EXPECT_THAT(graph()->end()->InputAt(1), |
| 405 IsReturn2(IsInt32Constant(low_word_value(0)), |
| 406 IsWord32Sar(IsInt32Constant(low_word_value(0)), |
| 407 IsInt32Constant(31)), |
| 408 start(), start())); |
| 409 } |
| 410 |
| 411 TEST_F(Int64LoweringTest, I64SConvertI32_2) { |
| 412 LowerGraph( |
| 413 graph()->NewNode(machine()->ChangeInt32ToInt64(), |
| 414 graph()->NewNode(machine()->TruncateInt64ToInt32(), |
| 415 Int64Constant(value(0)))), |
| 416 MachineRepresentation::kWord64); |
| 417 |
| 418 EXPECT_THAT(graph()->end()->InputAt(1), |
| 419 IsReturn2(IsInt32Constant(low_word_value(0)), |
| 420 IsWord32Sar(IsInt32Constant(low_word_value(0)), |
| 421 IsInt32Constant(31)), |
| 422 start(), start())); |
| 423 } |
399 // kExprI64UConvertI32: | 424 // kExprI64UConvertI32: |
| 425 TEST_F(Int64LoweringTest, I64UConvertI32) { |
| 426 LowerGraph(graph()->NewNode(machine()->ChangeUint32ToUint64(), |
| 427 Int32Constant(low_word_value(0))), |
| 428 MachineRepresentation::kWord64); |
400 | 429 |
| 430 EXPECT_THAT(graph()->end()->InputAt(1), |
| 431 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), |
| 432 start(), start())); |
| 433 } |
| 434 |
| 435 TEST_F(Int64LoweringTest, I64UConvertI32_2) { |
| 436 LowerGraph( |
| 437 graph()->NewNode(machine()->ChangeUint32ToUint64(), |
| 438 graph()->NewNode(machine()->TruncateInt64ToInt32(), |
| 439 Int64Constant(value(0)))), |
| 440 MachineRepresentation::kWord64); |
| 441 |
| 442 EXPECT_THAT(graph()->end()->InputAt(1), |
| 443 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), |
| 444 start(), start())); |
| 445 } |
401 // kExprF64ReinterpretI64: | 446 // kExprF64ReinterpretI64: |
402 // kExprI64ReinterpretF64: | 447 // kExprI64ReinterpretF64: |
403 | 448 |
404 // kExprI64Clz: | 449 // kExprI64Clz: |
405 // kExprI64Ctz: | 450 // kExprI64Ctz: |
406 // kExprI64Popcnt: | 451 // kExprI64Popcnt: |
407 } // namespace compiler | 452 } // namespace compiler |
408 } // namespace internal | 453 } // namespace internal |
409 } // namespace v8 | 454 } // namespace v8 |
OLD | NEW |