libFirm
gen_ia32_regalloc_if.h
1 
9 #ifndef FIRM_BE_IA32_GEN_IA32_REGALLOC_IF_H
10 #define FIRM_BE_IA32_GEN_IA32_REGALLOC_IF_H
11 
12 #include "bearch.h"
13 
15 enum reg_indices {
16  REG_EFLAGS,
17  REG_ST0,
18  REG_ST1,
19  REG_ST2,
20  REG_ST3,
21  REG_ST4,
22  REG_ST5,
23  REG_ST6,
24  REG_ST7,
25  REG_FP_NOREG,
26  REG_FPCW,
27  REG_EDX,
28  REG_ECX,
29  REG_EAX,
30  REG_EBX,
31  REG_ESI,
32  REG_EDI,
33  REG_EBP,
34  REG_ESP,
35  REG_GP_NOREG,
36  REG_XMM0,
37  REG_XMM1,
38  REG_XMM2,
39  REG_XMM3,
40  REG_XMM4,
41  REG_XMM5,
42  REG_XMM6,
43  REG_XMM7,
44  REG_XMM_NOREG,
45 
46  N_IA32_REGISTERS
47 };
48 
50 enum {
51  REG_FLAGS_EFLAGS,
52 };
53 
54 enum {
55  REG_FP_ST0,
56  REG_FP_ST1,
57  REG_FP_ST2,
58  REG_FP_ST3,
59  REG_FP_ST4,
60  REG_FP_ST5,
61  REG_FP_ST6,
62  REG_FP_ST7,
63  REG_FP_FP_NOREG,
64 };
65 
66 enum {
67  REG_FP_CW_FPCW,
68 };
69 
70 enum {
71  REG_GP_EDX,
72  REG_GP_ECX,
73  REG_GP_EAX,
74  REG_GP_EBX,
75  REG_GP_ESI,
76  REG_GP_EDI,
77  REG_GP_EBP,
78  REG_GP_ESP,
79  REG_GP_GP_NOREG,
80 };
81 
82 enum {
83  REG_XMM_XMM0,
84  REG_XMM_XMM1,
85  REG_XMM_XMM2,
86  REG_XMM_XMM3,
87  REG_XMM_XMM4,
88  REG_XMM_XMM5,
89  REG_XMM_XMM6,
90  REG_XMM_XMM7,
91  REG_XMM_XMM_NOREG,
92 };
93 
94 
96 enum {
97  N_ia32_flags_REGS = 1,
98  N_ia32_fp_REGS = 9,
99  N_ia32_fp_cw_REGS = 1,
100  N_ia32_gp_REGS = 9,
101  N_ia32_xmm_REGS = 9,
102 
103 };
104 
105 enum {
106  CLASS_ia32_flags,
107  CLASS_ia32_fp,
108  CLASS_ia32_fp_cw,
109  CLASS_ia32_gp,
110  CLASS_ia32_xmm,
111  N_IA32_CLASSES = 5
112 };
113 
114 extern const arch_register_req_t ia32_class_reg_req_flags;
115 extern const arch_register_req_t ia32_single_reg_req_flags_eflags;
116 extern const arch_register_req_t ia32_class_reg_req_fp;
117 extern const arch_register_req_t ia32_single_reg_req_fp_st0;
118 extern const arch_register_req_t ia32_single_reg_req_fp_st1;
119 extern const arch_register_req_t ia32_single_reg_req_fp_st2;
120 extern const arch_register_req_t ia32_single_reg_req_fp_st3;
121 extern const arch_register_req_t ia32_single_reg_req_fp_st4;
122 extern const arch_register_req_t ia32_single_reg_req_fp_st5;
123 extern const arch_register_req_t ia32_single_reg_req_fp_st6;
124 extern const arch_register_req_t ia32_single_reg_req_fp_st7;
125 extern const arch_register_req_t ia32_single_reg_req_fp_fp_NOREG;
126 extern const arch_register_req_t ia32_class_reg_req_fp_cw;
127 extern const arch_register_req_t ia32_single_reg_req_fp_cw_fpcw;
128 extern const arch_register_req_t ia32_class_reg_req_gp;
129 extern const arch_register_req_t ia32_single_reg_req_gp_edx;
130 extern const arch_register_req_t ia32_single_reg_req_gp_ecx;
131 extern const arch_register_req_t ia32_single_reg_req_gp_eax;
132 extern const arch_register_req_t ia32_single_reg_req_gp_ebx;
133 extern const arch_register_req_t ia32_single_reg_req_gp_esi;
134 extern const arch_register_req_t ia32_single_reg_req_gp_edi;
135 extern const arch_register_req_t ia32_single_reg_req_gp_ebp;
136 extern const arch_register_req_t ia32_single_reg_req_gp_esp;
137 extern const arch_register_req_t ia32_single_reg_req_gp_gp_NOREG;
138 extern const arch_register_req_t ia32_class_reg_req_xmm;
139 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm0;
140 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm1;
141 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm2;
142 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm3;
143 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm4;
144 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm5;
145 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm6;
146 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm7;
147 extern const arch_register_req_t ia32_single_reg_req_xmm_xmm_NOREG;
148 
149 
150 extern const arch_register_t ia32_registers[N_IA32_REGISTERS];
151 
152 extern arch_register_class_t ia32_reg_classes[N_IA32_CLASSES];
153 
154 void ia32_register_init(void);
155 
156 #endif