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