| 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 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2699 void InstructionSelector::VisitS1x8Zero(Node* node) { | 2705 void InstructionSelector::VisitS1x8Zero(Node* node) { |
| 2700 Mips64OperandGenerator g(this); | 2706 Mips64OperandGenerator g(this); |
| 2701 Emit(kMips64S128Zero, g.DefineSameAsFirst(node)); | 2707 Emit(kMips64S128Zero, g.DefineSameAsFirst(node)); |
| 2702 } | 2708 } |
| 2703 | 2709 |
| 2704 void InstructionSelector::VisitS1x16Zero(Node* node) { | 2710 void InstructionSelector::VisitS1x16Zero(Node* node) { |
| 2705 Mips64OperandGenerator g(this); | 2711 Mips64OperandGenerator g(this); |
| 2706 Emit(kMips64S128Zero, g.DefineSameAsFirst(node)); | 2712 Emit(kMips64S128Zero, g.DefineSameAsFirst(node)); |
| 2707 } | 2713 } |
| 2708 | 2714 |
| 2715 void InstructionSelector::VisitI32x4Mul(Node* node) { |
| 2716 VisitRRR(this, kMips64I32x4Mul, node); |
| 2717 } |
| 2718 |
| 2719 void InstructionSelector::VisitI32x4MaxS(Node* node) { |
| 2720 VisitRRR(this, kMips64I32x4MaxS, node); |
| 2721 } |
| 2722 |
| 2723 void InstructionSelector::VisitI32x4MinS(Node* node) { |
| 2724 VisitRRR(this, kMips64I32x4MinS, node); |
| 2725 } |
| 2726 |
| 2727 void InstructionSelector::VisitI32x4Eq(Node* node) { |
| 2728 VisitRRR(this, kMips64I32x4Eq, node); |
| 2729 } |
| 2730 |
| 2731 void InstructionSelector::VisitI32x4Ne(Node* node) { |
| 2732 VisitRRR(this, kMips64I32x4Ne, node); |
| 2733 } |
| 2734 |
| 2735 void InstructionSelector::VisitI32x4Shl(Node* node) { |
| 2736 VisitRRI(this, kMips64I32x4Shl, node); |
| 2737 } |
| 2738 |
| 2739 void InstructionSelector::VisitI32x4ShrS(Node* node) { |
| 2740 VisitRRI(this, kMips64I32x4ShrS, node); |
| 2741 } |
| 2742 |
| 2743 void InstructionSelector::VisitI32x4ShrU(Node* node) { |
| 2744 VisitRRI(this, kMips64I32x4ShrU, node); |
| 2745 } |
| 2746 |
| 2747 void InstructionSelector::VisitI32x4MaxU(Node* node) { |
| 2748 VisitRRR(this, kMips64I32x4MaxU, node); |
| 2749 } |
| 2750 |
| 2751 void InstructionSelector::VisitI32x4MinU(Node* node) { |
| 2752 VisitRRR(this, kMips64I32x4MinU, node); |
| 2753 } |
| 2754 |
| 2755 void InstructionSelector::VisitS32x4Select(Node* node) { |
| 2756 VisitRRRR(this, kMips64S32x4Select, node); |
| 2757 } |
| 2758 |
| 2709 // static | 2759 // static |
| 2710 MachineOperatorBuilder::Flags | 2760 MachineOperatorBuilder::Flags |
| 2711 InstructionSelector::SupportedMachineOperatorFlags() { | 2761 InstructionSelector::SupportedMachineOperatorFlags() { |
| 2712 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 2762 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
| 2713 return flags | MachineOperatorBuilder::kWord32Ctz | | 2763 return flags | MachineOperatorBuilder::kWord32Ctz | |
| 2714 MachineOperatorBuilder::kWord64Ctz | | 2764 MachineOperatorBuilder::kWord64Ctz | |
| 2715 MachineOperatorBuilder::kWord32Popcnt | | 2765 MachineOperatorBuilder::kWord32Popcnt | |
| 2716 MachineOperatorBuilder::kWord64Popcnt | | 2766 MachineOperatorBuilder::kWord64Popcnt | |
| 2717 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2767 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2718 MachineOperatorBuilder::kInt32DivIsSafe | | 2768 MachineOperatorBuilder::kInt32DivIsSafe | |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2738 } else { | 2788 } else { |
| 2739 DCHECK(kArchVariant == kMips64r2); | 2789 DCHECK(kArchVariant == kMips64r2); |
| 2740 return MachineOperatorBuilder::AlignmentRequirements:: | 2790 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2741 NoUnalignedAccessSupport(); | 2791 NoUnalignedAccessSupport(); |
| 2742 } | 2792 } |
| 2743 } | 2793 } |
| 2744 | 2794 |
| 2745 } // namespace compiler | 2795 } // namespace compiler |
| 2746 } // namespace internal | 2796 } // namespace internal |
| 2747 } // namespace v8 | 2797 } // namespace v8 |
| OLD | NEW |