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