11 #include "gen_arm_regalloc_if.h" 13 #include "arm_bearch_t.h" 15 const arch_register_req_t arm_class_reg_req_flags = {
16 .cls = &arm_reg_classes[CLASS_arm_flags],
19 static const unsigned arm_limited_flags_fl[] = { (1U << REG_FLAGS_FL) };
20 const arch_register_req_t arm_single_reg_req_flags_fl = {
21 .cls = &arm_reg_classes[CLASS_arm_flags],
22 .limited = arm_limited_flags_fl,
25 const arch_register_req_t arm_class_reg_req_fpa = {
26 .cls = &arm_reg_classes[CLASS_arm_fpa],
29 static const unsigned arm_limited_fpa_f0[] = { (1U << REG_FPA_F0) };
30 const arch_register_req_t arm_single_reg_req_fpa_f0 = {
31 .cls = &arm_reg_classes[CLASS_arm_fpa],
32 .limited = arm_limited_fpa_f0,
35 static const unsigned arm_limited_fpa_f1[] = { (1U << REG_FPA_F1) };
36 const arch_register_req_t arm_single_reg_req_fpa_f1 = {
37 .cls = &arm_reg_classes[CLASS_arm_fpa],
38 .limited = arm_limited_fpa_f1,
41 static const unsigned arm_limited_fpa_f2[] = { (1U << REG_FPA_F2) };
42 const arch_register_req_t arm_single_reg_req_fpa_f2 = {
43 .cls = &arm_reg_classes[CLASS_arm_fpa],
44 .limited = arm_limited_fpa_f2,
47 static const unsigned arm_limited_fpa_f3[] = { (1U << REG_FPA_F3) };
48 const arch_register_req_t arm_single_reg_req_fpa_f3 = {
49 .cls = &arm_reg_classes[CLASS_arm_fpa],
50 .limited = arm_limited_fpa_f3,
53 static const unsigned arm_limited_fpa_f4[] = { (1U << REG_FPA_F4) };
54 const arch_register_req_t arm_single_reg_req_fpa_f4 = {
55 .cls = &arm_reg_classes[CLASS_arm_fpa],
56 .limited = arm_limited_fpa_f4,
59 static const unsigned arm_limited_fpa_f5[] = { (1U << REG_FPA_F5) };
60 const arch_register_req_t arm_single_reg_req_fpa_f5 = {
61 .cls = &arm_reg_classes[CLASS_arm_fpa],
62 .limited = arm_limited_fpa_f5,
65 static const unsigned arm_limited_fpa_f6[] = { (1U << REG_FPA_F6) };
66 const arch_register_req_t arm_single_reg_req_fpa_f6 = {
67 .cls = &arm_reg_classes[CLASS_arm_fpa],
68 .limited = arm_limited_fpa_f6,
71 static const unsigned arm_limited_fpa_f7[] = { (1U << REG_FPA_F7) };
72 const arch_register_req_t arm_single_reg_req_fpa_f7 = {
73 .cls = &arm_reg_classes[CLASS_arm_fpa],
74 .limited = arm_limited_fpa_f7,
77 const arch_register_req_t arm_class_reg_req_gp = {
78 .cls = &arm_reg_classes[CLASS_arm_gp],
81 static const unsigned arm_limited_gp_r0[] = { (1U << REG_GP_R0) };
82 const arch_register_req_t arm_single_reg_req_gp_r0 = {
83 .cls = &arm_reg_classes[CLASS_arm_gp],
84 .limited = arm_limited_gp_r0,
87 static const unsigned arm_limited_gp_r1[] = { (1U << REG_GP_R1) };
88 const arch_register_req_t arm_single_reg_req_gp_r1 = {
89 .cls = &arm_reg_classes[CLASS_arm_gp],
90 .limited = arm_limited_gp_r1,
93 static const unsigned arm_limited_gp_r2[] = { (1U << REG_GP_R2) };
94 const arch_register_req_t arm_single_reg_req_gp_r2 = {
95 .cls = &arm_reg_classes[CLASS_arm_gp],
96 .limited = arm_limited_gp_r2,
99 static const unsigned arm_limited_gp_r3[] = { (1U << REG_GP_R3) };
100 const arch_register_req_t arm_single_reg_req_gp_r3 = {
101 .cls = &arm_reg_classes[CLASS_arm_gp],
102 .limited = arm_limited_gp_r3,
105 static const unsigned arm_limited_gp_r4[] = { (1U << REG_GP_R4) };
106 const arch_register_req_t arm_single_reg_req_gp_r4 = {
107 .cls = &arm_reg_classes[CLASS_arm_gp],
108 .limited = arm_limited_gp_r4,
111 static const unsigned arm_limited_gp_r5[] = { (1U << REG_GP_R5) };
112 const arch_register_req_t arm_single_reg_req_gp_r5 = {
113 .cls = &arm_reg_classes[CLASS_arm_gp],
114 .limited = arm_limited_gp_r5,
117 static const unsigned arm_limited_gp_r6[] = { (1U << REG_GP_R6) };
118 const arch_register_req_t arm_single_reg_req_gp_r6 = {
119 .cls = &arm_reg_classes[CLASS_arm_gp],
120 .limited = arm_limited_gp_r6,
123 static const unsigned arm_limited_gp_r7[] = { (1U << REG_GP_R7) };
124 const arch_register_req_t arm_single_reg_req_gp_r7 = {
125 .cls = &arm_reg_classes[CLASS_arm_gp],
126 .limited = arm_limited_gp_r7,
129 static const unsigned arm_limited_gp_r8[] = { (1U << REG_GP_R8) };
130 const arch_register_req_t arm_single_reg_req_gp_r8 = {
131 .cls = &arm_reg_classes[CLASS_arm_gp],
132 .limited = arm_limited_gp_r8,
135 static const unsigned arm_limited_gp_r9[] = { (1U << REG_GP_R9) };
136 const arch_register_req_t arm_single_reg_req_gp_r9 = {
137 .cls = &arm_reg_classes[CLASS_arm_gp],
138 .limited = arm_limited_gp_r9,
141 static const unsigned arm_limited_gp_r10[] = { (1U << REG_GP_R10) };
142 const arch_register_req_t arm_single_reg_req_gp_r10 = {
143 .cls = &arm_reg_classes[CLASS_arm_gp],
144 .limited = arm_limited_gp_r10,
147 static const unsigned arm_limited_gp_r11[] = { (1U << REG_GP_R11) };
148 const arch_register_req_t arm_single_reg_req_gp_r11 = {
149 .cls = &arm_reg_classes[CLASS_arm_gp],
150 .limited = arm_limited_gp_r11,
153 static const unsigned arm_limited_gp_r12[] = { (1U << REG_GP_R12) };
154 const arch_register_req_t arm_single_reg_req_gp_r12 = {
155 .cls = &arm_reg_classes[CLASS_arm_gp],
156 .limited = arm_limited_gp_r12,
159 static const unsigned arm_limited_gp_sp[] = { (1U << REG_GP_SP) };
160 const arch_register_req_t arm_single_reg_req_gp_sp = {
161 .cls = &arm_reg_classes[CLASS_arm_gp],
162 .limited = arm_limited_gp_sp,
165 static const unsigned arm_limited_gp_lr[] = { (1U << REG_GP_LR) };
166 const arch_register_req_t arm_single_reg_req_gp_lr = {
167 .cls = &arm_reg_classes[CLASS_arm_gp],
168 .limited = arm_limited_gp_lr,
171 static const unsigned arm_limited_gp_pc[] = { (1U << REG_GP_PC) };
172 const arch_register_req_t arm_single_reg_req_gp_pc = {
173 .cls = &arm_reg_classes[CLASS_arm_gp],
174 .limited = arm_limited_gp_pc,
179 arch_register_class_t arm_reg_classes[] = {
183 .regs = &arm_registers[REG_FL],
184 .class_req = &arm_class_reg_req_flags,
185 .index = CLASS_arm_flags,
192 .regs = &arm_registers[REG_F0],
193 .class_req = &arm_class_reg_req_fpa,
194 .index = CLASS_arm_fpa,
201 .regs = &arm_registers[REG_R0],
202 .class_req = &arm_class_reg_req_gp,
203 .index = CLASS_arm_gp,
211 const arch_register_t arm_registers[] = {
214 .cls = &arm_reg_classes[CLASS_arm_flags],
215 .single_req = &arm_single_reg_req_flags_fl,
216 .index = REG_FLAGS_FL,
217 .global_index = REG_FL,
219 .encoding = REG_FLAGS_FL,
224 .cls = &arm_reg_classes[CLASS_arm_fpa],
225 .single_req = &arm_single_reg_req_fpa_f0,
227 .global_index = REG_F0,
229 .encoding = REG_FPA_F0,
234 .cls = &arm_reg_classes[CLASS_arm_fpa],
235 .single_req = &arm_single_reg_req_fpa_f1,
237 .global_index = REG_F1,
239 .encoding = REG_FPA_F1,
244 .cls = &arm_reg_classes[CLASS_arm_fpa],
245 .single_req = &arm_single_reg_req_fpa_f2,
247 .global_index = REG_F2,
249 .encoding = REG_FPA_F2,
254 .cls = &arm_reg_classes[CLASS_arm_fpa],
255 .single_req = &arm_single_reg_req_fpa_f3,
257 .global_index = REG_F3,
259 .encoding = REG_FPA_F3,
264 .cls = &arm_reg_classes[CLASS_arm_fpa],
265 .single_req = &arm_single_reg_req_fpa_f4,
267 .global_index = REG_F4,
269 .encoding = REG_FPA_F4,
274 .cls = &arm_reg_classes[CLASS_arm_fpa],
275 .single_req = &arm_single_reg_req_fpa_f5,
277 .global_index = REG_F5,
279 .encoding = REG_FPA_F5,
284 .cls = &arm_reg_classes[CLASS_arm_fpa],
285 .single_req = &arm_single_reg_req_fpa_f6,
287 .global_index = REG_F6,
289 .encoding = REG_FPA_F6,
294 .cls = &arm_reg_classes[CLASS_arm_fpa],
295 .single_req = &arm_single_reg_req_fpa_f7,
297 .global_index = REG_F7,
299 .encoding = REG_FPA_F7,
304 .cls = &arm_reg_classes[CLASS_arm_gp],
305 .single_req = &arm_single_reg_req_gp_r0,
307 .global_index = REG_R0,
309 .encoding = REG_GP_R0,
314 .cls = &arm_reg_classes[CLASS_arm_gp],
315 .single_req = &arm_single_reg_req_gp_r1,
317 .global_index = REG_R1,
319 .encoding = REG_GP_R1,
324 .cls = &arm_reg_classes[CLASS_arm_gp],
325 .single_req = &arm_single_reg_req_gp_r2,
327 .global_index = REG_R2,
329 .encoding = REG_GP_R2,
334 .cls = &arm_reg_classes[CLASS_arm_gp],
335 .single_req = &arm_single_reg_req_gp_r3,
337 .global_index = REG_R3,
339 .encoding = REG_GP_R3,
344 .cls = &arm_reg_classes[CLASS_arm_gp],
345 .single_req = &arm_single_reg_req_gp_r4,
347 .global_index = REG_R4,
349 .encoding = REG_GP_R4,
354 .cls = &arm_reg_classes[CLASS_arm_gp],
355 .single_req = &arm_single_reg_req_gp_r5,
357 .global_index = REG_R5,
359 .encoding = REG_GP_R5,
364 .cls = &arm_reg_classes[CLASS_arm_gp],
365 .single_req = &arm_single_reg_req_gp_r6,
367 .global_index = REG_R6,
369 .encoding = REG_GP_R6,
374 .cls = &arm_reg_classes[CLASS_arm_gp],
375 .single_req = &arm_single_reg_req_gp_r7,
377 .global_index = REG_R7,
379 .encoding = REG_GP_R7,
384 .cls = &arm_reg_classes[CLASS_arm_gp],
385 .single_req = &arm_single_reg_req_gp_r8,
387 .global_index = REG_R8,
389 .encoding = REG_GP_R8,
394 .cls = &arm_reg_classes[CLASS_arm_gp],
395 .single_req = &arm_single_reg_req_gp_r9,
397 .global_index = REG_R9,
399 .encoding = REG_GP_R9,
404 .cls = &arm_reg_classes[CLASS_arm_gp],
405 .single_req = &arm_single_reg_req_gp_r10,
407 .global_index = REG_R10,
409 .encoding = REG_GP_R10,
414 .cls = &arm_reg_classes[CLASS_arm_gp],
415 .single_req = &arm_single_reg_req_gp_r11,
417 .global_index = REG_R11,
419 .encoding = REG_GP_R11,
424 .cls = &arm_reg_classes[CLASS_arm_gp],
425 .single_req = &arm_single_reg_req_gp_r12,
427 .global_index = REG_R12,
429 .encoding = REG_GP_R12,
434 .cls = &arm_reg_classes[CLASS_arm_gp],
435 .single_req = &arm_single_reg_req_gp_sp,
437 .global_index = REG_SP,
439 .encoding = REG_GP_SP,
444 .cls = &arm_reg_classes[CLASS_arm_gp],
445 .single_req = &arm_single_reg_req_gp_lr,
447 .global_index = REG_LR,
449 .encoding = REG_GP_LR,
454 .cls = &arm_reg_classes[CLASS_arm_gp],
455 .single_req = &arm_single_reg_req_gp_pc,
457 .global_index = REG_PC,
459 .encoding = REG_GP_PC,
468 void arm_register_init(
void)
470 arm_reg_classes[CLASS_arm_flags].mode = arm_mode_flags;
471 arm_reg_classes[CLASS_arm_fpa].mode =
mode_F;
472 arm_reg_classes[CLASS_arm_gp].mode = arm_mode_gp;
ir_mode * mode_F
ieee754 binary32 float (single precision)