blob: f8552dcfc9845936a2721ead3f749bfcb4f44258 [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_arm.h"
18
19namespace art {
20namespace arm {
21
22// NOLINT on __ macro to suppress wrong warning/fix (misc-macro-parentheses) from clang-tidy.
23#define __ down_cast<ArmAssembler*>(GetAssembler())-> // NOLINT
24
25void LocationsBuilderARM::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
26 LOG(FATAL) << "No SIMD for " << instruction->GetId();
27}
28
29void InstructionCodeGeneratorARM::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
30 LOG(FATAL) << "No SIMD for " << instruction->GetId();
31}
32
33void LocationsBuilderARM::VisitVecSetScalars(HVecSetScalars* instruction) {
34 LOG(FATAL) << "No SIMD for " << instruction->GetId();
35}
36
37void InstructionCodeGeneratorARM::VisitVecSetScalars(HVecSetScalars* instruction) {
38 LOG(FATAL) << "No SIMD for " << instruction->GetId();
39}
40
41void LocationsBuilderARM::VisitVecSumReduce(HVecSumReduce* instruction) {
42 LOG(FATAL) << "No SIMD for " << instruction->GetId();
43}
44
45void InstructionCodeGeneratorARM::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 LocationsBuilderARM::VisitVecCnv(HVecCnv* instruction) {
69 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
70}
71
72void InstructionCodeGeneratorARM::VisitVecCnv(HVecCnv* instruction) {
73 LOG(FATAL) << "No SIMD for " << instruction->GetId();
74}
75
76void LocationsBuilderARM::VisitVecNeg(HVecNeg* instruction) {
77 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
78}
79
80void InstructionCodeGeneratorARM::VisitVecNeg(HVecNeg* instruction) {
81 LOG(FATAL) << "No SIMD for " << instruction->GetId();
82}
83
Aart Bik6daebeb2017-04-03 14:35:41 -070084void LocationsBuilderARM::VisitVecAbs(HVecAbs* instruction) {
85 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
86}
87
88void InstructionCodeGeneratorARM::VisitVecAbs(HVecAbs* instruction) {
89 LOG(FATAL) << "No SIMD for " << instruction->GetId();
90}
91
Aart Bikf8f5a162017-02-06 15:35:29 -080092void LocationsBuilderARM::VisitVecNot(HVecNot* instruction) {
93 CreateVecUnOpLocations(GetGraph()->GetArena(), instruction);
94}
95
96void InstructionCodeGeneratorARM::VisitVecNot(HVecNot* instruction) {
97 LOG(FATAL) << "No SIMD for " << instruction->GetId();
98}
99
100// Helper to set up locations for vector binary operations.
101static void CreateVecBinOpLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) {
102 LocationSummary* locations = new (arena) LocationSummary(instruction);
103 switch (instruction->GetPackedType()) {
104 case Primitive::kPrimBoolean:
105 case Primitive::kPrimByte:
106 case Primitive::kPrimChar:
107 case Primitive::kPrimShort:
108 case Primitive::kPrimInt:
109 case Primitive::kPrimFloat:
110 case Primitive::kPrimDouble:
111 DCHECK(locations);
112 break;
113 default:
114 LOG(FATAL) << "Unsupported SIMD type";
115 UNREACHABLE();
116 }
117}
118
119void LocationsBuilderARM::VisitVecAdd(HVecAdd* instruction) {
120 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
121}
122
123void InstructionCodeGeneratorARM::VisitVecAdd(HVecAdd* instruction) {
124 LOG(FATAL) << "No SIMD for " << instruction->GetId();
125}
126
Aart Bikf3e61ee2017-04-12 17:09:20 -0700127void LocationsBuilderARM::VisitVecHalvingAdd(HVecHalvingAdd* instruction) {
128 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
129}
130
131void InstructionCodeGeneratorARM::VisitVecHalvingAdd(HVecHalvingAdd* instruction) {
132 LOG(FATAL) << "No SIMD for " << instruction->GetId();
133}
134
Aart Bikf8f5a162017-02-06 15:35:29 -0800135void LocationsBuilderARM::VisitVecSub(HVecSub* instruction) {
136 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
137}
138
139void InstructionCodeGeneratorARM::VisitVecSub(HVecSub* instruction) {
140 LOG(FATAL) << "No SIMD for " << instruction->GetId();
141}
142
143void LocationsBuilderARM::VisitVecMul(HVecMul* instruction) {
144 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
145}
146
147void InstructionCodeGeneratorARM::VisitVecMul(HVecMul* instruction) {
148 LOG(FATAL) << "No SIMD for " << instruction->GetId();
149}
150
151void LocationsBuilderARM::VisitVecDiv(HVecDiv* instruction) {
152 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
153}
154
155void InstructionCodeGeneratorARM::VisitVecDiv(HVecDiv* instruction) {
156 LOG(FATAL) << "No SIMD for " << instruction->GetId();
157}
158
Aart Bikf3e61ee2017-04-12 17:09:20 -0700159void LocationsBuilderARM::VisitVecMin(HVecMin* instruction) {
160 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
161}
162
163void InstructionCodeGeneratorARM::VisitVecMin(HVecMin* instruction) {
164 LOG(FATAL) << "No SIMD for " << instruction->GetId();
165}
166
167void LocationsBuilderARM::VisitVecMax(HVecMax* instruction) {
168 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
169}
170
171void InstructionCodeGeneratorARM::VisitVecMax(HVecMax* instruction) {
172 LOG(FATAL) << "No SIMD for " << instruction->GetId();
173}
174
Aart Bikf8f5a162017-02-06 15:35:29 -0800175void LocationsBuilderARM::VisitVecAnd(HVecAnd* instruction) {
176 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
177}
178
179void InstructionCodeGeneratorARM::VisitVecAnd(HVecAnd* instruction) {
180 LOG(FATAL) << "No SIMD for " << instruction->GetId();
181}
182
183void LocationsBuilderARM::VisitVecAndNot(HVecAndNot* instruction) {
184 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
185}
186
187void InstructionCodeGeneratorARM::VisitVecAndNot(HVecAndNot* instruction) {
188 LOG(FATAL) << "No SIMD for " << instruction->GetId();
189}
190
191void LocationsBuilderARM::VisitVecOr(HVecOr* instruction) {
192 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
193}
194
195void InstructionCodeGeneratorARM::VisitVecOr(HVecOr* instruction) {
196 LOG(FATAL) << "No SIMD for " << instruction->GetId();
197}
198
199void LocationsBuilderARM::VisitVecXor(HVecXor* instruction) {
200 CreateVecBinOpLocations(GetGraph()->GetArena(), instruction);
201}
202
203void InstructionCodeGeneratorARM::VisitVecXor(HVecXor* instruction) {
204 LOG(FATAL) << "No SIMD for " << instruction->GetId();
205}
206
207// Helper to set up locations for vector shift operations.
208static void CreateVecShiftLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) {
209 LocationSummary* locations = new (arena) LocationSummary(instruction);
210 switch (instruction->GetPackedType()) {
211 case Primitive::kPrimByte:
212 case Primitive::kPrimChar:
213 case Primitive::kPrimShort:
214 case Primitive::kPrimInt:
215 case Primitive::kPrimLong:
216 DCHECK(locations);
217 break;
218 default:
219 LOG(FATAL) << "Unsupported SIMD type";
220 UNREACHABLE();
221 }
222}
223
224void LocationsBuilderARM::VisitVecShl(HVecShl* instruction) {
225 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
226}
227
228void InstructionCodeGeneratorARM::VisitVecShl(HVecShl* instruction) {
229 LOG(FATAL) << "No SIMD for " << instruction->GetId();
230}
231
232void LocationsBuilderARM::VisitVecShr(HVecShr* instruction) {
233 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
234}
235
236void InstructionCodeGeneratorARM::VisitVecShr(HVecShr* instruction) {
237 LOG(FATAL) << "No SIMD for " << instruction->GetId();
238}
239
240void LocationsBuilderARM::VisitVecUShr(HVecUShr* instruction) {
241 CreateVecShiftLocations(GetGraph()->GetArena(), instruction);
242}
243
244void InstructionCodeGeneratorARM::VisitVecUShr(HVecUShr* instruction) {
245 LOG(FATAL) << "No SIMD for " << instruction->GetId();
246}
247
Artem Serovf34dd202017-04-10 17:41:46 +0100248void LocationsBuilderARM::VisitVecMultiplyAccumulate(HVecMultiplyAccumulate* instr) {
249 LOG(FATAL) << "No SIMD for " << instr->GetId();
250}
251
252void InstructionCodeGeneratorARM::VisitVecMultiplyAccumulate(HVecMultiplyAccumulate* instr) {
253 LOG(FATAL) << "No SIMD for " << instr->GetId();
254}
255
Aart Bikf8f5a162017-02-06 15:35:29 -0800256void LocationsBuilderARM::VisitVecLoad(HVecLoad* instruction) {
257 LOG(FATAL) << "No SIMD for " << instruction->GetId();
258}
259
260void InstructionCodeGeneratorARM::VisitVecLoad(HVecLoad* instruction) {
261 LOG(FATAL) << "No SIMD for " << instruction->GetId();
262}
263
264void LocationsBuilderARM::VisitVecStore(HVecStore* instruction) {
265 LOG(FATAL) << "No SIMD for " << instruction->GetId();
266}
267
268void InstructionCodeGeneratorARM::VisitVecStore(HVecStore* instruction) {
269 LOG(FATAL) << "No SIMD for " << instruction->GetId();
270}
271
272#undef __
273
274} // namespace arm
275} // namespace art