9 #include "gen_arm_emitter.h" 11 #include "beemithlp.h" 12 #include "gen_arm_new_nodes.h" 13 #include "arm_emitter.h" 15 static void emit_arm_AdC(
ir_node const *
const node)
17 arm_emitf(node,
"adc %D0, %S0, %O");
20 static void emit_arm_Add(
ir_node const *
const node)
22 arm_emitf(node,
"add %D0, %S0, %O");
25 static void emit_arm_AddS(
ir_node const *
const node)
27 arm_emitf(node,
"adds %D0, %S0, %O");
30 static void emit_arm_Adf(
ir_node const *
const node)
32 arm_emitf(node,
"adf%MA %D0, %S0, %S1");
35 static void emit_arm_And(
ir_node const *
const node)
37 arm_emitf(node,
"and %D0, %S0, %O");
40 static void emit_arm_Bic(
ir_node const *
const node)
42 arm_emitf(node,
"bic %D0, %S0, %O");
45 static void emit_arm_Bl(
ir_node const *
const node)
47 arm_emitf(node,
"bl %I");
50 static void emit_arm_Clz(
ir_node const *
const node)
52 arm_emitf(node,
"clz %D0, %S0");
55 static void emit_arm_Cmfe(
ir_node const *
const node)
57 arm_emitf(node,
"cmfe %S0, %S1");
60 static void emit_arm_Cmn(
ir_node const *
const node)
62 arm_emitf(node,
"cmn %S0, %O");
65 static void emit_arm_Cmp(
ir_node const *
const node)
67 arm_emitf(node,
"cmp %S0, %O");
70 static void emit_arm_Dvf(
ir_node const *
const node)
72 arm_emitf(node,
"dvf%MA %D0, %S0, %S1");
75 static void emit_arm_Eor(
ir_node const *
const node)
77 arm_emitf(node,
"eor %D0, %S0, %O");
80 static void emit_arm_Flt(
ir_node const *
const node)
82 arm_emitf(node,
"flt%MA %D0, %S0");
85 static void emit_arm_IJmp(
ir_node const *
const node)
87 arm_emitf(node,
"mov pc, %S0");
90 static void emit_arm_Ldf(
ir_node const *
const node)
92 arm_emitf(node,
"ldf%MF %D0, %A");
95 static void emit_arm_Ldr(
ir_node const *
const node)
97 arm_emitf(node,
"ldr%ML %D0, %A");
100 static void emit_arm_LinkLdrPC(
ir_node const *
const node)
102 arm_emitf(node,
"mov lr, pc\nldr pc, %O");
105 static void emit_arm_LinkMovPC(
ir_node const *
const node)
107 arm_emitf(node,
"mov lr, pc\nmov pc, %O");
110 static void emit_arm_Mla(
ir_node const *
const node)
112 arm_emitf(node,
"mla %D0, %S0, %S1, %S2");
115 static void emit_arm_Mls(
ir_node const *
const node)
117 arm_emitf(node,
"mls %D0, %S0, %S1, %S2");
120 static void emit_arm_Mov(
ir_node const *
const node)
122 arm_emitf(node,
"mov %D0, %O");
125 static void emit_arm_Muf(
ir_node const *
const node)
127 arm_emitf(node,
"muf%MA %D0, %S0, %S1");
130 static void emit_arm_Mul(
ir_node const *
const node)
132 arm_emitf(node,
"mul %D0, %S0, %S1");
135 static void emit_arm_Mvf(
ir_node const *
const node)
137 arm_emitf(node,
"mvf%MA %S0, %D0");
140 static void emit_arm_Mvn(
ir_node const *
const node)
142 arm_emitf(node,
"mvn %D0, %O");
145 static void emit_arm_Orr(
ir_node const *
const node)
147 arm_emitf(node,
"orr %D0, %S0, %O");
150 static void emit_arm_OrrPl(
ir_node const *
const node)
152 arm_emitf(node,
"orrpl %D0, %S2, %O");
155 static void emit_arm_Pkhbt(
ir_node const *
const node)
157 arm_emitf(node,
"pkhbt %D0, %S0, %O");
160 static void emit_arm_Pkhtb(
ir_node const *
const node)
162 arm_emitf(node,
"pkhtb %D0, %S0, %O");
165 static void emit_arm_Return(
ir_node const *
const node)
167 arm_emitf(node,
"bx lr");
170 static void emit_arm_RsC(
ir_node const *
const node)
172 arm_emitf(node,
"rsc %D0, %S0, %O");
175 static void emit_arm_Rsb(
ir_node const *
const node)
177 arm_emitf(node,
"rsb %D0, %S0, %O");
180 static void emit_arm_RsbS(
ir_node const *
const node)
182 arm_emitf(node,
"rsbs %D0, %S0, %O");
185 static void emit_arm_SMulL(
ir_node const *
const node)
187 arm_emitf(node,
"smull %D0, %D1, %S0, %S1");
190 static void emit_arm_SbC(
ir_node const *
const node)
192 arm_emitf(node,
"sbc %D0, %S0, %O");
195 static void emit_arm_Stf(
ir_node const *
const node)
197 arm_emitf(node,
"stf%MF %S1, %A");
200 static void emit_arm_Str(
ir_node const *
const node)
202 arm_emitf(node,
"str%MS %S1, %A");
205 static void emit_arm_Sub(
ir_node const *
const node)
207 arm_emitf(node,
"sub %D0, %S0, %O");
210 static void emit_arm_SubS(
ir_node const *
const node)
212 arm_emitf(node,
"subs %D0, %S0, %O");
215 static void emit_arm_Suf(
ir_node const *
const node)
217 arm_emitf(node,
"suf%MA %D0, %S0, %S1");
220 static void emit_arm_Tst(
ir_node const *
const node)
222 arm_emitf(node,
"tst %S0, %O");
225 static void emit_arm_UMulL(
ir_node const *
const node)
227 arm_emitf(node,
"umull %D0, %D1, %S0, %S1");
232 void arm_register_spec_emitters(
void)
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);
280 void arm_register_spec_binary_emitters(
void)
struct ir_node ir_node
Procedure Graph Node.