blob: 6f5fe0d2a414587fb8b0c602a946a446ff317445 [file] [log] [blame]
Aart Bikf8f5a162017-02-06 15:35:29 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "code_generator_mips.h"
18
19namespace art {
20namespace mips {
21
22// NOLINT on __ macro to suppress wrong warning/fix (misc-macro-parentheses) from clang-tidy.
23#define __ down_cast<MipsAssembler*>(GetAssembler())-> // NOLINT
24
25void LocationsBuilderMIPS::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
26 LOG(FATAL) << "No SIMD for " << instruction->GetId();
27}
28
29void InstructionCodeGeneratorMIPS::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
30 LOG(FATAL) << "No SIMD for " << instruction->GetId();
31}
32
33void LocationsBuilderMIPS::VisitVecSetScalars(HVecSetScalars* instruction) {
34 LOG(FATAL) << "No SIMD for " << instruction->GetId();
35}
36
37void InstructionCodeGeneratorMIPS::VisitVecSetScalars(HVecSetScalars* instruction) {
38 LOG(FATAL) << "No SIMD for " << instruction->GetId();
39}
40
41void LocationsBuilderMIPS::VisitVecSumReduce(HVecSumReduce* instruction) {
42 LOG(FATAL) << "No SIMD for " << instruction->GetId();
43}
44
45void InstructionCodeGeneratorMIPS::VisitVecSumReduce(HVecSumReduce* instruction) {
46 LOG(FATAL) << "No SIMD for " << instruction->GetId();
47}
48
49// Helper to set up locations for vector unary operations.
50static void CreateVecUnOpLocations(ArenaAllocator* arena, HVecUnaryOperation* instruction) {
51 LocationSummary* locations = new (arena) LocationSummary(instruction);
52 switch (instruction->GetPackedType()) {
53 case Primitive::kPrimBoolean:
54 case Primitive::kPrimByte:
55 case Primitive::kPrimChar:
56 case Primitive::kPrimShort:
57 case Primitive::kPrimInt:
58 case Primitive::kPrimFloat:
59 case Primitive::kPrimDouble:
60 DCHECK(locations);
61 break;
62 default:
63 LOG(FATAL) << "Unsupported SIMD type";
64 UNREACHABLE();
65 }
66}
67
68void LocationsBuilderMIPS::VisitVecCnv(HVecCnv* instruction) {
69 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
70}
71
72void InstructionCodeGeneratorMIPS::VisitVecCnv(HVecCnv* instruction) {
73 LOG(FATAL) << "No SIMD for " << instruction->GetId();
74}
75
76void LocationsBuilderMIPS::VisitVecNeg(HVecNeg* instruction) {
77 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
78}
79
80void InstructionCodeGeneratorMIPS::VisitVecNeg(HVecNeg* instruction) {
81 LOG(FATAL) << "No SIMD for " << instruction->GetId();
82}
83
84void LocationsBuilderMIPS::VisitVecNot(HVecNot* instruction) {
85 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
86}
87
88void InstructionCodeGeneratorMIPS::VisitVecNot(HVecNot* instruction) {
89 LOG(FATAL) << "No SIMD for " << instruction->GetId();
90}
91
92// Helper to set up locations for vector binary operations.
93static void CreateVecBinOpLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) {
94 LocationSummary* locations = new (arena) LocationSummary(instruction);
95 switch (instruction->GetPackedType()) {
96 case Primitive::kPrimBoolean:
97 case Primitive::kPrimByte:
98 case Primitive::kPrimChar:
99 case Primitive::kPrimShort:
100 case Primitive::kPrimInt:
101 case Primitive::kPrimFloat:
102 case Primitive::kPrimDouble:
103 DCHECK(locations);
104 break;
105 default:
106 LOG(FATAL) << "Unsupported SIMD type";
107 UNREACHABLE();
108 }
109}
110
111void LocationsBuilderMIPS::VisitVecAdd(HVecAdd* instruction) {
112 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
113}
114
115void InstructionCodeGeneratorMIPS::VisitVecAdd(HVecAdd* instruction) {
116 LOG(FATAL) << "No SIMD for " << instruction->GetId();
117}
118
119void LocationsBuilderMIPS::VisitVecSub(HVecSub* instruction) {
120 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
121}
122
123void InstructionCodeGeneratorMIPS::VisitVecSub(HVecSub* instruction) {
124 LOG(FATAL) << "No SIMD for " << instruction->GetId();
125}
126
127void LocationsBuilderMIPS::VisitVecMul(HVecMul* instruction) {
128 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
129}
130
131void InstructionCodeGeneratorMIPS::VisitVecMul(HVecMul* instruction) {
132 LOG(FATAL) << "No SIMD for " << instruction->GetId();
133}
134
135void LocationsBuilderMIPS::VisitVecDiv(HVecDiv* instruction) {
136 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
137}
138
139void InstructionCodeGeneratorMIPS::VisitVecDiv(HVecDiv* instruction) {
140 LOG(FATAL) << "No SIMD for " << instruction->GetId();
141}
142
143void LocationsBuilderMIPS::VisitVecAnd(HVecAnd* instruction) {
144 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
145}
146
147void InstructionCodeGeneratorMIPS::VisitVecAnd(HVecAnd* instruction) {
148 LOG(FATAL) << "No SIMD for " << instruction->GetId();
149}
150
151void LocationsBuilderMIPS::VisitVecAndNot(HVecAndNot* instruction) {
152 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
153}
154
155void InstructionCodeGeneratorMIPS::VisitVecAndNot(HVecAndNot* instruction) {
156 LOG(FATAL) << "No SIMD for " << instruction->GetId();
157}
158
159void LocationsBuilderMIPS::VisitVecOr(HVecOr* instruction) {
160 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
161}
162
163void InstructionCodeGeneratorMIPS::VisitVecOr(HVecOr* instruction) {
164 LOG(FATAL) << "No SIMD for " << instruction->GetId();
165}
166
167void LocationsBuilderMIPS::VisitVecXor(HVecXor* instruction) {
168 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
169}
170
171void InstructionCodeGeneratorMIPS::VisitVecXor(HVecXor* instruction) {
172 LOG(FATAL) << "No SIMD for " << instruction->GetId();
173}
174
175// Helper to set up locations for vector shift operations.
176static void CreateVecShiftLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) {
177 LocationSummary* locations = new (arena) LocationSummary(instruction);
178 switch (instruction->GetPackedType()) {
179 case Primitive::kPrimByte:
180 case Primitive::kPrimChar:
181 case Primitive::kPrimShort:
182 case Primitive::kPrimInt:
183 case Primitive::kPrimLong:
184 DCHECK(locations);
185 break;
186 default:
187 LOG(FATAL) << "Unsupported SIMD type";
188 UNREACHABLE();
189 }
190}
191
192void LocationsBuilderMIPS::VisitVecShl(HVecShl* instruction) {
193 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
194}
195
196void InstructionCodeGeneratorMIPS::VisitVecShl(HVecShl* instruction) {
197 LOG(FATAL) << "No SIMD for " << instruction->GetId();
198}
199
200void LocationsBuilderMIPS::VisitVecShr(HVecShr* instruction) {
201 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
202}
203
204void InstructionCodeGeneratorMIPS::VisitVecShr(HVecShr* instruction) {
205 LOG(FATAL) << "No SIMD for " << instruction->GetId();
206}
207
208void LocationsBuilderMIPS::VisitVecUShr(HVecUShr* instruction) {
209 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
210}
211
212void InstructionCodeGeneratorMIPS::VisitVecUShr(HVecUShr* instruction) {
213 LOG(FATAL) << "No SIMD for " << instruction->GetId();
214}
215
216void LocationsBuilderMIPS::VisitVecLoad(HVecLoad* instruction) {
217 LOG(FATAL) << "No SIMD for " << instruction->GetId();
218}
219
220void InstructionCodeGeneratorMIPS::VisitVecLoad(HVecLoad* instruction) {
221 LOG(FATAL) << "No SIMD for " << instruction->GetId();
222}
223
224void LocationsBuilderMIPS::VisitVecStore(HVecStore* instruction) {
225 LOG(FATAL) << "No SIMD for " << instruction->GetId();
226}
227
228void InstructionCodeGeneratorMIPS::VisitVecStore(HVecStore* instruction) {
229 LOG(FATAL) << "No SIMD for " << instruction->GetId();
230}
231
232#undef __
233
234} // namespace mips
235} // namespace art