9 #include "gen_sparc_emitter.h" 11 #include "beemithlp.h" 12 #include "gen_sparc_new_nodes.h" 13 #include "sparc_emitter.h" 15 static void emit_sparc_Add(
ir_node const *
const node)
17 sparc_emitf(node,
"add %S0, %SI1, %D0");
20 static void emit_sparc_AddCC(
ir_node const *
const node)
22 sparc_emitf(node,
"addcc %S0, %SI1, %D0");
25 static void emit_sparc_AddSP(
ir_node const *
const node)
27 sparc_emitf(node,
"add %S0, %S1, %D0\n");
30 static void emit_sparc_AddX(
ir_node const *
const node)
32 sparc_emitf(node,
"addx %S0, %SI1, %D0");
35 static void emit_sparc_And(
ir_node const *
const node)
37 sparc_emitf(node,
"and %S0, %SI1, %D0");
40 static void emit_sparc_AndCCZero(
ir_node const *
const node)
42 sparc_emitf(node,
"andcc %S0, %SI1, %%g0");
45 static void emit_sparc_AndN(
ir_node const *
const node)
47 sparc_emitf(node,
"andn %S0, %SI1, %D0");
50 static void emit_sparc_AndNCCZero(
ir_node const *
const node)
52 sparc_emitf(node,
"andncc %S0, %SI1, %%g0");
55 static void emit_sparc_Cmp(
ir_node const *
const node)
57 sparc_emitf(node,
"cmp %S0, %SI1");
60 static void emit_sparc_Ld(
ir_node const *
const node)
62 sparc_emitf(node,
"ld%ML %O0, %D0");
65 static void emit_sparc_Ldf(
ir_node const *
const node)
67 sparc_emitf(node,
"ld%ML %O0, %D0");
70 static void emit_sparc_Or(
ir_node const *
const node)
72 sparc_emitf(node,
"or %S0, %SI1, %D0");
75 static void emit_sparc_OrCCZero(
ir_node const *
const node)
77 sparc_emitf(node,
"orcc %S0, %SI1, %%g0");
80 static void emit_sparc_OrN(
ir_node const *
const node)
82 sparc_emitf(node,
"orn %S0, %SI1, %D0");
85 static void emit_sparc_OrNCCZero(
ir_node const *
const node)
87 sparc_emitf(node,
"orncc %S0, %SI1, %%g0");
90 static void emit_sparc_RestoreZero(
ir_node const *
const node)
92 sparc_emitf(node,
"restore");
95 static void emit_sparc_SMul(
ir_node const *
const node)
97 sparc_emitf(node,
"smul %S0, %SI1, %D0");
100 static void emit_sparc_SMulCCZero(
ir_node const *
const node)
102 sparc_emitf(node,
"smulcc %S0, %SI1, %%g0");
105 static void emit_sparc_SMulh(
ir_node const *
const node)
107 sparc_emitf(node,
"smul %S0, %SI1, %D0\nmov %%y, %D0");
110 static void emit_sparc_Save(
ir_node const *
const node)
112 sparc_emitf(node,
"save %S0, %SI1, %D0");
115 static void emit_sparc_SetHi(
ir_node const *
const node)
117 sparc_emitf(node,
"sethi %H, %D0");
120 static void emit_sparc_Sll(
ir_node const *
const node)
122 sparc_emitf(node,
"sll %S0, %SI1, %D0");
125 static void emit_sparc_Sra(
ir_node const *
const node)
127 sparc_emitf(node,
"sra %S0, %SI1, %D0");
130 static void emit_sparc_Srl(
ir_node const *
const node)
132 sparc_emitf(node,
"srl %S0, %SI1, %D0");
135 static void emit_sparc_St(
ir_node const *
const node)
137 sparc_emitf(node,
"st%MS %S0, %O1");
140 static void emit_sparc_Stbar(
ir_node const *
const node)
142 sparc_emitf(node,
"stbar");
145 static void emit_sparc_Stf(
ir_node const *
const node)
147 sparc_emitf(node,
"st%MS %S0, %O1");
150 static void emit_sparc_Sub(
ir_node const *
const node)
152 sparc_emitf(node,
"sub %S0, %SI1, %D0");
155 static void emit_sparc_SubCC(
ir_node const *
const node)
157 sparc_emitf(node,
"subcc %S0, %SI1, %D0");
160 static void emit_sparc_SubX(
ir_node const *
const node)
162 sparc_emitf(node,
"subx %S0, %SI1, %D0");
165 static void emit_sparc_UMulh(
ir_node const *
const node)
167 sparc_emitf(node,
"umul %S0, %SI1, %D0\nmov %%y, %D0");
170 static void emit_sparc_XNor(
ir_node const *
const node)
172 sparc_emitf(node,
"xnor %S0, %SI1, %D0");
175 static void emit_sparc_XNorCCZero(
ir_node const *
const node)
177 sparc_emitf(node,
"xnorcc %S0, %SI1, %%g0");
180 static void emit_sparc_Xor(
ir_node const *
const node)
182 sparc_emitf(node,
"xor %S0, %SI1, %D0");
185 static void emit_sparc_XorCCZero(
ir_node const *
const node)
187 sparc_emitf(node,
"xorcc %S0, %SI1, %%g0");
190 static void emit_sparc_fabs(
ir_node const *
const node)
192 sparc_emitf(node,
"fabss %S0, %D0");
195 static void emit_sparc_fadd(
ir_node const *
const node)
197 sparc_emitf(node,
"fadd%FM %S0, %S1, %D0");
200 static void emit_sparc_fcmp(
ir_node const *
const node)
202 sparc_emitf(node,
"fcmp%FM %S0, %S1");
205 static void emit_sparc_fdiv(
ir_node const *
const node)
207 sparc_emitf(node,
"fdiv%FM %S0, %S1, %D0");
210 static void emit_sparc_fftof(
ir_node const *
const node)
212 sparc_emitf(node,
"f%FSto%FD %S0, %D0");
215 static void emit_sparc_fftoi(
ir_node const *
const node)
217 sparc_emitf(node,
"f%FMtoi %S0, %D0");
220 static void emit_sparc_fitof(
ir_node const *
const node)
222 sparc_emitf(node,
"fito%FM %S0, %D0");
225 static void emit_sparc_fmul(
ir_node const *
const node)
227 sparc_emitf(node,
"fmul%FM %S0, %S1, %D0");
230 static void emit_sparc_fneg(
ir_node const *
const node)
232 sparc_emitf(node,
"fnegs %S0, %D0");
235 static void emit_sparc_fsub(
ir_node const *
const node)
237 sparc_emitf(node,
"fsub%FM %S0, %S1, %D0");
242 void sparc_register_spec_emitters(
void)
244 be_set_emitter(op_sparc_Add, emit_sparc_Add);
245 be_set_emitter(op_sparc_AddCC, emit_sparc_AddCC);
246 be_set_emitter(op_sparc_AddSP, emit_sparc_AddSP);
247 be_set_emitter(op_sparc_AddX, emit_sparc_AddX);
248 be_set_emitter(op_sparc_And, emit_sparc_And);
249 be_set_emitter(op_sparc_AndCCZero, emit_sparc_AndCCZero);
250 be_set_emitter(op_sparc_AndN, emit_sparc_AndN);
251 be_set_emitter(op_sparc_AndNCCZero, emit_sparc_AndNCCZero);
252 be_set_emitter(op_sparc_Cmp, emit_sparc_Cmp);
253 be_set_emitter(op_sparc_Ld, emit_sparc_Ld);
254 be_set_emitter(op_sparc_Ldf, emit_sparc_Ldf);
255 be_set_emitter(op_sparc_Or, emit_sparc_Or);
256 be_set_emitter(op_sparc_OrCCZero, emit_sparc_OrCCZero);
257 be_set_emitter(op_sparc_OrN, emit_sparc_OrN);
258 be_set_emitter(op_sparc_OrNCCZero, emit_sparc_OrNCCZero);
259 be_set_emitter(op_sparc_RestoreZero, emit_sparc_RestoreZero);
260 be_set_emitter(op_sparc_SMul, emit_sparc_SMul);
261 be_set_emitter(op_sparc_SMulCCZero, emit_sparc_SMulCCZero);
262 be_set_emitter(op_sparc_SMulh, emit_sparc_SMulh);
263 be_set_emitter(op_sparc_Save, emit_sparc_Save);
264 be_set_emitter(op_sparc_SetHi, emit_sparc_SetHi);
265 be_set_emitter(op_sparc_Sll, emit_sparc_Sll);
266 be_set_emitter(op_sparc_Sra, emit_sparc_Sra);
267 be_set_emitter(op_sparc_Srl, emit_sparc_Srl);
268 be_set_emitter(op_sparc_St, emit_sparc_St);
269 be_set_emitter(op_sparc_Stbar, emit_sparc_Stbar);
270 be_set_emitter(op_sparc_Stf, emit_sparc_Stf);
271 be_set_emitter(op_sparc_Sub, emit_sparc_Sub);
272 be_set_emitter(op_sparc_SubCC, emit_sparc_SubCC);
273 be_set_emitter(op_sparc_SubX, emit_sparc_SubX);
274 be_set_emitter(op_sparc_UMulh, emit_sparc_UMulh);
275 be_set_emitter(op_sparc_XNor, emit_sparc_XNor);
276 be_set_emitter(op_sparc_XNorCCZero, emit_sparc_XNorCCZero);
277 be_set_emitter(op_sparc_Xor, emit_sparc_Xor);
278 be_set_emitter(op_sparc_XorCCZero, emit_sparc_XorCCZero);
279 be_set_emitter(op_sparc_fabs, emit_sparc_fabs);
280 be_set_emitter(op_sparc_fadd, emit_sparc_fadd);
281 be_set_emitter(op_sparc_fcmp, emit_sparc_fcmp);
282 be_set_emitter(op_sparc_fdiv, emit_sparc_fdiv);
283 be_set_emitter(op_sparc_fftof, emit_sparc_fftof);
284 be_set_emitter(op_sparc_fftoi, emit_sparc_fftoi);
285 be_set_emitter(op_sparc_fitof, emit_sparc_fitof);
286 be_set_emitter(op_sparc_fmul, emit_sparc_fmul);
287 be_set_emitter(op_sparc_fneg, emit_sparc_fneg);
288 be_set_emitter(op_sparc_fsub, emit_sparc_fsub);
292 void sparc_register_spec_binary_emitters(
void)
struct ir_node ir_node
Procedure Graph Node.