| 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 "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/graph.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 ReplaceNode(node, input, graph()->NewNode(common()->Int32Constant(0))); | 441 ReplaceNode(node, input, graph()->NewNode(common()->Int32Constant(0))); |
| 442 node->NullAllInputs(); | 442 node->NullAllInputs(); |
| 443 break; | 443 break; |
| 444 } | 444 } |
| 445 // kExprF64ReinterpretI64: | 445 // kExprF64ReinterpretI64: |
| 446 // kExprI64ReinterpretF64: | 446 // kExprI64ReinterpretF64: |
| 447 | 447 |
| 448 // kExprI64Clz: | 448 // kExprI64Clz: |
| 449 // kExprI64Ctz: | 449 // kExprI64Ctz: |
| 450 case IrOpcode::kWord64Popcnt: { |
| 451 DCHECK(node->InputCount() == 1); |
| 452 Node* input = node->InputAt(0); |
| 453 // We assume that a Word64Popcnt node only has been created if |
| 454 // Word32Popcnt is actually supported. |
| 455 DCHECK(machine()->Word32Popcnt().IsSupported()); |
| 456 ReplaceNode(node, graph()->NewNode( |
| 457 machine()->Int32Add(), |
| 458 graph()->NewNode(machine()->Word32Popcnt().op(), |
| 459 GetReplacementLow(input)), |
| 460 graph()->NewNode(machine()->Word32Popcnt().op(), |
| 461 GetReplacementHigh(input))), |
| 462 graph()->NewNode(common()->Int32Constant(0))); |
| 463 break; |
| 464 } |
| 450 // kExprI64Popcnt: | 465 // kExprI64Popcnt: |
| 451 | 466 |
| 452 default: { DefaultLowering(node); } | 467 default: { DefaultLowering(node); } |
| 453 } | 468 } |
| 454 } | 469 } |
| 455 | 470 |
| 456 void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op, | 471 void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op, |
| 457 const Operator* low_word_op) { | 472 const Operator* low_word_op) { |
| 458 DCHECK(node->InputCount() == 2); | 473 DCHECK(node->InputCount() == 2); |
| 459 Node* left = node->InputAt(0); | 474 Node* left = node->InputAt(0); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 525 } |
| 511 | 526 |
| 512 Node* Int64Lowering::GetReplacementHigh(Node* node) { | 527 Node* Int64Lowering::GetReplacementHigh(Node* node) { |
| 513 Node* result = replacements_[node->id()].high; | 528 Node* result = replacements_[node->id()].high; |
| 514 DCHECK(result); | 529 DCHECK(result); |
| 515 return result; | 530 return result; |
| 516 } | 531 } |
| 517 } // namespace compiler | 532 } // namespace compiler |
| 518 } // namespace internal | 533 } // namespace internal |
| 519 } // namespace v8 | 534 } // namespace v8 |
| OLD | NEW |