11 #include "gen_arm_regalloc_if.h"
12 #include "bearch_arm_t.h"
14 const arch_register_req_t arm_class_reg_req_flags = {
15 .cls = &arm_reg_classes[CLASS_arm_flags],
18 static const unsigned arm_limited_flags_fl[] = { (1U << REG_FLAGS_FL) };
19 const arch_register_req_t arm_single_reg_req_flags_fl = {
20 .cls = &arm_reg_classes[CLASS_arm_flags],
21 .limited = arm_limited_flags_fl,
24 const arch_register_req_t arm_class_reg_req_fpa = {
25 .cls = &arm_reg_classes[CLASS_arm_fpa],
28 static const unsigned arm_limited_fpa_f0[] = { (1U << REG_FPA_F0) };
29 const arch_register_req_t arm_single_reg_req_fpa_f0 = {
30 .cls = &arm_reg_classes[CLASS_arm_fpa],
31 .limited = arm_limited_fpa_f0,
34 static const unsigned arm_limited_fpa_f1[] = { (1U << REG_FPA_F1) };
35 const arch_register_req_t arm_single_reg_req_fpa_f1 = {
36 .cls = &arm_reg_classes[CLASS_arm_fpa],
37 .limited = arm_limited_fpa_f1,
40 static const unsigned arm_limited_fpa_f2[] = { (1U << REG_FPA_F2) };
41 const arch_register_req_t arm_single_reg_req_fpa_f2 = {
42 .cls = &arm_reg_classes[CLASS_arm_fpa],
43 .limited = arm_limited_fpa_f2,
46 static const unsigned arm_limited_fpa_f3[] = { (1U << REG_FPA_F3) };
47 const arch_register_req_t arm_single_reg_req_fpa_f3 = {
48 .cls = &arm_reg_classes[CLASS_arm_fpa],
49 .limited = arm_limited_fpa_f3,
52 static const unsigned arm_limited_fpa_f4[] = { (1U << REG_FPA_F4) };
53 const arch_register_req_t arm_single_reg_req_fpa_f4 = {
54 .cls = &arm_reg_classes[CLASS_arm_fpa],
55 .limited = arm_limited_fpa_f4,
58 static const unsigned arm_limited_fpa_f5[] = { (1U << REG_FPA_F5) };
59 const arch_register_req_t arm_single_reg_req_fpa_f5 = {
60 .cls = &arm_reg_classes[CLASS_arm_fpa],
61 .limited = arm_limited_fpa_f5,
64 static const unsigned arm_limited_fpa_f6[] = { (1U << REG_FPA_F6) };
65 const arch_register_req_t arm_single_reg_req_fpa_f6 = {
66 .cls = &arm_reg_classes[CLASS_arm_fpa],
67 .limited = arm_limited_fpa_f6,
70 static const unsigned arm_limited_fpa_f7[] = { (1U << REG_FPA_F7) };
71 const arch_register_req_t arm_single_reg_req_fpa_f7 = {
72 .cls = &arm_reg_classes[CLASS_arm_fpa],
73 .limited = arm_limited_fpa_f7,
76 const arch_register_req_t arm_class_reg_req_gp = {
77 .cls = &arm_reg_classes[CLASS_arm_gp],
80 static const unsigned arm_limited_gp_r0[] = { (1U << REG_GP_R0) };
81 const arch_register_req_t arm_single_reg_req_gp_r0 = {
82 .cls = &arm_reg_classes[CLASS_arm_gp],
83 .limited = arm_limited_gp_r0,
86 static const unsigned arm_limited_gp_r1[] = { (1U << REG_GP_R1) };
87 const arch_register_req_t arm_single_reg_req_gp_r1 = {
88 .cls = &arm_reg_classes[CLASS_arm_gp],
89 .limited = arm_limited_gp_r1,
92 static const unsigned arm_limited_gp_r2[] = { (1U << REG_GP_R2) };
93 const arch_register_req_t arm_single_reg_req_gp_r2 = {
94 .cls = &arm_reg_classes[CLASS_arm_gp],
95 .limited = arm_limited_gp_r2,
98 static const unsigned arm_limited_gp_r3[] = { (1U << REG_GP_R3) };
99 const arch_register_req_t arm_single_reg_req_gp_r3 = {
100 .cls = &arm_reg_classes[CLASS_arm_gp],
101 .limited = arm_limited_gp_r3,
104 static const unsigned arm_limited_gp_r4[] = { (1U << REG_GP_R4) };
105 const arch_register_req_t arm_single_reg_req_gp_r4 = {
106 .cls = &arm_reg_classes[CLASS_arm_gp],
107 .limited = arm_limited_gp_r4,
110 static const unsigned arm_limited_gp_r5[] = { (1U << REG_GP_R5) };
111 const arch_register_req_t arm_single_reg_req_gp_r5 = {
112 .cls = &arm_reg_classes[CLASS_arm_gp],
113 .limited = arm_limited_gp_r5,
116 static const unsigned arm_limited_gp_r6[] = { (1U << REG_GP_R6) };
117 const arch_register_req_t arm_single_reg_req_gp_r6 = {
118 .cls = &arm_reg_classes[CLASS_arm_gp],
119 .limited = arm_limited_gp_r6,
122 static const unsigned arm_limited_gp_r7[] = { (1U << REG_GP_R7) };
123 const arch_register_req_t arm_single_reg_req_gp_r7 = {
124 .cls = &arm_reg_classes[CLASS_arm_gp],
125 .limited = arm_limited_gp_r7,
128 static const unsigned arm_limited_gp_r8[] = { (1U << REG_GP_R8) };
129 const arch_register_req_t arm_single_reg_req_gp_r8 = {
130 .cls = &arm_reg_classes[CLASS_arm_gp],
131 .limited = arm_limited_gp_r8,
134 static const unsigned arm_limited_gp_r9[] = { (1U << REG_GP_R9) };
135 const arch_register_req_t arm_single_reg_req_gp_r9 = {
136 .cls = &arm_reg_classes[CLASS_arm_gp],
137 .limited = arm_limited_gp_r9,
140 static const unsigned arm_limited_gp_r10[] = { (1U << REG_GP_R10) };
141 const arch_register_req_t arm_single_reg_req_gp_r10 = {
142 .cls = &arm_reg_classes[CLASS_arm_gp],
143 .limited = arm_limited_gp_r10,
146 static const unsigned arm_limited_gp_r11[] = { (1U << REG_GP_R11) };
147 const arch_register_req_t arm_single_reg_req_gp_r11 = {
148 .cls = &arm_reg_classes[CLASS_arm_gp],
149 .limited = arm_limited_gp_r11,
152 static const unsigned arm_limited_gp_r12[] = { (1U << REG_GP_R12) };
153 const arch_register_req_t arm_single_reg_req_gp_r12 = {
154 .cls = &arm_reg_classes[CLASS_arm_gp],
155 .limited = arm_limited_gp_r12,
158 static const unsigned arm_limited_gp_sp[] = { (1U << REG_GP_SP) };
159 const arch_register_req_t arm_single_reg_req_gp_sp = {
160 .cls = &arm_reg_classes[CLASS_arm_gp],
161 .limited = arm_limited_gp_sp,
164 static const unsigned arm_limited_gp_lr[] = { (1U << REG_GP_LR) };
165 const arch_register_req_t arm_single_reg_req_gp_lr = {
166 .cls = &arm_reg_classes[CLASS_arm_gp],
167 .limited = arm_limited_gp_lr,
170 static const unsigned arm_limited_gp_pc[] = { (1U << REG_GP_PC) };
171 const arch_register_req_t arm_single_reg_req_gp_pc = {
172 .cls = &arm_reg_classes[CLASS_arm_gp],
173 .limited = arm_limited_gp_pc,
178 arch_register_class_t arm_reg_classes[] = {
182 .regs = &arm_registers[REG_FL],
183 .class_req = &arm_class_reg_req_flags,
184 .index = CLASS_arm_flags,
191 .regs = &arm_registers[REG_F0],
192 .class_req = &arm_class_reg_req_fpa,
193 .index = CLASS_arm_fpa,
200 .regs = &arm_registers[REG_R0],
201 .class_req = &arm_class_reg_req_gp,
202 .index = CLASS_arm_gp,
210 const arch_register_t arm_registers[] = {
213 .cls = &arm_reg_classes[CLASS_arm_flags],
214 .single_req = &arm_single_reg_req_flags_fl,
215 .index = REG_FLAGS_FL,
216 .global_index = REG_FL,
218 .encoding = REG_FLAGS_FL,
223 .cls = &arm_reg_classes[CLASS_arm_fpa],
224 .single_req = &arm_single_reg_req_fpa_f0,
226 .global_index = REG_F0,
228 .encoding = REG_FPA_F0,
233 .cls = &arm_reg_classes[CLASS_arm_fpa],
234 .single_req = &arm_single_reg_req_fpa_f1,
236 .global_index = REG_F1,
238 .encoding = REG_FPA_F1,
243 .cls = &arm_reg_classes[CLASS_arm_fpa],
244 .single_req = &arm_single_reg_req_fpa_f2,
246 .global_index = REG_F2,
248 .encoding = REG_FPA_F2,
253 .cls = &arm_reg_classes[CLASS_arm_fpa],
254 .single_req = &arm_single_reg_req_fpa_f3,
256 .global_index = REG_F3,
258 .encoding = REG_FPA_F3,
263 .cls = &arm_reg_classes[CLASS_arm_fpa],
264 .single_req = &arm_single_reg_req_fpa_f4,
266 .global_index = REG_F4,
268 .encoding = REG_FPA_F4,
273 .cls = &arm_reg_classes[CLASS_arm_fpa],
274 .single_req = &arm_single_reg_req_fpa_f5,
276 .global_index = REG_F5,
278 .encoding = REG_FPA_F5,
283 .cls = &arm_reg_classes[CLASS_arm_fpa],
284 .single_req = &arm_single_reg_req_fpa_f6,
286 .global_index = REG_F6,
288 .encoding = REG_FPA_F6,
293 .cls = &arm_reg_classes[CLASS_arm_fpa],
294 .single_req = &arm_single_reg_req_fpa_f7,
296 .global_index = REG_F7,
298 .encoding = REG_FPA_F7,
303 .cls = &arm_reg_classes[CLASS_arm_gp],
304 .single_req = &arm_single_reg_req_gp_r0,
306 .global_index = REG_R0,
308 .encoding = REG_GP_R0,
313 .cls = &arm_reg_classes[CLASS_arm_gp],
314 .single_req = &arm_single_reg_req_gp_r1,
316 .global_index = REG_R1,
318 .encoding = REG_GP_R1,
323 .cls = &arm_reg_classes[CLASS_arm_gp],
324 .single_req = &arm_single_reg_req_gp_r2,
326 .global_index = REG_R2,
328 .encoding = REG_GP_R2,
333 .cls = &arm_reg_classes[CLASS_arm_gp],
334 .single_req = &arm_single_reg_req_gp_r3,
336 .global_index = REG_R3,
338 .encoding = REG_GP_R3,
343 .cls = &arm_reg_classes[CLASS_arm_gp],
344 .single_req = &arm_single_reg_req_gp_r4,
346 .global_index = REG_R4,
348 .encoding = REG_GP_R4,
353 .cls = &arm_reg_classes[CLASS_arm_gp],
354 .single_req = &arm_single_reg_req_gp_r5,
356 .global_index = REG_R5,
358 .encoding = REG_GP_R5,
363 .cls = &arm_reg_classes[CLASS_arm_gp],
364 .single_req = &arm_single_reg_req_gp_r6,
366 .global_index = REG_R6,
368 .encoding = REG_GP_R6,
373 .cls = &arm_reg_classes[CLASS_arm_gp],
374 .single_req = &arm_single_reg_req_gp_r7,
376 .global_index = REG_R7,
378 .encoding = REG_GP_R7,
383 .cls = &arm_reg_classes[CLASS_arm_gp],
384 .single_req = &arm_single_reg_req_gp_r8,
386 .global_index = REG_R8,
388 .encoding = REG_GP_R8,
393 .cls = &arm_reg_classes[CLASS_arm_gp],
394 .single_req = &arm_single_reg_req_gp_r9,
396 .global_index = REG_R9,
398 .encoding = REG_GP_R9,
403 .cls = &arm_reg_classes[CLASS_arm_gp],
404 .single_req = &arm_single_reg_req_gp_r10,
406 .global_index = REG_R10,
408 .encoding = REG_GP_R10,
413 .cls = &arm_reg_classes[CLASS_arm_gp],
414 .single_req = &arm_single_reg_req_gp_r11,
416 .global_index = REG_R11,
418 .encoding = REG_GP_R11,
423 .cls = &arm_reg_classes[CLASS_arm_gp],
424 .single_req = &arm_single_reg_req_gp_r12,
426 .global_index = REG_R12,
428 .encoding = REG_GP_R12,
433 .cls = &arm_reg_classes[CLASS_arm_gp],
434 .single_req = &arm_single_reg_req_gp_sp,
436 .global_index = REG_SP,
438 .encoding = REG_GP_SP,
443 .cls = &arm_reg_classes[CLASS_arm_gp],
444 .single_req = &arm_single_reg_req_gp_lr,
446 .global_index = REG_LR,
448 .encoding = REG_GP_LR,
453 .cls = &arm_reg_classes[CLASS_arm_gp],
454 .single_req = &arm_single_reg_req_gp_pc,
456 .global_index = REG_PC,
458 .encoding = REG_GP_PC,
467 void arm_register_init(
void)
469 arm_reg_classes[CLASS_arm_flags].mode = arm_mode_flags;
470 arm_reg_classes[CLASS_arm_fpa].mode =
mode_F;
471 arm_reg_classes[CLASS_arm_gp].mode = arm_mode_gp;
ir_mode * mode_F
ieee754 binary32 float (single precision)