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/bits.h" | 5 #include "src/base/bits.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 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 g.DefineAsRegister(node), g.UseRegister(m.left().node()), | 641 g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
642 g.UseRegister(m.right().node())); | 642 g.UseRegister(m.right().node())); |
643 } | 643 } |
644 | 644 |
645 | 645 |
646 void InstructionSelector::VisitInt32Div(Node* node) { | 646 void InstructionSelector::VisitInt32Div(Node* node) { |
647 VisitDiv(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64); | 647 VisitDiv(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64); |
648 } | 648 } |
649 | 649 |
650 | 650 |
651 void InstructionSelector::VisitInt32UDiv(Node* node) { | 651 void InstructionSelector::VisitUint32Div(Node* node) { |
652 VisitDiv(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64); | 652 VisitDiv(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64); |
653 } | 653 } |
654 | 654 |
655 | 655 |
656 static void VisitMod(InstructionSelector* selector, Node* node, | 656 static void VisitMod(InstructionSelector* selector, Node* node, |
657 ArchOpcode div_opcode, ArchOpcode f64i32_opcode, | 657 ArchOpcode div_opcode, ArchOpcode f64i32_opcode, |
658 ArchOpcode i32f64_opcode) { | 658 ArchOpcode i32f64_opcode) { |
659 ArmOperandGenerator g(selector); | 659 ArmOperandGenerator g(selector); |
660 Int32BinopMatcher m(node); | 660 Int32BinopMatcher m(node); |
661 InstructionOperand* div_operand = g.TempRegister(); | 661 InstructionOperand* div_operand = g.TempRegister(); |
(...skipping 11 matching lines...) Expand all Loading... |
673 selector->Emit(kArmMul, mul_operand, div_operand, right_operand); | 673 selector->Emit(kArmMul, mul_operand, div_operand, right_operand); |
674 selector->Emit(kArmSub, result_operand, left_operand, mul_operand); | 674 selector->Emit(kArmSub, result_operand, left_operand, mul_operand); |
675 } | 675 } |
676 | 676 |
677 | 677 |
678 void InstructionSelector::VisitInt32Mod(Node* node) { | 678 void InstructionSelector::VisitInt32Mod(Node* node) { |
679 VisitMod(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64); | 679 VisitMod(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64); |
680 } | 680 } |
681 | 681 |
682 | 682 |
683 void InstructionSelector::VisitInt32UMod(Node* node) { | 683 void InstructionSelector::VisitUint32Mod(Node* node) { |
684 VisitMod(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64); | 684 VisitMod(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64); |
685 } | 685 } |
686 | 686 |
687 | 687 |
688 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { | 688 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { |
689 ArmOperandGenerator g(this); | 689 ArmOperandGenerator g(this); |
690 Emit(kArmVcvtF64F32, g.DefineAsRegister(node), | 690 Emit(kArmVcvtF64F32, g.DefineAsRegister(node), |
691 g.UseRegister(node->InputAt(0))); | 691 g.UseRegister(node->InputAt(0))); |
692 } | 692 } |
693 | 693 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 } else { | 957 } else { |
958 DCHECK(cont->IsSet()); | 958 DCHECK(cont->IsSet()); |
959 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 959 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), |
960 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); | 960 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); |
961 } | 961 } |
962 } | 962 } |
963 | 963 |
964 } // namespace compiler | 964 } // namespace compiler |
965 } // namespace internal | 965 } // namespace internal |
966 } // namespace v8 | 966 } // namespace v8 |
OLD | NEW |