10 #include "gen_sparc_emitter.h"
11 #include "sparc_new_nodes.h"
12 #include "sparc_emitter.h"
14 static void emit_sparc_Add(
ir_node const *
const node)
16 sparc_emitf(node,
"add %S0, %SI1, %D0");
19 static void emit_sparc_AddCC(
ir_node const *
const node)
21 sparc_emitf(node,
"addcc %S0, %SI1, %D0");
24 static void emit_sparc_AddCCZero(
ir_node const *
const node)
26 sparc_emitf(node,
"addcc %S0, %SI1, %%g0");
29 static void emit_sparc_AddSP(
ir_node const *
const node)
31 sparc_emitf(node,
"add %S0, %S1, %D0");
34 static void emit_sparc_AddX(
ir_node const *
const node)
36 sparc_emitf(node,
"addx %S0, %SI1, %D0");
39 static void emit_sparc_And(
ir_node const *
const node)
41 sparc_emitf(node,
"and %S0, %SI1, %D0");
44 static void emit_sparc_AndCCZero(
ir_node const *
const node)
46 sparc_emitf(node,
"andcc %S0, %SI1, %%g0");
49 static void emit_sparc_AndN(
ir_node const *
const node)
51 sparc_emitf(node,
"andn %S0, %SI1, %D0");
54 static void emit_sparc_AndNCCZero(
ir_node const *
const node)
56 sparc_emitf(node,
"andncc %S0, %SI1, %%g0");
59 static void emit_sparc_Cmp(
ir_node const *
const node)
61 sparc_emitf(node,
"cmp %S0, %SI1");
64 static void emit_sparc_Ld(
ir_node const *
const node)
66 sparc_emitf(node,
"ld%ML %MO0, %D0");
69 static void emit_sparc_Ldf(
ir_node const *
const node)
71 sparc_emitf(node,
"ld%ML %MO0, %D0");
74 static void emit_sparc_Mul(
ir_node const *
const node)
76 sparc_emitf(node,
"smul %S0, %SI1, %D0");
79 static void emit_sparc_MulCCZero(
ir_node const *
const node)
81 sparc_emitf(node,
"smulcc %S0, %SI1, %%g0");
84 static void emit_sparc_Or(
ir_node const *
const node)
86 sparc_emitf(node,
"or %S0, %SI1, %D0");
89 static void emit_sparc_OrCCZero(
ir_node const *
const node)
91 sparc_emitf(node,
"orcc %S0, %SI1, %%g0");
94 static void emit_sparc_OrN(
ir_node const *
const node)
96 sparc_emitf(node,
"orn %S0, %SI1, %D0");
99 static void emit_sparc_OrNCCZero(
ir_node const *
const node)
101 sparc_emitf(node,
"orncc %S0, %SI1, %%g0");
104 static void emit_sparc_RestoreZero(
ir_node const *
const node)
106 sparc_emitf(node,
"restore");
109 static void emit_sparc_SMulh(
ir_node const *
const node)
111 sparc_emitf(node,
"smul %S0, %SI1, %D0");
112 sparc_emitf(node,
"mov %%y, %D0");
115 static void emit_sparc_Save(
ir_node const *
const node)
117 sparc_emitf(node,
"save %S0, %SI1, %D0");
120 static void emit_sparc_SetHi(
ir_node const *
const node)
122 sparc_emitf(node,
"sethi %H, %D0");
125 static void emit_sparc_Sll(
ir_node const *
const node)
127 sparc_emitf(node,
"sll %S0, %SI1, %D0");
130 static void emit_sparc_Sra(
ir_node const *
const node)
132 sparc_emitf(node,
"sra %S0, %SI1, %D0");
135 static void emit_sparc_Srl(
ir_node const *
const node)
137 sparc_emitf(node,
"srl %S0, %SI1, %D0");
140 static void emit_sparc_St(
ir_node const *
const node)
142 sparc_emitf(node,
"st%MS %S0, %MO1");
145 static void emit_sparc_Stbar(
ir_node const *
const node)
147 sparc_emitf(node,
"stbar");
150 static void emit_sparc_Stf(
ir_node const *
const node)
152 sparc_emitf(node,
"st%MS %S0, %MO1");
155 static void emit_sparc_Sub(
ir_node const *
const node)
157 sparc_emitf(node,
"sub %S0, %SI1, %D0");
160 static void emit_sparc_SubCC(
ir_node const *
const node)
162 sparc_emitf(node,
"subcc %S0, %SI1, %D0");
165 static void emit_sparc_SubCCZero(
ir_node const *
const node)
167 sparc_emitf(node,
"subcc %S0, %SI1, %%g0");
170 static void emit_sparc_SubX(
ir_node const *
const node)
172 sparc_emitf(node,
"subx %S0, %SI1, %D0");
175 static void emit_sparc_UMulh(
ir_node const *
const node)
177 sparc_emitf(node,
"umul %S0, %SI1, %D0");
178 sparc_emitf(node,
"mov %%y, %D0");
181 static void emit_sparc_XNor(
ir_node const *
const node)
183 sparc_emitf(node,
"xnor %S0, %SI1, %D0");
186 static void emit_sparc_XNorCCZero(
ir_node const *
const node)
188 sparc_emitf(node,
"xnorcc %S0, %SI1, %%g0");
191 static void emit_sparc_Xor(
ir_node const *
const node)
193 sparc_emitf(node,
"xor %S0, %SI1, %D0");
196 static void emit_sparc_XorCCZero(
ir_node const *
const node)
198 sparc_emitf(node,
"xorcc %S0, %SI1, %%g0");
201 static void emit_sparc_fabs(
ir_node const *
const node)
203 sparc_emitf(node,
"fabs %S0, %D0");
206 static void emit_sparc_fadd(
ir_node const *
const node)
208 sparc_emitf(node,
"fadd%FM %S0, %S1, %D0");
211 static void emit_sparc_fcmp(
ir_node const *
const node)
213 sparc_emitf(node,
"fcmp%FM %S0, %S1");
216 static void emit_sparc_fdiv(
ir_node const *
const node)
218 sparc_emitf(node,
"fdiv%FM %S0, %S1, %D0");
221 static void emit_sparc_fftof(
ir_node const *
const node)
223 sparc_emitf(node,
"f%FSto%FD %S0, %D0");
226 static void emit_sparc_fftoi(
ir_node const *
const node)
228 sparc_emitf(node,
"f%FMtoi %S0, %D0");
231 static void emit_sparc_fitof(
ir_node const *
const node)
233 sparc_emitf(node,
"fito%FM %S0, %D0");
236 static void emit_sparc_fmul(
ir_node const *
const node)
238 sparc_emitf(node,
"fmul%FM %S0, %S1, %D0");
241 static void emit_sparc_fneg(
ir_node const *
const node)
243 sparc_emitf(node,
"fnegs %S0, %D0");
246 static void emit_sparc_fsub(
ir_node const *
const node)
248 sparc_emitf(node,
"fsub%FM %S0, %S1, %D0");
257 void sparc_register_spec_emitters(
void)
259 be_set_emitter(op_sparc_Add, emit_sparc_Add);
260 be_set_emitter(op_sparc_AddCC, emit_sparc_AddCC);
261 be_set_emitter(op_sparc_AddCCZero, emit_sparc_AddCCZero);
262 be_set_emitter(op_sparc_AddSP, emit_sparc_AddSP);
263 be_set_emitter(op_sparc_AddX, emit_sparc_AddX);
264 be_set_emitter(op_sparc_And, emit_sparc_And);
265 be_set_emitter(op_sparc_AndCCZero, emit_sparc_AndCCZero);
266 be_set_emitter(op_sparc_AndN, emit_sparc_AndN);
267 be_set_emitter(op_sparc_AndNCCZero, emit_sparc_AndNCCZero);
268 be_set_emitter(op_sparc_Cmp, emit_sparc_Cmp);
269 be_set_emitter(op_sparc_Ld, emit_sparc_Ld);
270 be_set_emitter(op_sparc_Ldf, emit_sparc_Ldf);
271 be_set_emitter(op_sparc_Mul, emit_sparc_Mul);
272 be_set_emitter(op_sparc_MulCCZero, emit_sparc_MulCCZero);
273 be_set_emitter(op_sparc_Or, emit_sparc_Or);
274 be_set_emitter(op_sparc_OrCCZero, emit_sparc_OrCCZero);
275 be_set_emitter(op_sparc_OrN, emit_sparc_OrN);
276 be_set_emitter(op_sparc_OrNCCZero, emit_sparc_OrNCCZero);
277 be_set_emitter(op_sparc_RestoreZero, emit_sparc_RestoreZero);
278 be_set_emitter(op_sparc_SMulh, emit_sparc_SMulh);
279 be_set_emitter(op_sparc_Save, emit_sparc_Save);
280 be_set_emitter(op_sparc_SetHi, emit_sparc_SetHi);
281 be_set_emitter(op_sparc_Sll, emit_sparc_Sll);
282 be_set_emitter(op_sparc_Sra, emit_sparc_Sra);
283 be_set_emitter(op_sparc_Srl, emit_sparc_Srl);
284 be_set_emitter(op_sparc_St, emit_sparc_St);
285 be_set_emitter(op_sparc_Stbar, emit_sparc_Stbar);
286 be_set_emitter(op_sparc_Stf, emit_sparc_Stf);
287 be_set_emitter(op_sparc_Sub, emit_sparc_Sub);
288 be_set_emitter(op_sparc_SubCC, emit_sparc_SubCC);
289 be_set_emitter(op_sparc_SubCCZero, emit_sparc_SubCCZero);
290 be_set_emitter(op_sparc_SubX, emit_sparc_SubX);
291 be_set_emitter(op_sparc_UMulh, emit_sparc_UMulh);
292 be_set_emitter(op_sparc_XNor, emit_sparc_XNor);
293 be_set_emitter(op_sparc_XNorCCZero, emit_sparc_XNorCCZero);
294 be_set_emitter(op_sparc_Xor, emit_sparc_Xor);
295 be_set_emitter(op_sparc_XorCCZero, emit_sparc_XorCCZero);
296 be_set_emitter(op_sparc_fabs, emit_sparc_fabs);
297 be_set_emitter(op_sparc_fadd, emit_sparc_fadd);
298 be_set_emitter(op_sparc_fcmp, emit_sparc_fcmp);
299 be_set_emitter(op_sparc_fdiv, emit_sparc_fdiv);
300 be_set_emitter(op_sparc_fftof, emit_sparc_fftof);
301 be_set_emitter(op_sparc_fftoi, emit_sparc_fftoi);
302 be_set_emitter(op_sparc_fitof, emit_sparc_fitof);
303 be_set_emitter(op_sparc_fmul, emit_sparc_fmul);
304 be_set_emitter(op_sparc_fneg, emit_sparc_fneg);
305 be_set_emitter(op_sparc_fsub, emit_sparc_fsub);
struct ir_node ir_node
Procedure Graph Node.