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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 613 |
614 InstructionOperand outputs[] = { | 614 InstructionOperand outputs[] = { |
615 g.DefineSameAsFirst(node), | 615 g.DefineSameAsFirst(node), |
616 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; | 616 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
617 | 617 |
618 InstructionOperand temps[] = {g.TempRegister()}; | 618 InstructionOperand temps[] = {g.TempRegister()}; |
619 | 619 |
620 Emit(kIA32SubPair, 2, outputs, 4, inputs, 1, temps); | 620 Emit(kIA32SubPair, 2, outputs, 4, inputs, 1, temps); |
621 } | 621 } |
622 | 622 |
| 623 void InstructionSelector::VisitInt32PairMul(Node* node) { |
| 624 IA32OperandGenerator g(this); |
| 625 |
| 626 // InputAt(3) explicitly shares ecx with OutputRegister(1) to save one |
| 627 // register and one mov instruction. |
| 628 InstructionOperand inputs[] = { |
| 629 g.UseUnique(node->InputAt(0)), g.UseUnique(node->InputAt(1)), |
| 630 g.UseUniqueRegister(node->InputAt(2)), g.UseFixed(node->InputAt(3), ecx)}; |
| 631 |
| 632 InstructionOperand outputs[] = { |
| 633 g.DefineAsFixed(node, eax), |
| 634 g.DefineAsFixed(NodeProperties::FindProjection(node, 1), ecx)}; |
| 635 |
| 636 InstructionOperand temps[] = {g.TempRegister(edx)}; |
| 637 |
| 638 Emit(kIA32MulPair, 2, outputs, 4, inputs, 1, temps); |
| 639 } |
| 640 |
623 void InstructionSelector::VisitWord32PairShl(Node* node) { | 641 void InstructionSelector::VisitWord32PairShl(Node* node) { |
624 IA32OperandGenerator g(this); | 642 IA32OperandGenerator g(this); |
625 | 643 |
626 Node* shift = node->InputAt(2); | 644 Node* shift = node->InputAt(2); |
627 InstructionOperand shift_operand; | 645 InstructionOperand shift_operand; |
628 if (g.CanBeImmediate(shift)) { | 646 if (g.CanBeImmediate(shift)) { |
629 shift_operand = g.UseImmediate(shift); | 647 shift_operand = g.UseImmediate(shift); |
630 } else { | 648 } else { |
631 shift_operand = g.UseFixed(shift, ecx); | 649 shift_operand = g.UseFixed(shift, ecx); |
632 } | 650 } |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 MachineOperatorBuilder::kFloat64RoundTruncate | | 1560 MachineOperatorBuilder::kFloat64RoundTruncate | |
1543 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1561 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1544 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1562 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1545 } | 1563 } |
1546 return flags; | 1564 return flags; |
1547 } | 1565 } |
1548 | 1566 |
1549 } // namespace compiler | 1567 } // namespace compiler |
1550 } // namespace internal | 1568 } // namespace internal |
1551 } // namespace v8 | 1569 } // namespace v8 |
OLD | NEW |