1 //===--- ARMEHABI.h - ARM Exception Handling ABI ----------------*- 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 // The enumerations and constants in this file reflect the ARM EHABI
14 // Specification as published by ARM.
16 // Exception Handling ABI for the ARM Architecture r2.09 - November 30, 2012
18 // http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
20 //===----------------------------------------------------------------------===//
22 #ifndef LLVM_SUPPORT_ARM_EHABI_H
23 #define LLVM_SUPPORT_ARM_EHABI_H
28 /// ARM exception handling table entry kinds
35 /// Special entry for the function never unwind
36 EXIDX_CANTUNWIND = 0x1
39 /// ARM-defined frame unwinding opcodes
42 // Purpose: vsp = vsp + ((x << 2) + 4)
43 UNWIND_OPCODE_INC_VSP = 0x00,
46 // Purpose: vsp = vsp - ((x << 2) + 4)
47 UNWIND_OPCODE_DEC_VSP = 0x40,
49 // Format: 10000000 00000000
50 // Purpose: refuse to unwind
51 UNWIND_OPCODE_REFUSE = 0x8000,
53 // Format: 1000xxxx xxxxxxxx
54 // Purpose: pop r[15:12], r[11:4]
56 UNWIND_OPCODE_POP_REG_MASK_R4 = 0x8000,
59 // Purpose: vsp = r[x]
60 // Constraint: x != 13 && x != 15
61 UNWIND_OPCODE_SET_VSP = 0x90,
64 // Purpose: pop r[(4+x):4]
65 UNWIND_OPCODE_POP_REG_RANGE_R4 = 0xa0,
68 // Purpose: pop r14, r[(4+x):4]
69 UNWIND_OPCODE_POP_REG_RANGE_R4_R14 = 0xa8,
73 UNWIND_OPCODE_FINISH = 0xb0,
75 // Format: 10110001 0000xxxx
76 // Purpose: pop r[3:0]
78 UNWIND_OPCODE_POP_REG_MASK = 0xb100,
80 // Format: 10110010 x(uleb128)
81 // Purpose: vsp = vsp + ((x << 2) + 0x204)
82 UNWIND_OPCODE_INC_VSP_ULEB128 = 0xb2,
84 // Format: 10110011 xxxxyyyy
85 // Purpose: pop d[(x+y):x]
86 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX = 0xb300,
89 // Purpose: pop d[(8+x):8]
90 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX_D8 = 0xb8,
93 // Purpose: pop wR[(10+x):10]
94 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE_WR10 = 0xc0,
96 // Format: 11000110 xxxxyyyy
97 // Purpose: pop wR[(x+y):x]
98 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE = 0xc600,
100 // Format: 11000111 0000xxxx
101 // Purpose: pop wCGR[3:0]
102 // Constraint: x != 0
103 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_MASK = 0xc700,
105 // Format: 11001000 xxxxyyyy
106 // Purpose: pop d[(16+x+y):(16+x)]
107 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D16 = 0xc800,
109 // Format: 11001001 xxxxyyyy
110 // Purpose: pop d[(x+y):x]
111 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD = 0xc900,
114 // Purpose: pop d[(8+x):8]
115 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D8 = 0xd0
118 /// ARM-defined Personality Routine Index
119 enum PersonalityRoutineIndex {
120 // To make the exception handling table become more compact, ARM defined
121 // several personality routines in EHABI. There are 3 different
122 // personality routines in ARM EHABI currently. It is possible to have 16
123 // pre-defined personality routines at most.
124 AEABI_UNWIND_CPP_PR0 = 0,
125 AEABI_UNWIND_CPP_PR1 = 1,
126 AEABI_UNWIND_CPP_PR2 = 2,
128 NUM_PERSONALITY_INDEX
134 #endif // ARM_UNWIND_OP_H