libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
gen_amd64_regalloc_if.h
1 
9 #ifndef FIRM_BE_AMD64_GEN_AMD64_REGALLOC_IF_H
10 #define FIRM_BE_AMD64_GEN_AMD64_REGALLOC_IF_H
11 
12 #include "amd64_nodes_attr.h"
13 #include "bearch.h"
14 
16 enum reg_indices {
17  REG_EFLAGS,
18  REG_RAX,
19  REG_RCX,
20  REG_RDX,
21  REG_RSI,
22  REG_RDI,
23  REG_RBX,
24  REG_RBP,
25  REG_RSP,
26  REG_R8,
27  REG_R9,
28  REG_R10,
29  REG_R11,
30  REG_R12,
31  REG_R13,
32  REG_R14,
33  REG_R15,
34  REG_ST0,
35  REG_ST1,
36  REG_ST2,
37  REG_ST3,
38  REG_ST4,
39  REG_ST5,
40  REG_ST6,
41  REG_ST7,
42  REG_XMM0,
43  REG_XMM1,
44  REG_XMM2,
45  REG_XMM3,
46  REG_XMM4,
47  REG_XMM5,
48  REG_XMM6,
49  REG_XMM7,
50  REG_XMM8,
51  REG_XMM9,
52  REG_XMM10,
53  REG_XMM11,
54  REG_XMM12,
55  REG_XMM13,
56  REG_XMM14,
57  REG_XMM15,
58 
59  N_AMD64_REGISTERS
60 };
61 
63 enum {
64  REG_FLAGS_EFLAGS,
65 };
66 
67 enum {
68  REG_GP_RAX,
69  REG_GP_RCX,
70  REG_GP_RDX,
71  REG_GP_RSI,
72  REG_GP_RDI,
73  REG_GP_RBX,
74  REG_GP_RBP,
75  REG_GP_RSP,
76  REG_GP_R8,
77  REG_GP_R9,
78  REG_GP_R10,
79  REG_GP_R11,
80  REG_GP_R12,
81  REG_GP_R13,
82  REG_GP_R14,
83  REG_GP_R15,
84 };
85 
86 enum {
87  REG_X87_ST0,
88  REG_X87_ST1,
89  REG_X87_ST2,
90  REG_X87_ST3,
91  REG_X87_ST4,
92  REG_X87_ST5,
93  REG_X87_ST6,
94  REG_X87_ST7,
95 };
96 
97 enum {
98  REG_XMM_XMM0,
99  REG_XMM_XMM1,
100  REG_XMM_XMM2,
101  REG_XMM_XMM3,
102  REG_XMM_XMM4,
103  REG_XMM_XMM5,
104  REG_XMM_XMM6,
105  REG_XMM_XMM7,
106  REG_XMM_XMM8,
107  REG_XMM_XMM9,
108  REG_XMM_XMM10,
109  REG_XMM_XMM11,
110  REG_XMM_XMM12,
111  REG_XMM_XMM13,
112  REG_XMM_XMM14,
113  REG_XMM_XMM15,
114 };
115 
116 
118 enum {
119  N_amd64_flags_REGS = 1,
120  N_amd64_gp_REGS = 16,
121  N_amd64_x87_REGS = 8,
122  N_amd64_xmm_REGS = 16,
123 
124 };
125 
126 enum {
127  CLASS_amd64_flags,
128  CLASS_amd64_gp,
129  CLASS_amd64_x87,
130  CLASS_amd64_xmm,
131  N_AMD64_CLASSES = 4
132 };
133 
134 extern const arch_register_req_t amd64_class_reg_req_flags;
135 extern const arch_register_req_t amd64_single_reg_req_flags_eflags;
136 extern const arch_register_req_t amd64_class_reg_req_gp;
137 extern const arch_register_req_t amd64_single_reg_req_gp_rax;
138 extern const arch_register_req_t amd64_single_reg_req_gp_rcx;
139 extern const arch_register_req_t amd64_single_reg_req_gp_rdx;
140 extern const arch_register_req_t amd64_single_reg_req_gp_rsi;
141 extern const arch_register_req_t amd64_single_reg_req_gp_rdi;
142 extern const arch_register_req_t amd64_single_reg_req_gp_rbx;
143 extern const arch_register_req_t amd64_single_reg_req_gp_rbp;
144 extern const arch_register_req_t amd64_single_reg_req_gp_rsp;
145 extern const arch_register_req_t amd64_single_reg_req_gp_r8;
146 extern const arch_register_req_t amd64_single_reg_req_gp_r9;
147 extern const arch_register_req_t amd64_single_reg_req_gp_r10;
148 extern const arch_register_req_t amd64_single_reg_req_gp_r11;
149 extern const arch_register_req_t amd64_single_reg_req_gp_r12;
150 extern const arch_register_req_t amd64_single_reg_req_gp_r13;
151 extern const arch_register_req_t amd64_single_reg_req_gp_r14;
152 extern const arch_register_req_t amd64_single_reg_req_gp_r15;
153 extern const arch_register_req_t amd64_class_reg_req_x87;
154 extern const arch_register_req_t amd64_single_reg_req_x87_st0;
155 extern const arch_register_req_t amd64_single_reg_req_x87_st1;
156 extern const arch_register_req_t amd64_single_reg_req_x87_st2;
157 extern const arch_register_req_t amd64_single_reg_req_x87_st3;
158 extern const arch_register_req_t amd64_single_reg_req_x87_st4;
159 extern const arch_register_req_t amd64_single_reg_req_x87_st5;
160 extern const arch_register_req_t amd64_single_reg_req_x87_st6;
161 extern const arch_register_req_t amd64_single_reg_req_x87_st7;
162 extern const arch_register_req_t amd64_class_reg_req_xmm;
163 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm0;
164 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm1;
165 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm2;
166 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm3;
167 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm4;
168 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm5;
169 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm6;
170 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm7;
171 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm8;
172 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm9;
173 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm10;
174 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm11;
175 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm12;
176 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm13;
177 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm14;
178 extern const arch_register_req_t amd64_single_reg_req_xmm_xmm15;
179 
180 
181 extern const arch_register_t amd64_registers[N_AMD64_REGISTERS];
182 
183 extern arch_register_class_t amd64_reg_classes[N_AMD64_CLASSES];
184 
185 void amd64_register_init(void);
186 
187 #endif