blob: 5263b8de7e48b37920af96817e6b4721c3851f3c [file] [log] [blame]
buzbeecbd6d442012-11-17 14:11:25 -08001/*
2 * Copyright (C) 2012 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
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_COMPILER_DEX_COMPILER_ENUMS_H_
18#define ART_COMPILER_DEX_COMPILER_ENUMS_H_
buzbeecbd6d442012-11-17 14:11:25 -080019
20#include "dex_instruction.h"
21
22namespace art {
23
24enum RegisterClass {
Serban Constantinescu032d3772014-05-23 17:38:18 +010025 kInvalidRegClass,
buzbeecbd6d442012-11-17 14:11:25 -080026 kCoreReg,
27 kFPReg,
buzbeea0cd2d72014-06-01 09:33:49 -070028 kRefReg,
buzbeecbd6d442012-11-17 14:11:25 -080029 kAnyReg,
30};
31
buzbee091cc402014-03-31 10:14:40 -070032enum BitsUsed {
33 kSize32Bits,
34 kSize64Bits,
35 kSize128Bits,
36 kSize256Bits,
37 kSize512Bits,
38 kSize1024Bits,
39};
40
buzbeecbd6d442012-11-17 14:11:25 -080041enum SpecialTargetRegister {
buzbee02031b12012-11-23 09:41:35 -080042 kSelf, // Thread pointer.
43 kSuspend, // Used to reduce suspend checks for some targets.
buzbeecbd6d442012-11-17 14:11:25 -080044 kLr,
45 kPc,
46 kSp,
47 kArg0,
48 kArg1,
49 kArg2,
50 kArg3,
Dmitry Petrochenko58994cd2014-05-17 01:02:18 +070051 kArg4,
52 kArg5,
buzbee33ae5582014-06-12 14:56:32 -070053 kArg6,
54 kArg7,
buzbeecbd6d442012-11-17 14:11:25 -080055 kFArg0,
56 kFArg1,
57 kFArg2,
58 kFArg3,
Dmitry Petrochenko58994cd2014-05-17 01:02:18 +070059 kFArg4,
60 kFArg5,
61 kFArg6,
62 kFArg7,
buzbeecbd6d442012-11-17 14:11:25 -080063 kRet0,
64 kRet1,
65 kInvokeTgt,
Jeff Hao88474b42013-10-23 16:24:40 -070066 kHiddenArg,
67 kHiddenFpArg,
buzbeecbd6d442012-11-17 14:11:25 -080068 kCount
69};
70
71enum RegLocationType {
Brian Carlstrom7934ac22013-07-26 10:54:15 -070072 kLocDalvikFrame = 0, // Normal Dalvik register
buzbeecbd6d442012-11-17 14:11:25 -080073 kLocPhysReg,
74 kLocCompilerTemp,
75 kLocInvalid
76};
77
78enum BBType {
buzbee0d829482013-10-11 15:24:55 -070079 kNullBlock,
buzbeecbd6d442012-11-17 14:11:25 -080080 kEntryBlock,
81 kDalvikByteCode,
82 kExitBlock,
83 kExceptionHandling,
84 kDead,
85};
86
buzbee02031b12012-11-23 09:41:35 -080087// Shared pseudo opcodes - must be < 0.
buzbeecbd6d442012-11-17 14:11:25 -080088enum LIRPseudoOpcode {
buzbeea169e1d2012-12-05 14:26:44 -080089 kPseudoExportedPC = -16,
90 kPseudoSafepointPC = -15,
91 kPseudoIntrinsicRetry = -14,
92 kPseudoSuspendTarget = -13,
93 kPseudoThrowTarget = -12,
94 kPseudoCaseLabel = -11,
95 kPseudoMethodEntry = -10,
96 kPseudoMethodExit = -9,
97 kPseudoBarrier = -8,
buzbeecbd6d442012-11-17 14:11:25 -080098 kPseudoEntryBlock = -7,
99 kPseudoExitBlock = -6,
100 kPseudoTargetLabel = -5,
101 kPseudoDalvikByteCodeBoundary = -4,
102 kPseudoPseudoAlign4 = -3,
103 kPseudoEHBlockLabel = -2,
104 kPseudoNormalBlockLabel = -1,
105};
106
107enum ExtendedMIROpcode {
108 kMirOpFirst = kNumPackedOpcodes,
109 kMirOpPhi = kMirOpFirst,
110 kMirOpCopy,
111 kMirOpFusedCmplFloat,
112 kMirOpFusedCmpgFloat,
113 kMirOpFusedCmplDouble,
114 kMirOpFusedCmpgDouble,
115 kMirOpFusedCmpLong,
116 kMirOpNop,
Razvan A Lupusoru76423242014-08-04 09:38:46 -0700117
118 // @brief Do a null check on the object register.
119 // @details The backends may implement this implicitly or explicitly. This MIR is guaranteed
120 // to have the correct offset as an exception thrower.
121 // vA: object register
buzbeecbd6d442012-11-17 14:11:25 -0800122 kMirOpNullCheck,
Razvan A Lupusoru76423242014-08-04 09:38:46 -0700123
buzbeecbd6d442012-11-17 14:11:25 -0800124 kMirOpRangeCheck,
125 kMirOpDivZeroCheck,
126 kMirOpCheck,
buzbeea169e1d2012-12-05 14:26:44 -0800127 kMirOpCheckPart2,
buzbeef662a7c2013-02-12 16:19:43 -0800128 kMirOpSelect,
Mark Mendelld65c51a2014-04-29 16:55:20 -0400129
130 // Vector opcodes:
131 // TypeSize is an encoded field giving the element type and the vector size.
132 // It is encoded as OpSize << 16 | (number of bits in vector)
133 //
134 // Destination and source are integers that will be interpreted by the
135 // backend that supports Vector operations. Backends are permitted to support only
136 // certain vector register sizes.
137 //
138 // At this point, only two operand instructions are supported. Three operand instructions
139 // could be supported by using a bit in TypeSize and arg[0] where needed.
140
141 // @brief MIR to move constant data to a vector register
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700142 // vA: destination
143 // vB: number of bits in register
Mark Mendelld65c51a2014-04-29 16:55:20 -0400144 // args[0]~args[3]: up to 128 bits of data for initialization
145 kMirOpConstVector,
146
147 // @brief MIR to move a vectorized register to another
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700148 // vA: destination
149 // vB: source
150 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400151 kMirOpMoveVector,
152
153 // @brief Packed multiply of units in two vector registers: vB = vB .* vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700154 // vA: destination and source
155 // vB: source
156 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400157 kMirOpPackedMultiply,
158
159 // @brief Packed addition of units in two vector registers: vB = vB .+ vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700160 // vA: destination and source
161 // vB: source
162 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400163 kMirOpPackedAddition,
164
165 // @brief Packed subtraction of units in two vector registers: vB = vB .- vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700166 // vA: destination and source
167 // vB: source
168 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400169 kMirOpPackedSubtract,
170
171 // @brief Packed shift left of units in two vector registers: vB = vB .<< vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700172 // vA: destination and source
173 // vB: amount to shift
174 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400175 kMirOpPackedShiftLeft,
176
177 // @brief Packed signed shift right of units in two vector registers: vB = vB .>> vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700178 // vA: destination and source
179 // vB: amount to shift
180 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400181 kMirOpPackedSignedShiftRight,
182
183 // @brief Packed unsigned shift right of units in two vector registers: vB = vB .>>> vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700184 // vA: destination and source
185 // vB: amount to shift
186 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400187 kMirOpPackedUnsignedShiftRight,
188
189 // @brief Packed bitwise and of units in two vector registers: vB = vB .& vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700190 // vA: destination and source
191 // vB: source
192 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400193 kMirOpPackedAnd,
194
195 // @brief Packed bitwise or of units in two vector registers: vB = vB .| vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700196 // vA: destination and source
197 // vB: source
198 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400199 kMirOpPackedOr,
200
201 // @brief Packed bitwise xor of units in two vector registers: vB = vB .^ vC using vA to know the type of the vector.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700202 // vA: destination and source
203 // vB: source
204 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400205 kMirOpPackedXor,
206
207 // @brief Reduce a 128-bit packed element into a single VR by taking lower bits
208 // @details Instruction does a horizontal addition of the packed elements and then adds it to VR
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700209 // vA: destination and source VR (not vector register)
210 // vB: source (vector register)
211 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400212 kMirOpPackedAddReduce,
213
214 // @brief Extract a packed element into a single VR.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700215 // vA: destination VR (not vector register)
216 // vB: source (vector register)
217 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400218 // arg[0]: The index to use for extraction from vector register (which packed element)
219 kMirOpPackedReduce,
220
221 // @brief Create a vector value, with all TypeSize values equal to vC
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700222 // vA: destination vector register
223 // vB: source VR (not vector register)
224 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400225 kMirOpPackedSet,
226
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700227 // @brief Reserve N vector registers (named 0..N-1)
228 // vA: Number of registers
229 // @note: The backend may choose to map vector numbers used in vector opcodes.
230 // Reserved registers are removed from the list of backend temporary pool.
231 kMirOpReserveVectorRegisters,
232
233 // @brief Free Reserved vector registers
234 // @note: All currently reserved vector registers are returned to the temporary pool.
235 kMirOpReturnVectorRegisters,
236
Jean Christophe Beylerb5bce7c2014-07-25 12:32:18 -0700237 // @brief Create a memory barrier.
238 // vA: a constant defined by enum MemBarrierKind.
239 kMirOpMemBarrier,
240
buzbeecbd6d442012-11-17 14:11:25 -0800241 kMirOpLast,
242};
243
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700244enum MIROptimizationFlagPositions {
buzbeecbd6d442012-11-17 14:11:25 -0800245 kMIRIgnoreNullCheck = 0,
246 kMIRNullCheckOnly,
247 kMIRIgnoreRangeCheck,
248 kMIRRangeCheckOnly,
Vladimir Markobfea9c22014-01-17 17:49:33 +0000249 kMIRIgnoreClInitCheck,
buzbee02031b12012-11-23 09:41:35 -0800250 kMIRInlined, // Invoke is inlined (ie dead).
251 kMIRInlinedPred, // Invoke is inlined via prediction.
252 kMIRCallee, // Instruction is inlined from callee.
buzbeecbd6d442012-11-17 14:11:25 -0800253 kMIRIgnoreSuspendCheck,
254 kMIRDup,
buzbee02031b12012-11-23 09:41:35 -0800255 kMIRMark, // Temporary node mark.
Jean Christophe Beylerb5bce7c2014-07-25 12:32:18 -0700256 kMIRStoreNonTemporal,
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700257 kMIRLastMIRFlag,
buzbeecbd6d442012-11-17 14:11:25 -0800258};
259
buzbee02031b12012-11-23 09:41:35 -0800260// For successor_block_list.
buzbeecbd6d442012-11-17 14:11:25 -0800261enum BlockListType {
262 kNotUsed = 0,
263 kCatch,
264 kPackedSwitch,
265 kSparseSwitch,
266};
267
268enum AssemblerStatus {
269 kSuccess,
270 kRetryAll,
271};
272
273enum OpSize {
buzbee695d13a2014-04-19 13:32:20 -0700274 kWord, // Natural word size of target (32/64).
275 k32,
276 k64,
277 kReference, // Object reference; compressed on 64-bit targets.
buzbeecbd6d442012-11-17 14:11:25 -0800278 kSingle,
279 kDouble,
280 kUnsignedHalf,
281 kSignedHalf,
282 kUnsignedByte,
283 kSignedByte,
284};
285
286std::ostream& operator<<(std::ostream& os, const OpSize& kind);
287
288enum OpKind {
289 kOpMov,
Razvan A Lupusorubd288c22013-12-20 17:27:23 -0800290 kOpCmov,
buzbeecbd6d442012-11-17 14:11:25 -0800291 kOpMvn,
292 kOpCmp,
293 kOpLsl,
294 kOpLsr,
295 kOpAsr,
296 kOpRor,
297 kOpNot,
298 kOpAnd,
299 kOpOr,
300 kOpXor,
301 kOpNeg,
302 kOpAdd,
303 kOpAdc,
304 kOpSub,
305 kOpSbc,
306 kOpRsub,
307 kOpMul,
308 kOpDiv,
309 kOpRem,
310 kOpBic,
311 kOpCmn,
312 kOpTst,
Vladimir Markoa8b4caf2013-10-24 15:08:57 +0100313 kOpRev,
314 kOpRevsh,
buzbeecbd6d442012-11-17 14:11:25 -0800315 kOpBkpt,
316 kOpBlx,
317 kOpPush,
318 kOpPop,
319 kOp2Char,
320 kOp2Short,
321 kOp2Byte,
322 kOpCondBr,
323 kOpUncondBr,
324 kOpBx,
325 kOpInvalid,
326};
327
Razvan A Lupusoru2c498d12014-01-29 16:02:57 -0800328enum MoveType {
329 kMov8GP, // Move 8-bit general purpose register.
330 kMov16GP, // Move 16-bit general purpose register.
331 kMov32GP, // Move 32-bit general purpose register.
332 kMov64GP, // Move 64-bit general purpose register.
333 kMov32FP, // Move 32-bit FP register.
334 kMov64FP, // Move 64-bit FP register.
335 kMovLo64FP, // Move low 32-bits of 64-bit FP register.
336 kMovHi64FP, // Move high 32-bits of 64-bit FP register.
337 kMovU128FP, // Move 128-bit FP register to/from possibly unaligned region.
338 kMov128FP = kMovU128FP,
339 kMovA128FP, // Move 128-bit FP register to/from region surely aligned to 16-bytes.
340 kMovLo128FP, // Move low 64-bits of 128-bit FP register.
341 kMovHi128FP, // Move high 64-bits of 128-bit FP register.
342};
343
buzbeecbd6d442012-11-17 14:11:25 -0800344std::ostream& operator<<(std::ostream& os, const OpKind& kind);
345
346enum ConditionCode {
347 kCondEq, // equal
348 kCondNe, // not equal
Vladimir Marko58af1f92013-12-19 13:31:15 +0000349 kCondCs, // carry set
350 kCondCc, // carry clear
Vladimir Marko459f4df2013-12-20 17:03:09 +0000351 kCondUlt, // unsigned less than
352 kCondUge, // unsigned greater than or same
buzbeecbd6d442012-11-17 14:11:25 -0800353 kCondMi, // minus
354 kCondPl, // plus, positive or zero
355 kCondVs, // overflow
356 kCondVc, // no overflow
357 kCondHi, // unsigned greater than
358 kCondLs, // unsigned lower or same
359 kCondGe, // signed greater than or equal
360 kCondLt, // signed less than
361 kCondGt, // signed greater than
362 kCondLe, // signed less than or equal
363 kCondAl, // always
364 kCondNv, // never
365};
366
367std::ostream& operator<<(std::ostream& os, const ConditionCode& kind);
368
369// Target specific condition encodings
370enum ArmConditionCode {
371 kArmCondEq = 0x0, // 0000
372 kArmCondNe = 0x1, // 0001
373 kArmCondCs = 0x2, // 0010
374 kArmCondCc = 0x3, // 0011
375 kArmCondMi = 0x4, // 0100
376 kArmCondPl = 0x5, // 0101
377 kArmCondVs = 0x6, // 0110
378 kArmCondVc = 0x7, // 0111
379 kArmCondHi = 0x8, // 1000
380 kArmCondLs = 0x9, // 1001
381 kArmCondGe = 0xa, // 1010
382 kArmCondLt = 0xb, // 1011
383 kArmCondGt = 0xc, // 1100
384 kArmCondLe = 0xd, // 1101
385 kArmCondAl = 0xe, // 1110
386 kArmCondNv = 0xf, // 1111
387};
388
389std::ostream& operator<<(std::ostream& os, const ArmConditionCode& kind);
390
391enum X86ConditionCode {
392 kX86CondO = 0x0, // overflow
393 kX86CondNo = 0x1, // not overflow
394
395 kX86CondB = 0x2, // below
396 kX86CondNae = kX86CondB, // not-above-equal
397 kX86CondC = kX86CondB, // carry
398
399 kX86CondNb = 0x3, // not-below
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700400 kX86CondAe = kX86CondNb, // above-equal
401 kX86CondNc = kX86CondNb, // not-carry
buzbeecbd6d442012-11-17 14:11:25 -0800402
403 kX86CondZ = 0x4, // zero
404 kX86CondEq = kX86CondZ, // equal
405
406 kX86CondNz = 0x5, // not-zero
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700407 kX86CondNe = kX86CondNz, // not-equal
buzbeecbd6d442012-11-17 14:11:25 -0800408
409 kX86CondBe = 0x6, // below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700410 kX86CondNa = kX86CondBe, // not-above
buzbeecbd6d442012-11-17 14:11:25 -0800411
412 kX86CondNbe = 0x7, // not-below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700413 kX86CondA = kX86CondNbe, // above
buzbeecbd6d442012-11-17 14:11:25 -0800414
415 kX86CondS = 0x8, // sign
416 kX86CondNs = 0x9, // not-sign
417
418 kX86CondP = 0xa, // 8-bit parity even
419 kX86CondPE = kX86CondP,
420
421 kX86CondNp = 0xb, // 8-bit parity odd
422 kX86CondPo = kX86CondNp,
423
424 kX86CondL = 0xc, // less-than
425 kX86CondNge = kX86CondL, // not-greater-equal
426
427 kX86CondNl = 0xd, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700428 kX86CondGe = kX86CondNl, // not-greater-equal
buzbeecbd6d442012-11-17 14:11:25 -0800429
430 kX86CondLe = 0xe, // less-than-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700431 kX86CondNg = kX86CondLe, // not-greater
buzbeecbd6d442012-11-17 14:11:25 -0800432
433 kX86CondNle = 0xf, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700434 kX86CondG = kX86CondNle, // greater
buzbeecbd6d442012-11-17 14:11:25 -0800435};
436
437std::ostream& operator<<(std::ostream& os, const X86ConditionCode& kind);
438
buzbeecbd6d442012-11-17 14:11:25 -0800439enum DividePattern {
440 DivideNone,
441 Divide3,
442 Divide5,
443 Divide7,
444};
445
446std::ostream& operator<<(std::ostream& os, const DividePattern& pattern);
447
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800448/**
449 * @brief Memory barrier types (see "The JSR-133 Cookbook for Compiler Writers").
Hans Boehm48f5c472014-06-27 14:50:10 -0700450 * @details We define the combined barrier types that are actually required
451 * by the Java Memory Model, rather than using exactly the terminology from
452 * the JSR-133 cookbook. These should, in many cases, be replaced by acquire/release
453 * primitives. Note that the JSR-133 cookbook generally does not deal with
454 * store atomicity issues, and the recipes there are not always entirely sufficient.
455 * The current recipe is as follows:
456 * -# Use AnyStore ~= (LoadStore | StoreStore) ~= release barrier before volatile store.
457 * -# Use AnyAny barrier after volatile store. (StoreLoad is as expensive.)
458 * -# Use LoadAny barrier ~= (LoadLoad | LoadStore) ~= acquire barrierafter each volatile load.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800459 * -# Use StoreStore barrier after all stores but before return from any constructor whose
Hans Boehm48f5c472014-06-27 14:50:10 -0700460 * class has final fields.
Jean Christophe Beylerb5bce7c2014-07-25 12:32:18 -0700461 * -# Use NTStoreStore to order non-temporal stores with respect to all later
462 * store-to-memory instructions. Only generated together with non-temporal stores.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800463 */
buzbee1bc37c62012-11-20 13:35:41 -0800464enum MemBarrierKind {
Hans Boehm48f5c472014-06-27 14:50:10 -0700465 kAnyStore,
466 kLoadAny,
buzbee1bc37c62012-11-20 13:35:41 -0800467 kStoreStore,
Jean Christophe Beylerb5bce7c2014-07-25 12:32:18 -0700468 kAnyAny,
469 kNTStoreStore,
buzbee1bc37c62012-11-20 13:35:41 -0800470};
471
472std::ostream& operator<<(std::ostream& os, const MemBarrierKind& kind);
473
buzbee02031b12012-11-23 09:41:35 -0800474enum OpFeatureFlags {
475 kIsBranch = 0,
476 kNoOperand,
477 kIsUnaryOp,
478 kIsBinaryOp,
479 kIsTertiaryOp,
480 kIsQuadOp,
481 kIsQuinOp,
482 kIsSextupleOp,
483 kIsIT,
Serban Constantinescu63999682014-07-15 17:44:21 +0100484 kIsMoveOp,
buzbee02031b12012-11-23 09:41:35 -0800485 kMemLoad,
486 kMemStore,
Serban Constantinescu63999682014-07-15 17:44:21 +0100487 kMemVolatile,
488 kMemScaledx0,
489 kMemScaledx2,
490 kMemScaledx4,
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700491 kPCRelFixup, // x86 FIXME: add NEEDS_FIXUP to instruction attributes.
buzbee02031b12012-11-23 09:41:35 -0800492 kRegDef0,
493 kRegDef1,
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800494 kRegDef2,
buzbee02031b12012-11-23 09:41:35 -0800495 kRegDefA,
496 kRegDefD,
497 kRegDefFPCSList0,
498 kRegDefFPCSList2,
499 kRegDefList0,
500 kRegDefList1,
501 kRegDefList2,
502 kRegDefLR,
503 kRegDefSP,
504 kRegUse0,
505 kRegUse1,
506 kRegUse2,
507 kRegUse3,
508 kRegUse4,
509 kRegUseA,
510 kRegUseC,
511 kRegUseD,
Vladimir Marko70b797d2013-12-03 15:25:24 +0000512 kRegUseB,
buzbee02031b12012-11-23 09:41:35 -0800513 kRegUseFPCSList0,
514 kRegUseFPCSList2,
515 kRegUseList0,
516 kRegUseList1,
517 kRegUseLR,
518 kRegUsePC,
519 kRegUseSP,
520 kSetsCCodes,
Serguei Katkove90501d2014-03-12 15:56:54 +0700521 kUsesCCodes,
buzbee9da5c102014-03-28 12:59:18 -0700522 kUseFpStack,
523 kUseHi,
524 kUseLo,
525 kDefHi,
526 kDefLo
buzbee02031b12012-11-23 09:41:35 -0800527};
528
buzbeef662a7c2013-02-12 16:19:43 -0800529enum SelectInstructionKind {
530 kSelectNone,
531 kSelectConst,
532 kSelectMove,
533 kSelectGoto
534};
535
buzbeea5abf702013-04-12 14:39:29 -0700536std::ostream& operator<<(std::ostream& os, const SelectInstructionKind& kind);
537
buzbeeb48819d2013-09-14 16:15:25 -0700538// LIR fixup kinds for Arm
539enum FixupKind {
540 kFixupNone,
541 kFixupLabel, // For labels we just adjust the offset.
Vladimir Marko306f0172014-01-07 18:21:20 +0000542 kFixupLoad, // Mostly for immediates.
buzbeeb48819d2013-09-14 16:15:25 -0700543 kFixupVLoad, // FP load which *may* be pc-relative.
544 kFixupCBxZ, // Cbz, Cbnz.
Zheng Xu5d7cdec2014-08-18 17:28:22 +0800545 kFixupTBxZ, // Tbz, Tbnz.
buzbeeb48819d2013-09-14 16:15:25 -0700546 kFixupPushPop, // Not really pc relative, but changes size based on args.
547 kFixupCondBranch, // Conditional branch
548 kFixupT1Branch, // Thumb1 Unconditional branch
549 kFixupT2Branch, // Thumb2 Unconditional branch
550 kFixupBlx1, // Blx1 (start of Blx1/Blx2 pair).
551 kFixupBl1, // Bl1 (start of Bl1/Bl2 pair).
552 kFixupAdr, // Adr.
553 kFixupMovImmLST, // kThumb2MovImm16LST.
554 kFixupMovImmHST, // kThumb2MovImm16HST.
555 kFixupAlign4, // Align to 4-byte boundary.
556};
557
558std::ostream& operator<<(std::ostream& os, const FixupKind& kind);
559
Andreas Gampe3c12c512014-06-24 18:46:29 +0000560enum VolatileKind {
561 kNotVolatile, // Load/Store is not volatile
562 kVolatile // Load/Store is volatile
563};
564
565std::ostream& operator<<(std::ostream& os, const VolatileKind& kind);
566
Andreas Gampeccc60262014-07-04 18:02:38 -0700567enum WideKind {
568 kNotWide, // Non-wide view
569 kWide, // Wide view
570 kRef // Ref width
571};
572
573std::ostream& operator<<(std::ostream& os, const WideKind& kind);
574
buzbeecbd6d442012-11-17 14:11:25 -0800575} // namespace art
576
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700577#endif // ART_COMPILER_DEX_COMPILER_ENUMS_H_