1 //===-- ARMUnwindOp.h - ARM Unwind Opcodes ----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the constants for the ARM unwind opcodes and exception
11 // handling table entry kinds.
13 //===----------------------------------------------------------------------===//
15 #ifndef ARM_UNWIND_OP_H
16 #define ARM_UNWIND_OP_H
20 /// ARM exception handling table entry kinds
21 enum ARMEHTEntryKind {
27 /// Special entry for the function never unwind
28 EXIDX_CANTUNWIND = 0x1
31 /// ARM-defined frame unwinding opcodes
32 enum ARMUnwindOpcodes {
34 // Purpose: vsp = vsp + ((x << 2) + 4)
35 UNWIND_OPCODE_INC_VSP = 0x00,
38 // Purpose: vsp = vsp - ((x << 2) + 4)
39 UNWIND_OPCODE_DEC_VSP = 0x40,
41 // Format: 10000000 00000000
42 // Purpose: refuse to unwind
43 UNWIND_OPCODE_REFUSE = 0x8000,
45 // Format: 1000xxxx xxxxxxxx
46 // Purpose: pop r[15:12], r[11:4]
48 UNWIND_OPCODE_POP_REG_MASK_R4 = 0x8000,
51 // Purpose: vsp = r[x]
52 // Constraint: x != 13 && x != 15
53 UNWIND_OPCODE_SET_VSP = 0x90,
56 // Purpose: pop r[(4+x):4]
57 UNWIND_OPCODE_POP_REG_RANGE_R4 = 0xa0,
60 // Purpose: pop r14, r[(4+x):4]
61 UNWIND_OPCODE_POP_REG_RANGE_R4_R14 = 0xa8,
65 UNWIND_OPCODE_FINISH = 0xb0,
67 // Format: 10110001 0000xxxx
68 // Purpose: pop r[3:0]
70 UNWIND_OPCODE_POP_REG_MASK = 0xb100,
72 // Format: 10110010 x(uleb128)
73 // Purpose: vsp = vsp + ((x << 2) + 0x204)
74 UNWIND_OPCODE_INC_VSP_ULEB128 = 0xb2,
76 // Format: 10110011 xxxxyyyy
77 // Purpose: pop d[(x+y):x]
78 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX = 0xb300,
81 // Purpose: pop d[(8+x):8]
82 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX_D8 = 0xb8,
85 // Purpose: pop wR[(10+x):10]
86 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE_WR10 = 0xc0,
88 // Format: 11000110 xxxxyyyy
89 // Purpose: pop wR[(x+y):x]
90 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE = 0xc600,
92 // Format: 11000111 0000xxxx
93 // Purpose: pop wCGR[3:0]
95 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_MASK = 0xc700,
97 // Format: 11001000 xxxxyyyy
98 // Purpose: pop d[(16+x+y):(16+x)]
99 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D16 = 0xc800,
101 // Format: 11001001 xxxxyyyy
102 // Purpose: pop d[(x+y):x]
103 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD = 0xc900,
106 // Purpose: pop d[(8+x):8]
107 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D8 = 0xd0
110 /// ARM-defined Personality Routine Index
111 enum ARMPersonalityRoutineIndex {
112 // To make the exception handling table become more compact, ARM defined
113 // several personality routines in EHABI. There are 3 different
114 // personality routines in ARM EHABI currently. It is possible to have 16
115 // pre-defined personality routines at most.
116 AEABI_UNWIND_CPP_PR0 = 0,
117 AEABI_UNWIND_CPP_PR1 = 1,
118 AEABI_UNWIND_CPP_PR2 = 2,
120 NUM_PERSONALITY_INDEX
125 #endif // ARM_UNWIND_OP_H