blob: bdedadbcf85d0314556aa7e80e46a04c07d3b1ce [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,
117 kMirOpNullCheck,
118 kMirOpRangeCheck,
119 kMirOpDivZeroCheck,
120 kMirOpCheck,
buzbeea169e1d2012-12-05 14:26:44 -0800121 kMirOpCheckPart2,
buzbeef662a7c2013-02-12 16:19:43 -0800122 kMirOpSelect,
Mark Mendelld65c51a2014-04-29 16:55:20 -0400123
124 // Vector opcodes:
125 // TypeSize is an encoded field giving the element type and the vector size.
126 // It is encoded as OpSize << 16 | (number of bits in vector)
127 //
128 // Destination and source are integers that will be interpreted by the
129 // backend that supports Vector operations. Backends are permitted to support only
130 // certain vector register sizes.
131 //
132 // At this point, only two operand instructions are supported. Three operand instructions
133 // could be supported by using a bit in TypeSize and arg[0] where needed.
134
135 // @brief MIR to move constant data to a vector register
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700136 // vA: destination
137 // vB: number of bits in register
Mark Mendelld65c51a2014-04-29 16:55:20 -0400138 // args[0]~args[3]: up to 128 bits of data for initialization
139 kMirOpConstVector,
140
141 // @brief MIR to move a vectorized register to another
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700142 // vA: destination
143 // vB: source
144 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400145 kMirOpMoveVector,
146
147 // @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 -0700148 // vA: destination and source
149 // vB: source
150 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400151 kMirOpPackedMultiply,
152
153 // @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 -0700154 // vA: destination and source
155 // vB: source
156 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400157 kMirOpPackedAddition,
158
159 // @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 -0700160 // vA: destination and source
161 // vB: source
162 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400163 kMirOpPackedSubtract,
164
165 // @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 -0700166 // vA: destination and source
167 // vB: amount to shift
168 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400169 kMirOpPackedShiftLeft,
170
171 // @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 -0700172 // vA: destination and source
173 // vB: amount to shift
174 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400175 kMirOpPackedSignedShiftRight,
176
177 // @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 -0700178 // vA: destination and source
179 // vB: amount to shift
180 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400181 kMirOpPackedUnsignedShiftRight,
182
183 // @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 -0700184 // vA: destination and source
185 // vB: source
186 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400187 kMirOpPackedAnd,
188
189 // @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 -0700190 // vA: destination and source
191 // vB: source
192 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400193 kMirOpPackedOr,
194
195 // @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 -0700196 // vA: destination and source
197 // vB: source
198 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400199 kMirOpPackedXor,
200
201 // @brief Reduce a 128-bit packed element into a single VR by taking lower bits
202 // @details Instruction does a horizontal addition of the packed elements and then adds it to VR
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700203 // vA: destination and source VR (not vector register)
204 // vB: source (vector register)
205 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400206 kMirOpPackedAddReduce,
207
208 // @brief Extract a packed element into a single VR.
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700209 // vA: destination VR (not vector register)
210 // vB: source (vector register)
211 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400212 // arg[0]: The index to use for extraction from vector register (which packed element)
213 kMirOpPackedReduce,
214
215 // @brief Create a vector value, with all TypeSize values equal to vC
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700216 // vA: destination vector register
217 // vB: source VR (not vector register)
218 // vC: TypeSize
Mark Mendelld65c51a2014-04-29 16:55:20 -0400219 kMirOpPackedSet,
220
Udayan Banerji60bfe7b2014-07-08 19:59:43 -0700221 // @brief Reserve N vector registers (named 0..N-1)
222 // vA: Number of registers
223 // @note: The backend may choose to map vector numbers used in vector opcodes.
224 // Reserved registers are removed from the list of backend temporary pool.
225 kMirOpReserveVectorRegisters,
226
227 // @brief Free Reserved vector registers
228 // @note: All currently reserved vector registers are returned to the temporary pool.
229 kMirOpReturnVectorRegisters,
230
buzbeecbd6d442012-11-17 14:11:25 -0800231 kMirOpLast,
232};
233
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700234enum MIROptimizationFlagPositions {
buzbeecbd6d442012-11-17 14:11:25 -0800235 kMIRIgnoreNullCheck = 0,
236 kMIRNullCheckOnly,
237 kMIRIgnoreRangeCheck,
238 kMIRRangeCheckOnly,
Vladimir Markobfea9c22014-01-17 17:49:33 +0000239 kMIRIgnoreClInitCheck,
buzbee02031b12012-11-23 09:41:35 -0800240 kMIRInlined, // Invoke is inlined (ie dead).
241 kMIRInlinedPred, // Invoke is inlined via prediction.
242 kMIRCallee, // Instruction is inlined from callee.
buzbeecbd6d442012-11-17 14:11:25 -0800243 kMIRIgnoreSuspendCheck,
244 kMIRDup,
buzbee02031b12012-11-23 09:41:35 -0800245 kMIRMark, // Temporary node mark.
Jean Christophe Beyler89fde262014-04-30 11:40:07 -0700246 kMIRLastMIRFlag,
buzbeecbd6d442012-11-17 14:11:25 -0800247};
248
buzbee02031b12012-11-23 09:41:35 -0800249// For successor_block_list.
buzbeecbd6d442012-11-17 14:11:25 -0800250enum BlockListType {
251 kNotUsed = 0,
252 kCatch,
253 kPackedSwitch,
254 kSparseSwitch,
255};
256
257enum AssemblerStatus {
258 kSuccess,
259 kRetryAll,
260};
261
262enum OpSize {
buzbee695d13a2014-04-19 13:32:20 -0700263 kWord, // Natural word size of target (32/64).
264 k32,
265 k64,
266 kReference, // Object reference; compressed on 64-bit targets.
buzbeecbd6d442012-11-17 14:11:25 -0800267 kSingle,
268 kDouble,
269 kUnsignedHalf,
270 kSignedHalf,
271 kUnsignedByte,
272 kSignedByte,
273};
274
275std::ostream& operator<<(std::ostream& os, const OpSize& kind);
276
277enum OpKind {
278 kOpMov,
Razvan A Lupusorubd288c22013-12-20 17:27:23 -0800279 kOpCmov,
buzbeecbd6d442012-11-17 14:11:25 -0800280 kOpMvn,
281 kOpCmp,
282 kOpLsl,
283 kOpLsr,
284 kOpAsr,
285 kOpRor,
286 kOpNot,
287 kOpAnd,
288 kOpOr,
289 kOpXor,
290 kOpNeg,
291 kOpAdd,
292 kOpAdc,
293 kOpSub,
294 kOpSbc,
295 kOpRsub,
296 kOpMul,
297 kOpDiv,
298 kOpRem,
299 kOpBic,
300 kOpCmn,
301 kOpTst,
Vladimir Markoa8b4caf2013-10-24 15:08:57 +0100302 kOpRev,
303 kOpRevsh,
buzbeecbd6d442012-11-17 14:11:25 -0800304 kOpBkpt,
305 kOpBlx,
306 kOpPush,
307 kOpPop,
308 kOp2Char,
309 kOp2Short,
310 kOp2Byte,
311 kOpCondBr,
312 kOpUncondBr,
313 kOpBx,
314 kOpInvalid,
315};
316
Razvan A Lupusoru2c498d12014-01-29 16:02:57 -0800317enum MoveType {
318 kMov8GP, // Move 8-bit general purpose register.
319 kMov16GP, // Move 16-bit general purpose register.
320 kMov32GP, // Move 32-bit general purpose register.
321 kMov64GP, // Move 64-bit general purpose register.
322 kMov32FP, // Move 32-bit FP register.
323 kMov64FP, // Move 64-bit FP register.
324 kMovLo64FP, // Move low 32-bits of 64-bit FP register.
325 kMovHi64FP, // Move high 32-bits of 64-bit FP register.
326 kMovU128FP, // Move 128-bit FP register to/from possibly unaligned region.
327 kMov128FP = kMovU128FP,
328 kMovA128FP, // Move 128-bit FP register to/from region surely aligned to 16-bytes.
329 kMovLo128FP, // Move low 64-bits of 128-bit FP register.
330 kMovHi128FP, // Move high 64-bits of 128-bit FP register.
331};
332
buzbeecbd6d442012-11-17 14:11:25 -0800333std::ostream& operator<<(std::ostream& os, const OpKind& kind);
334
335enum ConditionCode {
336 kCondEq, // equal
337 kCondNe, // not equal
Vladimir Marko58af1f92013-12-19 13:31:15 +0000338 kCondCs, // carry set
339 kCondCc, // carry clear
Vladimir Marko459f4df2013-12-20 17:03:09 +0000340 kCondUlt, // unsigned less than
341 kCondUge, // unsigned greater than or same
buzbeecbd6d442012-11-17 14:11:25 -0800342 kCondMi, // minus
343 kCondPl, // plus, positive or zero
344 kCondVs, // overflow
345 kCondVc, // no overflow
346 kCondHi, // unsigned greater than
347 kCondLs, // unsigned lower or same
348 kCondGe, // signed greater than or equal
349 kCondLt, // signed less than
350 kCondGt, // signed greater than
351 kCondLe, // signed less than or equal
352 kCondAl, // always
353 kCondNv, // never
354};
355
356std::ostream& operator<<(std::ostream& os, const ConditionCode& kind);
357
358// Target specific condition encodings
359enum ArmConditionCode {
360 kArmCondEq = 0x0, // 0000
361 kArmCondNe = 0x1, // 0001
362 kArmCondCs = 0x2, // 0010
363 kArmCondCc = 0x3, // 0011
364 kArmCondMi = 0x4, // 0100
365 kArmCondPl = 0x5, // 0101
366 kArmCondVs = 0x6, // 0110
367 kArmCondVc = 0x7, // 0111
368 kArmCondHi = 0x8, // 1000
369 kArmCondLs = 0x9, // 1001
370 kArmCondGe = 0xa, // 1010
371 kArmCondLt = 0xb, // 1011
372 kArmCondGt = 0xc, // 1100
373 kArmCondLe = 0xd, // 1101
374 kArmCondAl = 0xe, // 1110
375 kArmCondNv = 0xf, // 1111
376};
377
378std::ostream& operator<<(std::ostream& os, const ArmConditionCode& kind);
379
380enum X86ConditionCode {
381 kX86CondO = 0x0, // overflow
382 kX86CondNo = 0x1, // not overflow
383
384 kX86CondB = 0x2, // below
385 kX86CondNae = kX86CondB, // not-above-equal
386 kX86CondC = kX86CondB, // carry
387
388 kX86CondNb = 0x3, // not-below
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700389 kX86CondAe = kX86CondNb, // above-equal
390 kX86CondNc = kX86CondNb, // not-carry
buzbeecbd6d442012-11-17 14:11:25 -0800391
392 kX86CondZ = 0x4, // zero
393 kX86CondEq = kX86CondZ, // equal
394
395 kX86CondNz = 0x5, // not-zero
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700396 kX86CondNe = kX86CondNz, // not-equal
buzbeecbd6d442012-11-17 14:11:25 -0800397
398 kX86CondBe = 0x6, // below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700399 kX86CondNa = kX86CondBe, // not-above
buzbeecbd6d442012-11-17 14:11:25 -0800400
401 kX86CondNbe = 0x7, // not-below-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700402 kX86CondA = kX86CondNbe, // above
buzbeecbd6d442012-11-17 14:11:25 -0800403
404 kX86CondS = 0x8, // sign
405 kX86CondNs = 0x9, // not-sign
406
407 kX86CondP = 0xa, // 8-bit parity even
408 kX86CondPE = kX86CondP,
409
410 kX86CondNp = 0xb, // 8-bit parity odd
411 kX86CondPo = kX86CondNp,
412
413 kX86CondL = 0xc, // less-than
414 kX86CondNge = kX86CondL, // not-greater-equal
415
416 kX86CondNl = 0xd, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700417 kX86CondGe = kX86CondNl, // not-greater-equal
buzbeecbd6d442012-11-17 14:11:25 -0800418
419 kX86CondLe = 0xe, // less-than-equal
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700420 kX86CondNg = kX86CondLe, // not-greater
buzbeecbd6d442012-11-17 14:11:25 -0800421
422 kX86CondNle = 0xf, // not-less-than
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700423 kX86CondG = kX86CondNle, // greater
buzbeecbd6d442012-11-17 14:11:25 -0800424};
425
426std::ostream& operator<<(std::ostream& os, const X86ConditionCode& kind);
427
428enum ThrowKind {
buzbeecbd6d442012-11-17 14:11:25 -0800429 kThrowNoSuchMethod,
buzbeecbd6d442012-11-17 14:11:25 -0800430};
431
buzbeecbd6d442012-11-17 14:11:25 -0800432enum DividePattern {
433 DivideNone,
434 Divide3,
435 Divide5,
436 Divide7,
437};
438
439std::ostream& operator<<(std::ostream& os, const DividePattern& pattern);
440
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800441/**
442 * @brief Memory barrier types (see "The JSR-133 Cookbook for Compiler Writers").
Hans Boehm48f5c472014-06-27 14:50:10 -0700443 * @details We define the combined barrier types that are actually required
444 * by the Java Memory Model, rather than using exactly the terminology from
445 * the JSR-133 cookbook. These should, in many cases, be replaced by acquire/release
446 * primitives. Note that the JSR-133 cookbook generally does not deal with
447 * store atomicity issues, and the recipes there are not always entirely sufficient.
448 * The current recipe is as follows:
449 * -# Use AnyStore ~= (LoadStore | StoreStore) ~= release barrier before volatile store.
450 * -# Use AnyAny barrier after volatile store. (StoreLoad is as expensive.)
451 * -# Use LoadAny barrier ~= (LoadLoad | LoadStore) ~= acquire barrierafter each volatile load.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800452 * -# Use StoreStore barrier after all stores but before return from any constructor whose
Hans Boehm48f5c472014-06-27 14:50:10 -0700453 * class has final fields.
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800454 */
buzbee1bc37c62012-11-20 13:35:41 -0800455enum MemBarrierKind {
Hans Boehm48f5c472014-06-27 14:50:10 -0700456 kAnyStore,
457 kLoadAny,
buzbee1bc37c62012-11-20 13:35:41 -0800458 kStoreStore,
Hans Boehm48f5c472014-06-27 14:50:10 -0700459 kAnyAny
buzbee1bc37c62012-11-20 13:35:41 -0800460};
461
462std::ostream& operator<<(std::ostream& os, const MemBarrierKind& kind);
463
buzbee02031b12012-11-23 09:41:35 -0800464enum OpFeatureFlags {
465 kIsBranch = 0,
466 kNoOperand,
467 kIsUnaryOp,
468 kIsBinaryOp,
469 kIsTertiaryOp,
470 kIsQuadOp,
471 kIsQuinOp,
472 kIsSextupleOp,
473 kIsIT,
474 kMemLoad,
475 kMemStore,
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700476 kPCRelFixup, // x86 FIXME: add NEEDS_FIXUP to instruction attributes.
buzbee02031b12012-11-23 09:41:35 -0800477 kRegDef0,
478 kRegDef1,
Razvan A Lupusoru99ad7232014-02-25 17:41:08 -0800479 kRegDef2,
buzbee02031b12012-11-23 09:41:35 -0800480 kRegDefA,
481 kRegDefD,
482 kRegDefFPCSList0,
483 kRegDefFPCSList2,
484 kRegDefList0,
485 kRegDefList1,
486 kRegDefList2,
487 kRegDefLR,
488 kRegDefSP,
489 kRegUse0,
490 kRegUse1,
491 kRegUse2,
492 kRegUse3,
493 kRegUse4,
494 kRegUseA,
495 kRegUseC,
496 kRegUseD,
Vladimir Marko70b797d2013-12-03 15:25:24 +0000497 kRegUseB,
buzbee02031b12012-11-23 09:41:35 -0800498 kRegUseFPCSList0,
499 kRegUseFPCSList2,
500 kRegUseList0,
501 kRegUseList1,
502 kRegUseLR,
503 kRegUsePC,
504 kRegUseSP,
505 kSetsCCodes,
Serguei Katkove90501d2014-03-12 15:56:54 +0700506 kUsesCCodes,
buzbee9da5c102014-03-28 12:59:18 -0700507 kUseFpStack,
508 kUseHi,
509 kUseLo,
510 kDefHi,
511 kDefLo
buzbee02031b12012-11-23 09:41:35 -0800512};
513
buzbeef662a7c2013-02-12 16:19:43 -0800514enum SelectInstructionKind {
515 kSelectNone,
516 kSelectConst,
517 kSelectMove,
518 kSelectGoto
519};
520
buzbeea5abf702013-04-12 14:39:29 -0700521std::ostream& operator<<(std::ostream& os, const SelectInstructionKind& kind);
522
buzbeeb48819d2013-09-14 16:15:25 -0700523// LIR fixup kinds for Arm
524enum FixupKind {
525 kFixupNone,
526 kFixupLabel, // For labels we just adjust the offset.
Vladimir Marko306f0172014-01-07 18:21:20 +0000527 kFixupLoad, // Mostly for immediates.
buzbeeb48819d2013-09-14 16:15:25 -0700528 kFixupVLoad, // FP load which *may* be pc-relative.
529 kFixupCBxZ, // Cbz, Cbnz.
530 kFixupPushPop, // Not really pc relative, but changes size based on args.
531 kFixupCondBranch, // Conditional branch
532 kFixupT1Branch, // Thumb1 Unconditional branch
533 kFixupT2Branch, // Thumb2 Unconditional branch
534 kFixupBlx1, // Blx1 (start of Blx1/Blx2 pair).
535 kFixupBl1, // Bl1 (start of Bl1/Bl2 pair).
536 kFixupAdr, // Adr.
537 kFixupMovImmLST, // kThumb2MovImm16LST.
538 kFixupMovImmHST, // kThumb2MovImm16HST.
539 kFixupAlign4, // Align to 4-byte boundary.
540};
541
542std::ostream& operator<<(std::ostream& os, const FixupKind& kind);
543
Andreas Gampe3c12c512014-06-24 18:46:29 +0000544enum VolatileKind {
545 kNotVolatile, // Load/Store is not volatile
546 kVolatile // Load/Store is volatile
547};
548
549std::ostream& operator<<(std::ostream& os, const VolatileKind& kind);
550
buzbeecbd6d442012-11-17 14:11:25 -0800551} // namespace art
552
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700553#endif // ART_COMPILER_DEX_COMPILER_ENUMS_H_