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