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/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, | 161 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, |
162 Node* node) { | 162 Node* node) { |
163 Mips64OperandGenerator g(selector); | 163 Mips64OperandGenerator g(selector); |
164 selector->Emit(opcode, g.DefineAsRegister(node), | 164 selector->Emit(opcode, g.DefineAsRegister(node), |
165 g.UseRegister(node->InputAt(0)), | 165 g.UseRegister(node->InputAt(0)), |
166 g.UseRegister(node->InputAt(1))); | 166 g.UseRegister(node->InputAt(1))); |
167 } | 167 } |
168 | 168 |
| 169 void VisitRRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { |
| 170 Mips64OperandGenerator g(selector); |
| 171 selector->Emit( |
| 172 opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)), |
| 173 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(2))); |
| 174 } |
169 | 175 |
170 static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode, | 176 static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode, |
171 Node* node) { | 177 Node* node) { |
172 Mips64OperandGenerator g(selector); | 178 Mips64OperandGenerator g(selector); |
173 selector->Emit(opcode, g.DefineAsRegister(node), | 179 selector->Emit(opcode, g.DefineAsRegister(node), |
174 g.UseRegister(node->InputAt(0)), | 180 g.UseRegister(node->InputAt(0)), |
175 g.UseOperand(node->InputAt(1), opcode)); | 181 g.UseOperand(node->InputAt(1), opcode)); |
176 } | 182 } |
177 | 183 |
178 struct ExtendingLoadMatcher { | 184 struct ExtendingLoadMatcher { |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 } | 2725 } |
2720 | 2726 |
2721 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { | 2727 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { |
2722 VisitRR(this, kMips64F32x4SConvertI32x4, node); | 2728 VisitRR(this, kMips64F32x4SConvertI32x4, node); |
2723 } | 2729 } |
2724 | 2730 |
2725 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { | 2731 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { |
2726 VisitRR(this, kMips64F32x4UConvertI32x4, node); | 2732 VisitRR(this, kMips64F32x4UConvertI32x4, node); |
2727 } | 2733 } |
2728 | 2734 |
| 2735 void InstructionSelector::VisitI32x4Mul(Node* node) { |
| 2736 VisitRRR(this, kMips64I32x4Mul, node); |
| 2737 } |
| 2738 |
| 2739 void InstructionSelector::VisitI32x4MaxS(Node* node) { |
| 2740 VisitRRR(this, kMips64I32x4MaxS, node); |
| 2741 } |
| 2742 |
| 2743 void InstructionSelector::VisitI32x4MinS(Node* node) { |
| 2744 VisitRRR(this, kMips64I32x4MinS, node); |
| 2745 } |
| 2746 |
| 2747 void InstructionSelector::VisitI32x4Eq(Node* node) { |
| 2748 VisitRRR(this, kMips64I32x4Eq, node); |
| 2749 } |
| 2750 |
| 2751 void InstructionSelector::VisitI32x4Ne(Node* node) { |
| 2752 VisitRRR(this, kMips64I32x4Ne, node); |
| 2753 } |
| 2754 |
| 2755 void InstructionSelector::VisitI32x4Shl(Node* node) { |
| 2756 VisitRRI(this, kMips64I32x4Shl, node); |
| 2757 } |
| 2758 |
| 2759 void InstructionSelector::VisitI32x4ShrS(Node* node) { |
| 2760 VisitRRI(this, kMips64I32x4ShrS, node); |
| 2761 } |
| 2762 |
| 2763 void InstructionSelector::VisitI32x4ShrU(Node* node) { |
| 2764 VisitRRI(this, kMips64I32x4ShrU, node); |
| 2765 } |
| 2766 |
| 2767 void InstructionSelector::VisitI32x4MaxU(Node* node) { |
| 2768 VisitRRR(this, kMips64I32x4MaxU, node); |
| 2769 } |
| 2770 |
| 2771 void InstructionSelector::VisitI32x4MinU(Node* node) { |
| 2772 VisitRRR(this, kMips64I32x4MinU, node); |
| 2773 } |
| 2774 |
| 2775 void InstructionSelector::VisitS32x4Select(Node* node) { |
| 2776 VisitRRRR(this, kMips64S32x4Select, node); |
| 2777 } |
| 2778 |
2729 // static | 2779 // static |
2730 MachineOperatorBuilder::Flags | 2780 MachineOperatorBuilder::Flags |
2731 InstructionSelector::SupportedMachineOperatorFlags() { | 2781 InstructionSelector::SupportedMachineOperatorFlags() { |
2732 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 2782 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
2733 return flags | MachineOperatorBuilder::kWord32Ctz | | 2783 return flags | MachineOperatorBuilder::kWord32Ctz | |
2734 MachineOperatorBuilder::kWord64Ctz | | 2784 MachineOperatorBuilder::kWord64Ctz | |
2735 MachineOperatorBuilder::kWord32Popcnt | | 2785 MachineOperatorBuilder::kWord32Popcnt | |
2736 MachineOperatorBuilder::kWord64Popcnt | | 2786 MachineOperatorBuilder::kWord64Popcnt | |
2737 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2787 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2738 MachineOperatorBuilder::kInt32DivIsSafe | | 2788 MachineOperatorBuilder::kInt32DivIsSafe | |
(...skipping 19 matching lines...) Expand all Loading... |
2758 } else { | 2808 } else { |
2759 DCHECK(kArchVariant == kMips64r2); | 2809 DCHECK(kArchVariant == kMips64r2); |
2760 return MachineOperatorBuilder::AlignmentRequirements:: | 2810 return MachineOperatorBuilder::AlignmentRequirements:: |
2761 NoUnalignedAccessSupport(); | 2811 NoUnalignedAccessSupport(); |
2762 } | 2812 } |
2763 } | 2813 } |
2764 | 2814 |
2765 } // namespace compiler | 2815 } // namespace compiler |
2766 } // namespace internal | 2816 } // namespace internal |
2767 } // namespace v8 | 2817 } // namespace v8 |
OLD | NEW |