Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: src/compiler/mips64/instruction-selector-mips64.cc

Issue 2753903004: MIPS[64]: Support for some SIMD operations (Closed)
Patch Set: rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/mips64/instruction-codes-mips64.h ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 }; 134 };
135 135
136 136
137 static void VisitRR(InstructionSelector* selector, ArchOpcode opcode, 137 static void VisitRR(InstructionSelector* selector, ArchOpcode opcode,
138 Node* node) { 138 Node* node) {
139 Mips64OperandGenerator g(selector); 139 Mips64OperandGenerator g(selector);
140 selector->Emit(opcode, g.DefineAsRegister(node), 140 selector->Emit(opcode, g.DefineAsRegister(node),
141 g.UseRegister(node->InputAt(0))); 141 g.UseRegister(node->InputAt(0)));
142 } 142 }
143 143
144 static void VisitRRI(InstructionSelector* selector, ArchOpcode opcode,
145 Node* node) {
146 Mips64OperandGenerator g(selector);
147 int32_t imm = OpParameter<int32_t>(node);
148 selector->Emit(opcode, g.DefineAsRegister(node),
149 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm));
150 }
151
152 static void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode,
153 Node* node) {
154 Mips64OperandGenerator g(selector);
155 int32_t imm = OpParameter<int32_t>(node);
156 selector->Emit(opcode, g.DefineAsRegister(node),
157 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm),
158 g.UseRegister(node->InputAt(1)));
159 }
144 160
145 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, 161 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode,
146 Node* node) { 162 Node* node) {
147 Mips64OperandGenerator g(selector); 163 Mips64OperandGenerator g(selector);
148 selector->Emit(opcode, g.DefineAsRegister(node), 164 selector->Emit(opcode, g.DefineAsRegister(node),
149 g.UseRegister(node->InputAt(0)), 165 g.UseRegister(node->InputAt(0)),
150 g.UseRegister(node->InputAt(1))); 166 g.UseRegister(node->InputAt(1)));
151 } 167 }
152 168
153 169
(...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 } 2659 }
2644 2660
2645 void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { 2661 void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
2646 UNREACHABLE(); 2662 UNREACHABLE();
2647 } 2663 }
2648 2664
2649 void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { 2665 void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
2650 UNREACHABLE(); 2666 UNREACHABLE();
2651 } 2667 }
2652 2668
2669 void InstructionSelector::VisitI32x4Splat(Node* node) {
2670 VisitRR(this, kMips64I32x4Splat, node);
2671 }
2672
2673 void InstructionSelector::VisitI32x4ExtractLane(Node* node) {
2674 VisitRRI(this, kMips64I32x4ExtractLane, node);
2675 }
2676
2677 void InstructionSelector::VisitI32x4ReplaceLane(Node* node) {
2678 VisitRRIR(this, kMips64I32x4ReplaceLane, node);
2679 }
2680
2681 void InstructionSelector::VisitI32x4Add(Node* node) {
2682 VisitRRR(this, kMips64I32x4Add, node);
2683 }
2684
2685 void InstructionSelector::VisitI32x4Sub(Node* node) {
2686 VisitRRR(this, kMips64I32x4Sub, node);
2687 }
2688
2689 void InstructionSelector::VisitS128Zero(Node* node) {
2690 Mips64OperandGenerator g(this);
2691 Emit(kMips64S128Zero, g.DefineSameAsFirst(node));
2692 }
2693
2694 void InstructionSelector::VisitS1x4Zero(Node* node) {
2695 Mips64OperandGenerator g(this);
2696 Emit(kMips64S128Zero, g.DefineSameAsFirst(node));
2697 }
2698
2699 void InstructionSelector::VisitS1x8Zero(Node* node) {
2700 Mips64OperandGenerator g(this);
2701 Emit(kMips64S128Zero, g.DefineSameAsFirst(node));
2702 }
2703
2704 void InstructionSelector::VisitS1x16Zero(Node* node) {
2705 Mips64OperandGenerator g(this);
2706 Emit(kMips64S128Zero, g.DefineSameAsFirst(node));
2707 }
2708
2653 // static 2709 // static
2654 MachineOperatorBuilder::Flags 2710 MachineOperatorBuilder::Flags
2655 InstructionSelector::SupportedMachineOperatorFlags() { 2711 InstructionSelector::SupportedMachineOperatorFlags() {
2656 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; 2712 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
2657 return flags | MachineOperatorBuilder::kWord32Ctz | 2713 return flags | MachineOperatorBuilder::kWord32Ctz |
2658 MachineOperatorBuilder::kWord64Ctz | 2714 MachineOperatorBuilder::kWord64Ctz |
2659 MachineOperatorBuilder::kWord32Popcnt | 2715 MachineOperatorBuilder::kWord32Popcnt |
2660 MachineOperatorBuilder::kWord64Popcnt | 2716 MachineOperatorBuilder::kWord64Popcnt |
2661 MachineOperatorBuilder::kWord32ShiftIsSafe | 2717 MachineOperatorBuilder::kWord32ShiftIsSafe |
2662 MachineOperatorBuilder::kInt32DivIsSafe | 2718 MachineOperatorBuilder::kInt32DivIsSafe |
(...skipping 19 matching lines...) Expand all
2682 } else { 2738 } else {
2683 DCHECK(kArchVariant == kMips64r2); 2739 DCHECK(kArchVariant == kMips64r2);
2684 return MachineOperatorBuilder::AlignmentRequirements:: 2740 return MachineOperatorBuilder::AlignmentRequirements::
2685 NoUnalignedAccessSupport(); 2741 NoUnalignedAccessSupport();
2686 } 2742 }
2687 } 2743 }
2688 2744
2689 } // namespace compiler 2745 } // namespace compiler
2690 } // namespace internal 2746 } // namespace internal
2691 } // namespace v8 2747 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/instruction-codes-mips64.h ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698