libFirm
gen_arm_emitter.c
1 
9 #include "gen_arm_emitter.h"
10 
11 #include "beemithlp.h"
12 #include "gen_arm_new_nodes.h"
13 #include "arm_emitter.h"
14 
15 static void emit_arm_AdC(ir_node const *const node)
16 {
17  arm_emitf(node, "adc %D0, %S0, %O");
18 }
19 
20 static void emit_arm_Add(ir_node const *const node)
21 {
22  arm_emitf(node, "add %D0, %S0, %O");
23 }
24 
25 static void emit_arm_AddS(ir_node const *const node)
26 {
27  arm_emitf(node, "adds %D0, %S0, %O");
28 }
29 
30 static void emit_arm_Adf(ir_node const *const node)
31 {
32  arm_emitf(node, "adf%MA %D0, %S0, %S1");
33 }
34 
35 static void emit_arm_And(ir_node const *const node)
36 {
37  arm_emitf(node, "and %D0, %S0, %O");
38 }
39 
40 static void emit_arm_Bic(ir_node const *const node)
41 {
42  arm_emitf(node, "bic %D0, %S0, %O");
43 }
44 
45 static void emit_arm_Bl(ir_node const *const node)
46 {
47  arm_emitf(node, "bl %I");
48 }
49 
50 static void emit_arm_Clz(ir_node const *const node)
51 {
52  arm_emitf(node, "clz %D0, %S0");
53 }
54 
55 static void emit_arm_Cmfe(ir_node const *const node)
56 {
57  arm_emitf(node, "cmfe %S0, %S1");
58 }
59 
60 static void emit_arm_Cmn(ir_node const *const node)
61 {
62  arm_emitf(node, "cmn %S0, %O");
63 }
64 
65 static void emit_arm_Cmp(ir_node const *const node)
66 {
67  arm_emitf(node, "cmp %S0, %O");
68 }
69 
70 static void emit_arm_Dvf(ir_node const *const node)
71 {
72  arm_emitf(node, "dvf%MA %D0, %S0, %S1");
73 }
74 
75 static void emit_arm_Eor(ir_node const *const node)
76 {
77  arm_emitf(node, "eor %D0, %S0, %O");
78 }
79 
80 static void emit_arm_Flt(ir_node const *const node)
81 {
82  arm_emitf(node, "flt%MA %D0, %S0");
83 }
84 
85 static void emit_arm_IJmp(ir_node const *const node)
86 {
87  arm_emitf(node, "mov pc, %S0");
88 }
89 
90 static void emit_arm_Ldf(ir_node const *const node)
91 {
92  arm_emitf(node, "ldf%MF %D0, %A");
93 }
94 
95 static void emit_arm_Ldr(ir_node const *const node)
96 {
97  arm_emitf(node, "ldr%ML %D0, %A");
98 }
99 
100 static void emit_arm_LinkLdrPC(ir_node const *const node)
101 {
102  arm_emitf(node, "mov lr, pc\nldr pc, %O");
103 }
104 
105 static void emit_arm_LinkMovPC(ir_node const *const node)
106 {
107  arm_emitf(node, "mov lr, pc\nmov pc, %O");
108 }
109 
110 static void emit_arm_Mla(ir_node const *const node)
111 {
112  arm_emitf(node, "mla %D0, %S0, %S1, %S2");
113 }
114 
115 static void emit_arm_Mls(ir_node const *const node)
116 {
117  arm_emitf(node, "mls %D0, %S0, %S1, %S2");
118 }
119 
120 static void emit_arm_Mov(ir_node const *const node)
121 {
122  arm_emitf(node, "mov %D0, %O");
123 }
124 
125 static void emit_arm_Muf(ir_node const *const node)
126 {
127  arm_emitf(node, "muf%MA %D0, %S0, %S1");
128 }
129 
130 static void emit_arm_Mul(ir_node const *const node)
131 {
132  arm_emitf(node, "mul %D0, %S0, %S1");
133 }
134 
135 static void emit_arm_Mvf(ir_node const *const node)
136 {
137  arm_emitf(node, "mvf%MA %S0, %D0");
138 }
139 
140 static void emit_arm_Mvn(ir_node const *const node)
141 {
142  arm_emitf(node, "mvn %D0, %O");
143 }
144 
145 static void emit_arm_Orr(ir_node const *const node)
146 {
147  arm_emitf(node, "orr %D0, %S0, %O");
148 }
149 
150 static void emit_arm_OrrPl(ir_node const *const node)
151 {
152  arm_emitf(node, "orrpl %D0, %S2, %O");
153 }
154 
155 static void emit_arm_Pkhbt(ir_node const *const node)
156 {
157  arm_emitf(node, "pkhbt %D0, %S0, %O");
158 }
159 
160 static void emit_arm_Pkhtb(ir_node const *const node)
161 {
162  arm_emitf(node, "pkhtb %D0, %S0, %O");
163 }
164 
165 static void emit_arm_Return(ir_node const *const node)
166 {
167  arm_emitf(node, "bx lr");
168 }
169 
170 static void emit_arm_RsC(ir_node const *const node)
171 {
172  arm_emitf(node, "rsc %D0, %S0, %O");
173 }
174 
175 static void emit_arm_Rsb(ir_node const *const node)
176 {
177  arm_emitf(node, "rsb %D0, %S0, %O");
178 }
179 
180 static void emit_arm_RsbS(ir_node const *const node)
181 {
182  arm_emitf(node, "rsbs %D0, %S0, %O");
183 }
184 
185 static void emit_arm_SMulL(ir_node const *const node)
186 {
187  arm_emitf(node, "smull %D0, %D1, %S0, %S1");
188 }
189 
190 static void emit_arm_SbC(ir_node const *const node)
191 {
192  arm_emitf(node, "sbc %D0, %S0, %O");
193 }
194 
195 static void emit_arm_Stf(ir_node const *const node)
196 {
197  arm_emitf(node, "stf%MF %S1, %A");
198 }
199 
200 static void emit_arm_Str(ir_node const *const node)
201 {
202  arm_emitf(node, "str%MS %S1, %A");
203 }
204 
205 static void emit_arm_Sub(ir_node const *const node)
206 {
207  arm_emitf(node, "sub %D0, %S0, %O");
208 }
209 
210 static void emit_arm_SubS(ir_node const *const node)
211 {
212  arm_emitf(node, "subs %D0, %S0, %O");
213 }
214 
215 static void emit_arm_Suf(ir_node const *const node)
216 {
217  arm_emitf(node, "suf%MA %D0, %S0, %S1");
218 }
219 
220 static void emit_arm_Tst(ir_node const *const node)
221 {
222  arm_emitf(node, "tst %S0, %O");
223 }
224 
225 static void emit_arm_UMulL(ir_node const *const node)
226 {
227  arm_emitf(node, "umull %D0, %D1, %S0, %S1");
228 }
229 
230 
231 
232 void arm_register_spec_emitters(void)
233 {
234  be_set_emitter(op_arm_AdC, emit_arm_AdC);
235  be_set_emitter(op_arm_Add, emit_arm_Add);
236  be_set_emitter(op_arm_AddS, emit_arm_AddS);
237  be_set_emitter(op_arm_Adf, emit_arm_Adf);
238  be_set_emitter(op_arm_And, emit_arm_And);
239  be_set_emitter(op_arm_Bic, emit_arm_Bic);
240  be_set_emitter(op_arm_Bl, emit_arm_Bl);
241  be_set_emitter(op_arm_Clz, emit_arm_Clz);
242  be_set_emitter(op_arm_Cmfe, emit_arm_Cmfe);
243  be_set_emitter(op_arm_Cmn, emit_arm_Cmn);
244  be_set_emitter(op_arm_Cmp, emit_arm_Cmp);
245  be_set_emitter(op_arm_Dvf, emit_arm_Dvf);
246  be_set_emitter(op_arm_Eor, emit_arm_Eor);
247  be_set_emitter(op_arm_Flt, emit_arm_Flt);
248  be_set_emitter(op_arm_IJmp, emit_arm_IJmp);
249  be_set_emitter(op_arm_Ldf, emit_arm_Ldf);
250  be_set_emitter(op_arm_Ldr, emit_arm_Ldr);
251  be_set_emitter(op_arm_LinkLdrPC, emit_arm_LinkLdrPC);
252  be_set_emitter(op_arm_LinkMovPC, emit_arm_LinkMovPC);
253  be_set_emitter(op_arm_Mla, emit_arm_Mla);
254  be_set_emitter(op_arm_Mls, emit_arm_Mls);
255  be_set_emitter(op_arm_Mov, emit_arm_Mov);
256  be_set_emitter(op_arm_Muf, emit_arm_Muf);
257  be_set_emitter(op_arm_Mul, emit_arm_Mul);
258  be_set_emitter(op_arm_Mvf, emit_arm_Mvf);
259  be_set_emitter(op_arm_Mvn, emit_arm_Mvn);
260  be_set_emitter(op_arm_Orr, emit_arm_Orr);
261  be_set_emitter(op_arm_OrrPl, emit_arm_OrrPl);
262  be_set_emitter(op_arm_Pkhbt, emit_arm_Pkhbt);
263  be_set_emitter(op_arm_Pkhtb, emit_arm_Pkhtb);
264  be_set_emitter(op_arm_Return, emit_arm_Return);
265  be_set_emitter(op_arm_RsC, emit_arm_RsC);
266  be_set_emitter(op_arm_Rsb, emit_arm_Rsb);
267  be_set_emitter(op_arm_RsbS, emit_arm_RsbS);
268  be_set_emitter(op_arm_SMulL, emit_arm_SMulL);
269  be_set_emitter(op_arm_SbC, emit_arm_SbC);
270  be_set_emitter(op_arm_Stf, emit_arm_Stf);
271  be_set_emitter(op_arm_Str, emit_arm_Str);
272  be_set_emitter(op_arm_Sub, emit_arm_Sub);
273  be_set_emitter(op_arm_SubS, emit_arm_SubS);
274  be_set_emitter(op_arm_Suf, emit_arm_Suf);
275  be_set_emitter(op_arm_Tst, emit_arm_Tst);
276  be_set_emitter(op_arm_UMulL, emit_arm_UMulL);
277 
278 }
279 
280 void arm_register_spec_binary_emitters(void)
281 {
282 
283 }
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53