blob: 47cb4245d7648e9085850f2665b984a9d6c5c2fb [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
buzbeecbd6d442012-11-17 14:11:25 -0800237 kMirOpLast,
238};
239
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700240enum MIROptimizationFlagPositions {
buzbeecbd6d442012-11-17 14:11:25 -0800241 kMIRIgnoreNullCheck = 0,
242 kMIRNullCheckOnly,
243 kMIRIgnoreRangeCheck,
244 kMIRRangeCheckOnly,
Vladimir Markobfea9c22014-01-17 17:49:33 +0000245 kMIRIgnoreClInitCheck,
buzbee02031b12012-11-23 09:41:35 -0800246 kMIRInlined, // Invoke is inlined (ie dead).
247 kMIRInlinedPred, // Invoke is inlined via prediction.
248 kMIRCallee, // Instruction is inlined from callee.
buzbeecbd6d442012-11-17 14:11:25 -0800249 kMIRIgnoreSuspendCheck,
250 kMIRDup,
buzbee02031b12012-11-23 09:41:35 -0800251 kMIRMark, // Temporary node mark.
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700252 kMIRLastMIRFlag,
buzbeecbd6d442012-11-17 14:11:25 -0800253};
254
buzbee02031b12012-11-23 09:41:35 -0800255// For successor_block_list.
buzbeecbd6d442012-11-17 14:11:25 -0800256enum BlockListType {
257 kNotUsed = 0,
258 kCatch,
259 kPackedSwitch,
260 kSparseSwitch,
261};
262
263enum AssemblerStatus {
264 kSuccess,
265 kRetryAll,
266};
267
268enum OpSize {
buzbee695d13a2014-04-19 13:32:20 -0700269 kWord, // Natural word size of target (32/64).
270 k32,
271 k64,
272 kReference, // Object reference; compressed on 64-bit targets.
buzbeecbd6d442012-11-17 14:11:25 -0800273 kSingle,
274 kDouble,
275 kUnsignedHalf,
276 kSignedHalf,
277 kUnsignedByte,
278 kSignedByte,
279};
280
281std::ostream& operator<<(std::ostream& os, const OpSize& kind);
282
283enum OpKind {
284 kOpMov,
Razvan A Lupusorubd288c22013-12-20 17:27:23 -0800285 kOpCmov,
buzbeecbd6d442012-11-17 14:11:25 -0800286 kOpMvn,
287 kOpCmp,
288 kOpLsl,
289 kOpLsr,
290 kOpAsr,
291 kOpRor,
292 kOpNot,
293 kOpAnd,
294 kOpOr,
295 kOpXor,
296 kOpNeg,
297 kOpAdd,
298 kOpAdc,
299 kOpSub,
300 kOpSbc,
301 kOpRsub,
302 kOpMul,
303 kOpDiv,
304 kOpRem,
305 kOpBic,
306 kOpCmn,
307 kOpTst,
Vladimir Markoa8b4caf2013-10-24 15:08:57 +0100308 kOpRev,
309 kOpRevsh,
buzbeecbd6d442012-11-17 14:11:25 -0800310 kOpBkpt,
311 kOpBlx,
312 kOpPush,
313 kOpPop,
314 kOp2Char,
315 kOp2Short,
316 kOp2Byte,
317 kOpCondBr,
318 kOpUncondBr,
319 kOpBx,
320 kOpInvalid,
321};
322
Razvan A Lupusoru2c498d12014-01-29 16:02:57 -0800323enum MoveType {
324 kMov8GP, // Move 8-bit general purpose register.
325 kMov16GP, // Move 16-bit general purpose register.
326 kMov32GP, // Move 32-bit general purpose register.
327 kMov64GP, // Move 64-bit general purpose register.
328 kMov32FP, // Move 32-bit FP register.
329 kMov64FP, // Move 64-bit FP register.
330 kMovLo64FP, // Move low 32-bits of 64-bit FP register.
331 kMovHi64FP, // Move high 32-bits of 64-bit FP register.
332 kMovU128FP, // Move 128-bit FP register to/from possibly unaligned region.
333 kMov128FP = kMovU128FP,
334 kMovA128FP, // Move 128-bit FP register to/from region surely aligned to 16-bytes.
335 kMovLo128FP, // Move low 64-bits of 128-bit FP register.
336 kMovHi128FP, // Move high 64-bits of 128-bit FP register.
337};
338
buzbeecbd6d442012-11-17 14:11:25 -0800339std::ostream& operator<<(std::ostream& os, const OpKind& kind);
340
341enum ConditionCode {
342 kCondEq, // equal
343 kCondNe, // not equal
Vladimir Marko58af1f92013-12-19 13:31:15 +0000344 kCondCs, // carry set
345 kCondCc, // carry clear
Vladimir Marko459f4df2013-12-20 17:03:09 +0000346 kCondUlt, // unsigned less than
347 kCondUge, // unsigned greater than or same
buzbeecbd6d442012-11-17 14:11:25 -0800348 kCondMi, // minus
349 kCondPl, // plus, positive or zero
350 kCondVs, // overflow
351 kCondVc, // no overflow
352 kCondHi, // unsigned greater than
353 kCondLs, // unsigned lower or same
354 kCondGe, // signed greater than or equal
355 kCondLt, // signed less than
356 kCondGt, // signed greater than
357 kCondLe, // signed less than or equal
358 kCondAl, // always
359 kCondNv, // never
360};
361
362std::ostream& operator<<(std::ostream& os, const ConditionCode& kind);
363
364// Target specific condition encodings
365enum ArmConditionCode {
366 kArmCondEq = 0x0, // 0000
367 kArmCondNe = 0x1, // 0001
368 kArmCondCs = 0x2, // 0010
369 kArmCondCc = 0x3, // 0011
370 kArmCondMi = 0x4, // 0100
371 kArmCondPl = 0x5, // 0101
372 kArmCondVs = 0x6, // 0110
373 kArmCondVc = 0x7, // 0111
374 kArmCondHi = 0x8, // 1000
375 kArmCondLs = 0x9, // 1001
376 kArmCondGe = 0xa, // 1010
377 kArmCondLt = 0xb, // 1011
378 kArmCondGt = 0xc, // 1100
379 kArmCondLe = 0xd, // 1101
380 kArmCondAl = 0xe, // 1110
381 kArmCondNv = 0xf, // 1111
382};
383
384std::ostream& operator<<(std::ostream& os, const ArmConditionCode& kind);
385
386enum X86ConditionCode {
387 kX86CondO = 0x0, // overflow
388 kX86CondNo = 0x1, // not overflow
389
390 kX86CondB = 0x2, // below
391 kX86CondNae = kX86CondB, // not-above-equal
392 kX86CondC = kX86CondB, // carry
393
394 kX86CondNb = 0x3, // not-below
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700395 kX86CondAe = kX86CondNb, // above-equal
396 kX86CondNc = kX86CondNb, // not-carry
buzbeecbd6d442012-11-17 14:11:25 -0800397
398 kX86CondZ = 0x4, // zero
399 kX86CondEq = kX86CondZ, // equal
400
401 kX86CondNz = 0x5, // not-zero
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700402 kX86CondNe = kX86CondNz, // not-equal
buzbeecbd6d442012-11-17 14:11:25 -0800403
404 kX86CondBe = 0x6, // below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700405 kX86CondNa = kX86CondBe, // not-above
buzbeecbd6d442012-11-17 14:11:25 -0800406
407 kX86CondNbe = 0x7, // not-below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700408 kX86CondA = kX86CondNbe, // above
buzbeecbd6d442012-11-17 14:11:25 -0800409
410 kX86CondS = 0x8, // sign
411 kX86CondNs = 0x9, // not-sign
412
413 kX86CondP = 0xa, // 8-bit parity even
414 kX86CondPE = kX86CondP,
415
416 kX86CondNp = 0xb, // 8-bit parity odd
417 kX86CondPo = kX86CondNp,
418
419 kX86CondL = 0xc, // less-than
420 kX86CondNge = kX86CondL, // not-greater-equal
421
422 kX86CondNl = 0xd, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700423 kX86CondGe = kX86CondNl, // not-greater-equal
buzbeecbd6d442012-11-17 14:11:25 -0800424
425 kX86CondLe = 0xe, // less-than-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700426 kX86CondNg = kX86CondLe, // not-greater
buzbeecbd6d442012-11-17 14:11:25 -0800427
428 kX86CondNle = 0xf, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700429 kX86CondG = kX86CondNle, // greater
buzbeecbd6d442012-11-17 14:11:25 -0800430};
431
432std::ostream& operator<<(std::ostream& os, const X86ConditionCode& kind);
433
buzbeecbd6d442012-11-17 14:11:25 -0800434enum DividePattern {
435 DivideNone,
436 Divide3,
437 Divide5,
438 Divide7,
439};
440
441std::ostream& operator<<(std::ostream& os, const DividePattern& pattern);
442
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800443/**
444 * @brief Memory barrier types (see "The JSR-133 Cookbook for Compiler Writers").
Hans Boehm48f5c472014-06-27 14:50:10 -0700445 * @details We define the combined barrier types that are actually required
446 * by the Java Memory Model, rather than using exactly the terminology from
447 * the JSR-133 cookbook. These should, in many cases, be replaced by acquire/release
448 * primitives. Note that the JSR-133 cookbook generally does not deal with
449 * store atomicity issues, and the recipes there are not always entirely sufficient.
450 * The current recipe is as follows:
451 * -# Use AnyStore ~= (LoadStore | StoreStore) ~= release barrier before volatile store.
452 * -# Use AnyAny barrier after volatile store. (StoreLoad is as expensive.)
453 * -# Use LoadAny barrier ~= (LoadLoad | LoadStore) ~= acquire barrierafter each volatile load.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800454 * -# Use StoreStore barrier after all stores but before return from any constructor whose
Hans Boehm48f5c472014-06-27 14:50:10 -0700455 * class has final fields.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800456 */
buzbee1bc37c62012-11-20 13:35:41 -0800457enum MemBarrierKind {
Hans Boehm48f5c472014-06-27 14:50:10 -0700458 kAnyStore,
459 kLoadAny,
buzbee1bc37c62012-11-20 13:35:41 -0800460 kStoreStore,
Hans Boehm48f5c472014-06-27 14:50:10 -0700461 kAnyAny
buzbee1bc37c62012-11-20 13:35:41 -0800462};
463
464std::ostream& operator<<(std::ostream& os, const MemBarrierKind& kind);
465
buzbee02031b12012-11-23 09:41:35 -0800466enum OpFeatureFlags {
467 kIsBranch = 0,
468 kNoOperand,
469 kIsUnaryOp,
470 kIsBinaryOp,
471 kIsTertiaryOp,
472 kIsQuadOp,
473 kIsQuinOp,
474 kIsSextupleOp,
475 kIsIT,
Serban Constantinescu63999682014-07-15 17:44:21 +0100476 kIsMoveOp,
buzbee02031b12012-11-23 09:41:35 -0800477 kMemLoad,
478 kMemStore,
Serban Constantinescu63999682014-07-15 17:44:21 +0100479 kMemVolatile,
480 kMemScaledx0,
481 kMemScaledx2,
482 kMemScaledx4,
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700483 kPCRelFixup, // x86 FIXME: add NEEDS_FIXUP to instruction attributes.
buzbee02031b12012-11-23 09:41:35 -0800484 kRegDef0,
485 kRegDef1,
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800486 kRegDef2,
buzbee02031b12012-11-23 09:41:35 -0800487 kRegDefA,
488 kRegDefD,
489 kRegDefFPCSList0,
490 kRegDefFPCSList2,
491 kRegDefList0,
492 kRegDefList1,
493 kRegDefList2,
494 kRegDefLR,
495 kRegDefSP,
496 kRegUse0,
497 kRegUse1,
498 kRegUse2,
499 kRegUse3,
500 kRegUse4,
501 kRegUseA,
502 kRegUseC,
503 kRegUseD,
Vladimir Marko70b797d2013-12-03 15:25:24 +0000504 kRegUseB,
buzbee02031b12012-11-23 09:41:35 -0800505 kRegUseFPCSList0,
506 kRegUseFPCSList2,
507 kRegUseList0,
508 kRegUseList1,
509 kRegUseLR,
510 kRegUsePC,
511 kRegUseSP,
512 kSetsCCodes,
Serguei Katkove90501d2014-03-12 15:56:54 +0700513 kUsesCCodes,
buzbee9da5c102014-03-28 12:59:18 -0700514 kUseFpStack,
515 kUseHi,
516 kUseLo,
517 kDefHi,
518 kDefLo
buzbee02031b12012-11-23 09:41:35 -0800519};
520
buzbeef662a7c2013-02-12 16:19:43 -0800521enum SelectInstructionKind {
522 kSelectNone,
523 kSelectConst,
524 kSelectMove,
525 kSelectGoto
526};
527
buzbeea5abf702013-04-12 14:39:29 -0700528std::ostream& operator<<(std::ostream& os, const SelectInstructionKind& kind);
529
buzbeeb48819d2013-09-14 16:15:25 -0700530// LIR fixup kinds for Arm
531enum FixupKind {
532 kFixupNone,
533 kFixupLabel, // For labels we just adjust the offset.
Vladimir Marko306f0172014-01-07 18:21:20 +0000534 kFixupLoad, // Mostly for immediates.
buzbeeb48819d2013-09-14 16:15:25 -0700535 kFixupVLoad, // FP load which *may* be pc-relative.
536 kFixupCBxZ, // Cbz, Cbnz.
Zheng Xu5d7cdec2014-08-18 17:28:22 +0800537 kFixupTBxZ, // Tbz, Tbnz.
buzbeeb48819d2013-09-14 16:15:25 -0700538 kFixupPushPop, // Not really pc relative, but changes size based on args.
539 kFixupCondBranch, // Conditional branch
540 kFixupT1Branch, // Thumb1 Unconditional branch
541 kFixupT2Branch, // Thumb2 Unconditional branch
542 kFixupBlx1, // Blx1 (start of Blx1/Blx2 pair).
543 kFixupBl1, // Bl1 (start of Bl1/Bl2 pair).
544 kFixupAdr, // Adr.
545 kFixupMovImmLST, // kThumb2MovImm16LST.
546 kFixupMovImmHST, // kThumb2MovImm16HST.
547 kFixupAlign4, // Align to 4-byte boundary.
548};
549
550std::ostream& operator<<(std::ostream& os, const FixupKind& kind);
551
Andreas Gampe3c12c512014-06-24 18:46:29 +0000552enum VolatileKind {
553 kNotVolatile, // Load/Store is not volatile
554 kVolatile // Load/Store is volatile
555};
556
557std::ostream& operator<<(std::ostream& os, const VolatileKind& kind);
558
Andreas Gampeccc60262014-07-04 18:02:38 -0700559enum WideKind {
560 kNotWide, // Non-wide view
561 kWide, // Wide view
562 kRef // Ref width
563};
564
565std::ostream& operator<<(std::ostream& os, const WideKind& kind);
566
buzbeecbd6d442012-11-17 14:11:25 -0800567} // namespace art
568
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700569#endif // ART_COMPILER_DEX_COMPILER_ENUMS_H_