1#include "gen_TEMPLATE_regalloc_if.h"
2#include "irverify_t.h"
3#include "fourcc.h"
4
5static int cmp_attr_TEMPLATE_fConst(const ir_node *a, const ir_node *b) {
6	(void) a;
7	(void) b;
8
9	/* TODO: compare fConst attributes */
10	return 1;
11
12}
13
14static int cmp_attr_TEMPLATE_Const(const ir_node *a, const ir_node *b) {
15	(void) a;
16	(void) b;
17
18	/* TODO: compare Const attributes */
19    return 1;
20
21}
22
23
24ir_op *op_TEMPLATE_fConst = NULL;
25ir_op *op_TEMPLATE_Shr = NULL;
26ir_op *op_TEMPLATE_fMul = NULL;
27ir_op *op_TEMPLATE_Start = NULL;
28ir_op *op_TEMPLATE_Or = NULL;
29ir_op *op_TEMPLATE_Xor = NULL;
30ir_op *op_TEMPLATE_fAdd = NULL;
31ir_op *op_TEMPLATE_Not = NULL;
32ir_op *op_TEMPLATE_Shl = NULL;
33ir_op *op_TEMPLATE_Return = NULL;
34ir_op *op_TEMPLATE_fMinus = NULL;
35ir_op *op_TEMPLATE_Add = NULL;
36ir_op *op_TEMPLATE_Store = NULL;
37ir_op *op_TEMPLATE_And = NULL;
38ir_op *op_TEMPLATE_fStore = NULL;
39ir_op *op_TEMPLATE_fLoad = NULL;
40ir_op *op_TEMPLATE_fSub = NULL;
41ir_op *op_TEMPLATE_Minus = NULL;
42ir_op *op_TEMPLATE_fDiv = NULL;
43ir_op *op_TEMPLATE_Const = NULL;
44ir_op *op_TEMPLATE_Sub = NULL;
45ir_op *op_TEMPLATE_Load = NULL;
46ir_op *op_TEMPLATE_Mul = NULL;
47ir_op *op_TEMPLATE_Jmp = NULL;
48
49ir_op *get_op_TEMPLATE_fConst(void)         { return op_TEMPLATE_fConst; }
50int    is_TEMPLATE_fConst(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fConst; }
51
52ir_op *get_op_TEMPLATE_Shr(void)         { return op_TEMPLATE_Shr; }
53int    is_TEMPLATE_Shr(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Shr; }
54
55ir_op *get_op_TEMPLATE_fMul(void)         { return op_TEMPLATE_fMul; }
56int    is_TEMPLATE_fMul(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fMul; }
57
58ir_op *get_op_TEMPLATE_Start(void)         { return op_TEMPLATE_Start; }
59int    is_TEMPLATE_Start(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Start; }
60
61ir_op *get_op_TEMPLATE_Or(void)         { return op_TEMPLATE_Or; }
62int    is_TEMPLATE_Or(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Or; }
63
64ir_op *get_op_TEMPLATE_Xor(void)         { return op_TEMPLATE_Xor; }
65int    is_TEMPLATE_Xor(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Xor; }
66
67ir_op *get_op_TEMPLATE_fAdd(void)         { return op_TEMPLATE_fAdd; }
68int    is_TEMPLATE_fAdd(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fAdd; }
69
70ir_op *get_op_TEMPLATE_Not(void)         { return op_TEMPLATE_Not; }
71int    is_TEMPLATE_Not(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Not; }
72
73ir_op *get_op_TEMPLATE_Shl(void)         { return op_TEMPLATE_Shl; }
74int    is_TEMPLATE_Shl(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Shl; }
75
76ir_op *get_op_TEMPLATE_Return(void)         { return op_TEMPLATE_Return; }
77int    is_TEMPLATE_Return(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Return; }
78
79ir_op *get_op_TEMPLATE_fMinus(void)         { return op_TEMPLATE_fMinus; }
80int    is_TEMPLATE_fMinus(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fMinus; }
81
82ir_op *get_op_TEMPLATE_Add(void)         { return op_TEMPLATE_Add; }
83int    is_TEMPLATE_Add(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Add; }
84
85ir_op *get_op_TEMPLATE_Store(void)         { return op_TEMPLATE_Store; }
86int    is_TEMPLATE_Store(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Store; }
87
88ir_op *get_op_TEMPLATE_And(void)         { return op_TEMPLATE_And; }
89int    is_TEMPLATE_And(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_And; }
90
91ir_op *get_op_TEMPLATE_fStore(void)         { return op_TEMPLATE_fStore; }
92int    is_TEMPLATE_fStore(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fStore; }
93
94ir_op *get_op_TEMPLATE_fLoad(void)         { return op_TEMPLATE_fLoad; }
95int    is_TEMPLATE_fLoad(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fLoad; }
96
97ir_op *get_op_TEMPLATE_fSub(void)         { return op_TEMPLATE_fSub; }
98int    is_TEMPLATE_fSub(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fSub; }
99
100ir_op *get_op_TEMPLATE_Minus(void)         { return op_TEMPLATE_Minus; }
101int    is_TEMPLATE_Minus(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Minus; }
102
103ir_op *get_op_TEMPLATE_fDiv(void)         { return op_TEMPLATE_fDiv; }
104int    is_TEMPLATE_fDiv(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_fDiv; }
105
106ir_op *get_op_TEMPLATE_Const(void)         { return op_TEMPLATE_Const; }
107int    is_TEMPLATE_Const(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Const; }
108
109ir_op *get_op_TEMPLATE_Sub(void)         { return op_TEMPLATE_Sub; }
110int    is_TEMPLATE_Sub(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Sub; }
111
112ir_op *get_op_TEMPLATE_Load(void)         { return op_TEMPLATE_Load; }
113int    is_TEMPLATE_Load(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Load; }
114
115ir_op *get_op_TEMPLATE_Mul(void)         { return op_TEMPLATE_Mul; }
116int    is_TEMPLATE_Mul(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Mul; }
117
118ir_op *get_op_TEMPLATE_Jmp(void)         { return op_TEMPLATE_Jmp; }
119int    is_TEMPLATE_Jmp(const ir_node *n) { return get_TEMPLATE_irn_opcode(n) == iro_TEMPLATE_Jmp; }
120
121
122
123static int TEMPLATE_opcode_start = -1;
124static int TEMPLATE_opcode_end   = -1;
125
126
127/** A tag for the TEMPLATE opcodes. Note that the address is used as a tag value, NOT the FOURCC code. */
128#define TEMPLATE_op_tag FOURCC('T', 'E', 'M', 'P')
129
130/** Return the opcode number of the first TEMPLATE opcode. */
131int get_TEMPLATE_opcode_first(void) {
132	return TEMPLATE_opcode_start;
133}
134
135/** Return the opcode number of the last TEMPLATE opcode + 1. */
136int get_TEMPLATE_opcode_last(void) {
137	return TEMPLATE_opcode_end;
138}
139
140/** Return 1 if the given opcode is a TEMPLATE machine op, 0 otherwise */
141int is_TEMPLATE_op(const ir_op *op) {
142	return get_op_tag(op) == TEMPLATE_op_tag;
143}
144
145/** Return 1 if the given node is a TEMPLATE machine node, 0 otherwise */
146int is_TEMPLATE_irn(const ir_node *node) {
147	return is_TEMPLATE_op(get_irn_op(node));
148}
149
150int get_TEMPLATE_irn_opcode(const ir_node *node) {
151	if (is_TEMPLATE_irn(node))
152		return get_irn_opcode(node) - TEMPLATE_opcode_start;
153	return -1;
154}
155
156#ifdef BIT
157#undef BIT
158#endif
159#define BIT(x)  (1 << (x))
160
161static const unsigned TEMPLATE_limit_gp_sp[] = { BIT(REG_GP_SP), 0 };
162
163static const arch_register_req_t TEMPLATE_requirements_fp_fp = {
164	arch_register_req_type_normal,
165	& TEMPLATE_reg_classes[CLASS_TEMPLATE_fp],
166	NULL,        /* limit bitset */
167	0,           /* same pos */
168	0,           /* different pos */
169	1            /* width */
170};
171
172
173static const arch_register_req_t TEMPLATE_requirements_gp_gp = {
174	arch_register_req_type_normal,
175	& TEMPLATE_reg_classes[CLASS_TEMPLATE_gp],
176	NULL,        /* limit bitset */
177	0,           /* same pos */
178	0,           /* different pos */
179	1            /* width */
180};
181
182
183static const arch_register_req_t TEMPLATE_requirements_gp_in_r1 = {
184	arch_register_req_type_should_be_same,
185	& TEMPLATE_reg_classes[CLASS_TEMPLATE_gp],
186	NULL,
187	1,        /* same pos */
188	0,       /* different pos */
189	1             /* width */
190};
191
192
193static const arch_register_req_t TEMPLATE_requirements_gp_sp_I_S = {
194	arch_register_req_type_ignore | arch_register_req_type_produces_sp | arch_register_req_type_limited,
195	& TEMPLATE_reg_classes[CLASS_TEMPLATE_gp],
196	TEMPLATE_limit_gp_sp,
197	0,        /* same pos */
198	0,       /* different pos */
199	1             /* width */
200};
201
202
203static const arch_register_req_t TEMPLATE_requirements__none = {
204	arch_register_req_type_none,
205	NULL,                         /* regclass */
206	NULL,                         /* limit bitset */
207	0,                            /* same pos */
208	0,                            /* different pos */
209	0                             /* width */
210};
211
212
213static const arch_register_req_t TEMPLATE_requirements_gp_sp = {
214	arch_register_req_type_limited,
215	& TEMPLATE_reg_classes[CLASS_TEMPLATE_gp],
216	TEMPLATE_limit_gp_sp,
217	0,        /* same pos */
218	0,       /* different pos */
219	1             /* width */
220};
221
222
223
224/**
225 * construct fConst node
226 */
227ir_node *new_bd_TEMPLATE_fConst(dbg_info *dbgi, ir_node *block)
228{
229	ir_graph         *irg        = get_irn_irg(block);
230	ir_op            *op         = op_TEMPLATE_fConst;
231	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
232	ir_node          *res;
233	backend_info_t   *info;
234	int             arity   = 0;
235	ir_node       **in      = NULL;
236	int             n_res   = 1;
237	ir_mode        *mode    = mode_F;
238	static const arch_register_req_t **in_reqs = NULL;
239
240	/* flags */
241	irn_flags_ |= arch_irn_flags_rematerializable;
242
243	/* create node */
244	assert(op != NULL);
245	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
246
247	/* init node attributes */
248		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
249
250	info = be_get_info(res);
251	(void) info; /* avoid potential warning */
252	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
253
254
255	/* optimize node */
256	res = optimize_node(res);
257	irn_verify_irg(res, irg);
258
259	return res;
260}
261
262/**
263 * construct Shr node
264 */
265ir_node *new_bd_TEMPLATE_Shr(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
266{
267	ir_graph         *irg        = get_irn_irg(block);
268	ir_op            *op         = op_TEMPLATE_Shr;
269	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
270	ir_node          *res;
271	backend_info_t   *info;
272	int             arity   = 2;
273	ir_node        *in[2];
274	int             n_res   = 1;
275	ir_mode        *mode    = mode_Iu;
276	static const arch_register_req_t *in_reqs[] =
277	{
278		& TEMPLATE_requirements_gp_gp,
279		& TEMPLATE_requirements_gp_gp,
280	};
281
282	/* construct in array */
283	in[0] = op0;
284	in[1] = op1;
285
286	/* flags */
287	irn_flags_ |= arch_irn_flags_rematerializable;
288
289	/* create node */
290	assert(op != NULL);
291	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
292
293	/* init node attributes */
294		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
295
296	info = be_get_info(res);
297	(void) info; /* avoid potential warning */
298	info->out_infos[0].req = &TEMPLATE_requirements_gp_in_r1;
299
300
301	/* optimize node */
302	res = optimize_node(res);
303	irn_verify_irg(res, irg);
304
305	return res;
306}
307
308/**
309 * construct fMul node
310 */
311ir_node *new_bd_TEMPLATE_fMul(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
312{
313	ir_graph         *irg        = get_irn_irg(block);
314	ir_op            *op         = op_TEMPLATE_fMul;
315	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
316	ir_node          *res;
317	backend_info_t   *info;
318	int             arity   = 2;
319	ir_node        *in[2];
320	int             n_res   = 1;
321	ir_mode        *mode    = mode_F;
322	static const arch_register_req_t *in_reqs[] =
323	{
324		& TEMPLATE_requirements_fp_fp,
325		& TEMPLATE_requirements_fp_fp,
326	};
327
328	/* construct in array */
329	in[0] = op0;
330	in[1] = op1;
331
332	/* create node */
333	assert(op != NULL);
334	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
335
336	/* init node attributes */
337		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
338
339	info = be_get_info(res);
340	(void) info; /* avoid potential warning */
341	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
342
343
344	/* optimize node */
345	res = optimize_node(res);
346	irn_verify_irg(res, irg);
347
348	return res;
349}
350
351/**
352 * construct Start node
353 */
354ir_node *new_bd_TEMPLATE_Start(dbg_info *dbgi, ir_node *block)
355{
356	ir_graph         *irg        = get_irn_irg(block);
357	ir_op            *op         = op_TEMPLATE_Start;
358	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
359	ir_node          *res;
360	backend_info_t   *info;
361	int             arity   = 0;
362	ir_node       **in      = NULL;
363	int             n_res   = 2;
364	ir_mode        *mode    = mode_T;
365	static const arch_register_req_t **in_reqs = NULL;
366
367	/* create node */
368	assert(op != NULL);
369	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
370
371	/* init node attributes */
372		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
373
374	info = be_get_info(res);
375	(void) info; /* avoid potential warning */
376	info->out_infos[0].req = &TEMPLATE_requirements_gp_sp_I_S;
377	info->out_infos[1].req = &TEMPLATE_requirements__none;
378
379
380	/* optimize node */
381	res = optimize_node(res);
382	irn_verify_irg(res, irg);
383
384	return res;
385}
386
387/**
388 * construct Or node
389 */
390ir_node *new_bd_TEMPLATE_Or(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
391{
392	ir_graph         *irg        = get_irn_irg(block);
393	ir_op            *op         = op_TEMPLATE_Or;
394	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
395	ir_node          *res;
396	backend_info_t   *info;
397	int             arity   = 2;
398	ir_node        *in[2];
399	int             n_res   = 1;
400	ir_mode        *mode    = mode_Iu;
401	static const arch_register_req_t *in_reqs[] =
402	{
403		& TEMPLATE_requirements_gp_gp,
404		& TEMPLATE_requirements_gp_gp,
405	};
406
407	/* construct in array */
408	in[0] = op0;
409	in[1] = op1;
410
411	/* flags */
412	irn_flags_ |= arch_irn_flags_rematerializable;
413
414	/* create node */
415	assert(op != NULL);
416	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
417
418	/* init node attributes */
419		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
420
421	info = be_get_info(res);
422	(void) info; /* avoid potential warning */
423	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
424
425
426	/* optimize node */
427	res = optimize_node(res);
428	irn_verify_irg(res, irg);
429
430	return res;
431}
432
433/**
434 * construct Xor node
435 */
436ir_node *new_bd_TEMPLATE_Xor(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
437{
438	ir_graph         *irg        = get_irn_irg(block);
439	ir_op            *op         = op_TEMPLATE_Xor;
440	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
441	ir_node          *res;
442	backend_info_t   *info;
443	int             arity   = 2;
444	ir_node        *in[2];
445	int             n_res   = 1;
446	ir_mode        *mode    = mode_Iu;
447	static const arch_register_req_t *in_reqs[] =
448	{
449		& TEMPLATE_requirements_gp_gp,
450		& TEMPLATE_requirements_gp_gp,
451	};
452
453	/* construct in array */
454	in[0] = op0;
455	in[1] = op1;
456
457	/* flags */
458	irn_flags_ |= arch_irn_flags_rematerializable;
459
460	/* create node */
461	assert(op != NULL);
462	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
463
464	/* init node attributes */
465		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
466
467	info = be_get_info(res);
468	(void) info; /* avoid potential warning */
469	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
470
471
472	/* optimize node */
473	res = optimize_node(res);
474	irn_verify_irg(res, irg);
475
476	return res;
477}
478
479/**
480 * construct fAdd node
481 */
482ir_node *new_bd_TEMPLATE_fAdd(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
483{
484	ir_graph         *irg        = get_irn_irg(block);
485	ir_op            *op         = op_TEMPLATE_fAdd;
486	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
487	ir_node          *res;
488	backend_info_t   *info;
489	int             arity   = 2;
490	ir_node        *in[2];
491	int             n_res   = 1;
492	ir_mode        *mode    = mode_F;
493	static const arch_register_req_t *in_reqs[] =
494	{
495		& TEMPLATE_requirements_fp_fp,
496		& TEMPLATE_requirements_fp_fp,
497	};
498
499	/* construct in array */
500	in[0] = op0;
501	in[1] = op1;
502
503	/* flags */
504	irn_flags_ |= arch_irn_flags_rematerializable;
505
506	/* create node */
507	assert(op != NULL);
508	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
509
510	/* init node attributes */
511		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
512
513	info = be_get_info(res);
514	(void) info; /* avoid potential warning */
515	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
516
517
518	/* optimize node */
519	res = optimize_node(res);
520	irn_verify_irg(res, irg);
521
522	return res;
523}
524
525/**
526 * construct Not node
527 */
528ir_node *new_bd_TEMPLATE_Not(dbg_info *dbgi, ir_node *block, ir_node *op0)
529{
530	ir_graph         *irg        = get_irn_irg(block);
531	ir_op            *op         = op_TEMPLATE_Not;
532	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
533	ir_node          *res;
534	backend_info_t   *info;
535	int             arity   = 1;
536	ir_node        *in[1];
537	int             n_res   = 1;
538	ir_mode        *mode    = mode_Iu;
539	static const arch_register_req_t *in_reqs[] =
540	{
541		& TEMPLATE_requirements_gp_gp,
542	};
543
544	/* construct in array */
545	in[0] = op0;
546
547	/* create node */
548	assert(op != NULL);
549	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
550
551	/* init node attributes */
552		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
553
554	info = be_get_info(res);
555	(void) info; /* avoid potential warning */
556	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
557
558
559	/* optimize node */
560	res = optimize_node(res);
561	irn_verify_irg(res, irg);
562
563	return res;
564}
565
566/**
567 * construct Shl node
568 */
569ir_node *new_bd_TEMPLATE_Shl(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
570{
571	ir_graph         *irg        = get_irn_irg(block);
572	ir_op            *op         = op_TEMPLATE_Shl;
573	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
574	ir_node          *res;
575	backend_info_t   *info;
576	int             arity   = 2;
577	ir_node        *in[2];
578	int             n_res   = 1;
579	ir_mode        *mode    = mode_Iu;
580	static const arch_register_req_t *in_reqs[] =
581	{
582		& TEMPLATE_requirements_gp_gp,
583		& TEMPLATE_requirements_gp_gp,
584	};
585
586	/* construct in array */
587	in[0] = op0;
588	in[1] = op1;
589
590	/* flags */
591	irn_flags_ |= arch_irn_flags_rematerializable;
592
593	/* create node */
594	assert(op != NULL);
595	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
596
597	/* init node attributes */
598		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
599
600	info = be_get_info(res);
601	(void) info; /* avoid potential warning */
602	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
603
604
605	/* optimize node */
606	res = optimize_node(res);
607	irn_verify_irg(res, irg);
608
609	return res;
610}
611
612/**
613 * construct Return node
614 */
615ir_node *new_bd_TEMPLATE_Return(dbg_info *dbgi, ir_node *block, ir_node *stack, ir_node *mem)
616{
617	ir_graph         *irg        = get_irn_irg(block);
618	ir_op            *op         = op_TEMPLATE_Return;
619	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
620	ir_node          *res;
621	backend_info_t   *info;
622	int             arity   = 2;
623	ir_node        *in[2];
624	int             n_res   = 0;
625	ir_mode        *mode    = mode_X;
626	static const arch_register_req_t *in_reqs[] =
627	{
628		& TEMPLATE_requirements_gp_sp,
629		& TEMPLATE_requirements__none,
630	};
631
632	/* construct in array */
633	in[0] = stack;
634	in[1] = mem;
635
636	/* create node */
637	assert(op != NULL);
638	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
639
640	/* init node attributes */
641		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
642
643	info = be_get_info(res);
644	(void) info; /* avoid potential warning */
645
646
647	/* optimize node */
648	res = optimize_node(res);
649	irn_verify_irg(res, irg);
650
651	return res;
652}
653
654/**
655 * construct fMinus node
656 */
657ir_node *new_bd_TEMPLATE_fMinus(dbg_info *dbgi, ir_node *block, ir_node *op0)
658{
659	ir_graph         *irg        = get_irn_irg(block);
660	ir_op            *op         = op_TEMPLATE_fMinus;
661	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
662	ir_node          *res;
663	backend_info_t   *info;
664	int             arity   = 1;
665	ir_node        *in[1];
666	int             n_res   = 1;
667	ir_mode        *mode    = mode_F;
668	static const arch_register_req_t *in_reqs[] =
669	{
670		& TEMPLATE_requirements_fp_fp,
671	};
672
673	/* construct in array */
674	in[0] = op0;
675
676	/* flags */
677	irn_flags_ |= arch_irn_flags_rematerializable;
678
679	/* create node */
680	assert(op != NULL);
681	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
682
683	/* init node attributes */
684		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
685
686	info = be_get_info(res);
687	(void) info; /* avoid potential warning */
688	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
689
690
691	/* optimize node */
692	res = optimize_node(res);
693	irn_verify_irg(res, irg);
694
695	return res;
696}
697
698/**
699 * construct Add node
700 */
701ir_node *new_bd_TEMPLATE_Add(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
702{
703	ir_graph         *irg        = get_irn_irg(block);
704	ir_op            *op         = op_TEMPLATE_Add;
705	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
706	ir_node          *res;
707	backend_info_t   *info;
708	int             arity   = 2;
709	ir_node        *in[2];
710	int             n_res   = 1;
711	ir_mode        *mode    = mode_Iu;
712	static const arch_register_req_t *in_reqs[] =
713	{
714		& TEMPLATE_requirements_gp_gp,
715		& TEMPLATE_requirements_gp_gp,
716	};
717
718	/* construct in array */
719	in[0] = op0;
720	in[1] = op1;
721
722	/* flags */
723	irn_flags_ |= arch_irn_flags_rematerializable;
724
725	/* create node */
726	assert(op != NULL);
727	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
728
729	/* init node attributes */
730		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
731
732	info = be_get_info(res);
733	(void) info; /* avoid potential warning */
734	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
735
736
737	/* optimize node */
738	res = optimize_node(res);
739	irn_verify_irg(res, irg);
740
741	return res;
742}
743
744/**
745 * construct Store node
746 */
747ir_node *new_bd_TEMPLATE_Store(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1, ir_node *op2, ir_mode *mode)
748{
749	ir_graph         *irg        = get_irn_irg(block);
750	ir_op            *op         = op_TEMPLATE_Store;
751	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
752	ir_node          *res;
753	backend_info_t   *info;
754	int             arity   = 3;
755	ir_node        *in[3];
756	int             n_res   = 0;
757	static const arch_register_req_t *in_reqs[] =
758	{
759		& TEMPLATE_requirements_gp_gp,
760		& TEMPLATE_requirements_gp_gp,
761		& TEMPLATE_requirements__none,
762	};
763
764	/* construct in array */
765	in[0] = op0;
766	in[1] = op1;
767	in[2] = op2;
768
769	/* flags */
770	irn_flags_ |= arch_irn_flags_rematerializable;
771
772	/* create node */
773	assert(op != NULL);
774	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
775
776	/* init node attributes */
777		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
778
779	info = be_get_info(res);
780	(void) info; /* avoid potential warning */
781
782
783	/* optimize node */
784	res = optimize_node(res);
785	irn_verify_irg(res, irg);
786
787	return res;
788}
789
790/**
791 * construct And node
792 */
793ir_node *new_bd_TEMPLATE_And(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
794{
795	ir_graph         *irg        = get_irn_irg(block);
796	ir_op            *op         = op_TEMPLATE_And;
797	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
798	ir_node          *res;
799	backend_info_t   *info;
800	int             arity   = 2;
801	ir_node        *in[2];
802	int             n_res   = 1;
803	ir_mode        *mode    = mode_Iu;
804	static const arch_register_req_t *in_reqs[] =
805	{
806		& TEMPLATE_requirements_gp_gp,
807		& TEMPLATE_requirements_gp_gp,
808	};
809
810	/* construct in array */
811	in[0] = op0;
812	in[1] = op1;
813
814	/* flags */
815	irn_flags_ |= arch_irn_flags_rematerializable;
816
817	/* create node */
818	assert(op != NULL);
819	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
820
821	/* init node attributes */
822		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
823
824	info = be_get_info(res);
825	(void) info; /* avoid potential warning */
826	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
827
828
829	/* optimize node */
830	res = optimize_node(res);
831	irn_verify_irg(res, irg);
832
833	return res;
834}
835
836/**
837 * construct fStore node
838 */
839ir_node *new_bd_TEMPLATE_fStore(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1, ir_node *op2, ir_mode *mode)
840{
841	ir_graph         *irg        = get_irn_irg(block);
842	ir_op            *op         = op_TEMPLATE_fStore;
843	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
844	ir_node          *res;
845	backend_info_t   *info;
846	int             arity   = 3;
847	ir_node        *in[3];
848	int             n_res   = 0;
849	static const arch_register_req_t *in_reqs[] =
850	{
851		& TEMPLATE_requirements_gp_gp,
852		& TEMPLATE_requirements_fp_fp,
853		& TEMPLATE_requirements__none,
854	};
855
856	/* construct in array */
857	in[0] = op0;
858	in[1] = op1;
859	in[2] = op2;
860
861	/* flags */
862	irn_flags_ |= arch_irn_flags_rematerializable;
863
864	/* create node */
865	assert(op != NULL);
866	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
867
868	/* init node attributes */
869		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
870
871	info = be_get_info(res);
872	(void) info; /* avoid potential warning */
873
874
875	/* optimize node */
876	res = optimize_node(res);
877	irn_verify_irg(res, irg);
878
879	return res;
880}
881
882/**
883 * construct fLoad node
884 */
885ir_node *new_bd_TEMPLATE_fLoad(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1, ir_mode *mode)
886{
887	ir_graph         *irg        = get_irn_irg(block);
888	ir_op            *op         = op_TEMPLATE_fLoad;
889	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
890	ir_node          *res;
891	backend_info_t   *info;
892	int             arity   = 2;
893	ir_node        *in[2];
894	int             n_res   = 1;
895	static const arch_register_req_t *in_reqs[] =
896	{
897		& TEMPLATE_requirements_gp_gp,
898		& TEMPLATE_requirements__none,
899	};
900
901	/* construct in array */
902	in[0] = op0;
903	in[1] = op1;
904
905	/* flags */
906	irn_flags_ |= arch_irn_flags_rematerializable;
907
908	/* create node */
909	assert(op != NULL);
910	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
911
912	/* init node attributes */
913		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
914
915	info = be_get_info(res);
916	(void) info; /* avoid potential warning */
917	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
918
919
920	/* optimize node */
921	res = optimize_node(res);
922	irn_verify_irg(res, irg);
923
924	return res;
925}
926
927/**
928 * construct fSub node
929 */
930ir_node *new_bd_TEMPLATE_fSub(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
931{
932	ir_graph         *irg        = get_irn_irg(block);
933	ir_op            *op         = op_TEMPLATE_fSub;
934	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
935	ir_node          *res;
936	backend_info_t   *info;
937	int             arity   = 2;
938	ir_node        *in[2];
939	int             n_res   = 1;
940	ir_mode        *mode    = mode_F;
941	static const arch_register_req_t *in_reqs[] =
942	{
943		& TEMPLATE_requirements_fp_fp,
944		& TEMPLATE_requirements_fp_fp,
945	};
946
947	/* construct in array */
948	in[0] = op0;
949	in[1] = op1;
950
951	/* flags */
952	irn_flags_ |= arch_irn_flags_rematerializable;
953
954	/* create node */
955	assert(op != NULL);
956	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
957
958	/* init node attributes */
959		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
960
961	info = be_get_info(res);
962	(void) info; /* avoid potential warning */
963	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
964
965
966	/* optimize node */
967	res = optimize_node(res);
968	irn_verify_irg(res, irg);
969
970	return res;
971}
972
973/**
974 * construct Minus node
975 */
976ir_node *new_bd_TEMPLATE_Minus(dbg_info *dbgi, ir_node *block, ir_node *op0)
977{
978	ir_graph         *irg        = get_irn_irg(block);
979	ir_op            *op         = op_TEMPLATE_Minus;
980	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
981	ir_node          *res;
982	backend_info_t   *info;
983	int             arity   = 1;
984	ir_node        *in[1];
985	int             n_res   = 1;
986	ir_mode        *mode    = mode_Iu;
987	static const arch_register_req_t *in_reqs[] =
988	{
989		& TEMPLATE_requirements_gp_gp,
990	};
991
992	/* construct in array */
993	in[0] = op0;
994
995	/* flags */
996	irn_flags_ |= arch_irn_flags_rematerializable;
997
998	/* create node */
999	assert(op != NULL);
1000	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1001
1002	/* init node attributes */
1003		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1004
1005	info = be_get_info(res);
1006	(void) info; /* avoid potential warning */
1007	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
1008
1009
1010	/* optimize node */
1011	res = optimize_node(res);
1012	irn_verify_irg(res, irg);
1013
1014	return res;
1015}
1016
1017/**
1018 * construct fDiv node
1019 */
1020ir_node *new_bd_TEMPLATE_fDiv(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
1021{
1022	ir_graph         *irg        = get_irn_irg(block);
1023	ir_op            *op         = op_TEMPLATE_fDiv;
1024	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1025	ir_node          *res;
1026	backend_info_t   *info;
1027	int             arity   = 2;
1028	ir_node        *in[2];
1029	int             n_res   = 1;
1030	ir_mode        *mode    = mode_F;
1031	static const arch_register_req_t *in_reqs[] =
1032	{
1033		& TEMPLATE_requirements_fp_fp,
1034		& TEMPLATE_requirements_fp_fp,
1035	};
1036
1037	/* construct in array */
1038	in[0] = op0;
1039	in[1] = op1;
1040
1041	/* create node */
1042	assert(op != NULL);
1043	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1044
1045	/* init node attributes */
1046		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1047
1048	info = be_get_info(res);
1049	(void) info; /* avoid potential warning */
1050	info->out_infos[0].req = &TEMPLATE_requirements_fp_fp;
1051
1052
1053	/* optimize node */
1054	res = optimize_node(res);
1055	irn_verify_irg(res, irg);
1056
1057	return res;
1058}
1059
1060/**
1061 * construct Const node
1062 */
1063ir_node *new_bd_TEMPLATE_Const(dbg_info *dbgi, ir_node *block, ir_tarval *value)
1064{
1065	ir_graph         *irg        = get_irn_irg(block);
1066	ir_op            *op         = op_TEMPLATE_Const;
1067	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1068	ir_node          *res;
1069	backend_info_t   *info;
1070	int             arity   = 0;
1071	ir_node       **in      = NULL;
1072	int             n_res   = 1;
1073	ir_mode        *mode    = mode_Iu;
1074	static const arch_register_req_t **in_reqs = NULL;
1075
1076	/* flags */
1077	irn_flags_ |= arch_irn_flags_rematerializable;
1078
1079	/* create node */
1080	assert(op != NULL);
1081	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1082
1083	/* init node attributes */
1084		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1085	set_TEMPLATE_value(res, value);
1086	info = be_get_info(res);
1087	(void) info; /* avoid potential warning */
1088	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
1089
1090
1091	/* optimize node */
1092	res = optimize_node(res);
1093	irn_verify_irg(res, irg);
1094
1095	return res;
1096}
1097
1098/**
1099 * construct Sub node
1100 */
1101ir_node *new_bd_TEMPLATE_Sub(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
1102{
1103	ir_graph         *irg        = get_irn_irg(block);
1104	ir_op            *op         = op_TEMPLATE_Sub;
1105	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1106	ir_node          *res;
1107	backend_info_t   *info;
1108	int             arity   = 2;
1109	ir_node        *in[2];
1110	int             n_res   = 1;
1111	ir_mode        *mode    = mode_Iu;
1112	static const arch_register_req_t *in_reqs[] =
1113	{
1114		& TEMPLATE_requirements_gp_gp,
1115		& TEMPLATE_requirements_gp_gp,
1116	};
1117
1118	/* construct in array */
1119	in[0] = op0;
1120	in[1] = op1;
1121
1122	/* flags */
1123	irn_flags_ |= arch_irn_flags_rematerializable;
1124
1125	/* create node */
1126	assert(op != NULL);
1127	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1128
1129	/* init node attributes */
1130		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1131
1132	info = be_get_info(res);
1133	(void) info; /* avoid potential warning */
1134	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
1135
1136
1137	/* optimize node */
1138	res = optimize_node(res);
1139	irn_verify_irg(res, irg);
1140
1141	return res;
1142}
1143
1144/**
1145 * construct Load node
1146 */
1147ir_node *new_bd_TEMPLATE_Load(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1, ir_mode *mode)
1148{
1149	ir_graph         *irg        = get_irn_irg(block);
1150	ir_op            *op         = op_TEMPLATE_Load;
1151	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1152	ir_node          *res;
1153	backend_info_t   *info;
1154	int             arity   = 2;
1155	ir_node        *in[2];
1156	int             n_res   = 1;
1157	static const arch_register_req_t *in_reqs[] =
1158	{
1159		& TEMPLATE_requirements_gp_gp,
1160		& TEMPLATE_requirements__none,
1161	};
1162
1163	/* construct in array */
1164	in[0] = op0;
1165	in[1] = op1;
1166
1167	/* flags */
1168	irn_flags_ |= arch_irn_flags_rematerializable;
1169
1170	/* create node */
1171	assert(op != NULL);
1172	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1173
1174	/* init node attributes */
1175		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1176
1177	info = be_get_info(res);
1178	(void) info; /* avoid potential warning */
1179	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
1180
1181
1182	/* optimize node */
1183	res = optimize_node(res);
1184	irn_verify_irg(res, irg);
1185
1186	return res;
1187}
1188
1189/**
1190 * construct Mul node
1191 */
1192ir_node *new_bd_TEMPLATE_Mul(dbg_info *dbgi, ir_node *block, ir_node *op0, ir_node *op1)
1193{
1194	ir_graph         *irg        = get_irn_irg(block);
1195	ir_op            *op         = op_TEMPLATE_Mul;
1196	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1197	ir_node          *res;
1198	backend_info_t   *info;
1199	int             arity   = 2;
1200	ir_node        *in[2];
1201	int             n_res   = 1;
1202	ir_mode        *mode    = mode_Iu;
1203	static const arch_register_req_t *in_reqs[] =
1204	{
1205		& TEMPLATE_requirements_gp_gp,
1206		& TEMPLATE_requirements_gp_gp,
1207	};
1208
1209	/* construct in array */
1210	in[0] = op0;
1211	in[1] = op1;
1212
1213	/* flags */
1214	irn_flags_ |= arch_irn_flags_rematerializable;
1215
1216	/* create node */
1217	assert(op != NULL);
1218	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1219
1220	/* init node attributes */
1221		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1222
1223	info = be_get_info(res);
1224	(void) info; /* avoid potential warning */
1225	info->out_infos[0].req = &TEMPLATE_requirements_gp_gp;
1226
1227
1228	/* optimize node */
1229	res = optimize_node(res);
1230	irn_verify_irg(res, irg);
1231
1232	return res;
1233}
1234
1235/**
1236 * construct Jmp node
1237 */
1238ir_node *new_bd_TEMPLATE_Jmp(dbg_info *dbgi, ir_node *block)
1239{
1240	ir_graph         *irg        = get_irn_irg(block);
1241	ir_op            *op         = op_TEMPLATE_Jmp;
1242	arch_irn_flags_t  irn_flags_ = arch_irn_flags_none;
1243	ir_node          *res;
1244	backend_info_t   *info;
1245	int             arity   = 0;
1246	ir_node       **in      = NULL;
1247	int             n_res   = 1;
1248	ir_mode        *mode    = mode_X;
1249	static const arch_register_req_t **in_reqs = NULL;
1250
1251	/* flags */
1252	irn_flags_ |= arch_irn_flags_simple_jump;
1253
1254	/* create node */
1255	assert(op != NULL);
1256	res = new_ir_node(dbgi, irg, block, op, mode, arity, in);
1257
1258	/* init node attributes */
1259		init_TEMPLATE_attributes(res, irn_flags_, in_reqs, n_res);
1260
1261	info = be_get_info(res);
1262	(void) info; /* avoid potential warning */
1263	info->out_infos[0].req = &TEMPLATE_requirements__none;
1264
1265
1266	/* optimize node */
1267	res = optimize_node(res);
1268	irn_verify_irg(res, irg);
1269
1270	return res;
1271}
1272
1273
1274
1275/**
1276 * Creates the TEMPLATE specific Firm machine operations
1277 * needed for the assembler irgs.
1278 */
1279void TEMPLATE_create_opcodes(const arch_irn_ops_t *be_ops)
1280{
1281	ir_op *op;
1282	int    cur_opcode = get_next_ir_opcodes(iro_TEMPLATE_last);
1283
1284	TEMPLATE_opcode_start = cur_opcode;
1285	op = new_ir_op(cur_opcode + iro_TEMPLATE_fConst, "TEMPLATE_fConst", op_pin_state_floats, irop_flag_constlike, oparity_zero, 0, sizeof(TEMPLATE_attr_t));
1286	op->ops.be_ops        = be_ops;
1287	op->ops.dump_node     = TEMPLATE_dump_node;
1288	op->ops.node_cmp_attr = cmp_attr_TEMPLATE_fConst;
1289	op->ops.copy_attr     = TEMPLATE_copy_attr;
1290	set_op_tag(op, TEMPLATE_op_tag);
1291	op_TEMPLATE_fConst = op;
1292	op = new_ir_op(cur_opcode + iro_TEMPLATE_Shr, "TEMPLATE_Shr", op_pin_state_floats, irop_flag_none, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1293	op->ops.be_ops        = be_ops;
1294	op->ops.dump_node     = TEMPLATE_dump_node;
1295	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1296	op->ops.copy_attr     = TEMPLATE_copy_attr;
1297	set_op_tag(op, TEMPLATE_op_tag);
1298	op_TEMPLATE_Shr = op;
1299	op = new_ir_op(cur_opcode + iro_TEMPLATE_fMul, "TEMPLATE_fMul", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1300	op->ops.be_ops        = be_ops;
1301	op->ops.dump_node     = TEMPLATE_dump_node;
1302	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1303	op->ops.copy_attr     = TEMPLATE_copy_attr;
1304	set_op_tag(op, TEMPLATE_op_tag);
1305	op_TEMPLATE_fMul = op;
1306	op = new_ir_op(cur_opcode + iro_TEMPLATE_Start, "TEMPLATE_Start", op_pin_state_pinned, irop_flag_none, oparity_zero, 0, sizeof(TEMPLATE_attr_t));
1307	op->ops.be_ops        = be_ops;
1308	op->ops.dump_node     = TEMPLATE_dump_node;
1309	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1310	op->ops.copy_attr     = TEMPLATE_copy_attr;
1311	set_op_tag(op, TEMPLATE_op_tag);
1312	op_TEMPLATE_Start = op;
1313	op = new_ir_op(cur_opcode + iro_TEMPLATE_Or, "TEMPLATE_Or", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1314	op->ops.be_ops        = be_ops;
1315	op->ops.dump_node     = TEMPLATE_dump_node;
1316	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1317	op->ops.copy_attr     = TEMPLATE_copy_attr;
1318	set_op_tag(op, TEMPLATE_op_tag);
1319	op_TEMPLATE_Or = op;
1320	op = new_ir_op(cur_opcode + iro_TEMPLATE_Xor, "TEMPLATE_Xor", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1321	op->ops.be_ops        = be_ops;
1322	op->ops.dump_node     = TEMPLATE_dump_node;
1323	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1324	op->ops.copy_attr     = TEMPLATE_copy_attr;
1325	set_op_tag(op, TEMPLATE_op_tag);
1326	op_TEMPLATE_Xor = op;
1327	op = new_ir_op(cur_opcode + iro_TEMPLATE_fAdd, "TEMPLATE_fAdd", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1328	op->ops.be_ops        = be_ops;
1329	op->ops.dump_node     = TEMPLATE_dump_node;
1330	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1331	op->ops.copy_attr     = TEMPLATE_copy_attr;
1332	set_op_tag(op, TEMPLATE_op_tag);
1333	op_TEMPLATE_fAdd = op;
1334	op = new_ir_op(cur_opcode + iro_TEMPLATE_Not, "TEMPLATE_Not", op_pin_state_floats, irop_flag_none, oparity_unary, 0, sizeof(TEMPLATE_attr_t));
1335	op->ops.be_ops        = be_ops;
1336	op->ops.dump_node     = TEMPLATE_dump_node;
1337	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1338	op->ops.copy_attr     = TEMPLATE_copy_attr;
1339	set_op_tag(op, TEMPLATE_op_tag);
1340	op_TEMPLATE_Not = op;
1341	op = new_ir_op(cur_opcode + iro_TEMPLATE_Shl, "TEMPLATE_Shl", op_pin_state_floats, irop_flag_none, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1342	op->ops.be_ops        = be_ops;
1343	op->ops.dump_node     = TEMPLATE_dump_node;
1344	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1345	op->ops.copy_attr     = TEMPLATE_copy_attr;
1346	set_op_tag(op, TEMPLATE_op_tag);
1347	op_TEMPLATE_Shl = op;
1348	op = new_ir_op(cur_opcode + iro_TEMPLATE_Return, "TEMPLATE_Return", op_pin_state_pinned, irop_flag_cfopcode, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1349	op->ops.be_ops        = be_ops;
1350	op->ops.dump_node     = TEMPLATE_dump_node;
1351	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1352	op->ops.copy_attr     = TEMPLATE_copy_attr;
1353	set_op_tag(op, TEMPLATE_op_tag);
1354	op_TEMPLATE_Return = op;
1355	op = new_ir_op(cur_opcode + iro_TEMPLATE_fMinus, "TEMPLATE_fMinus", op_pin_state_floats, irop_flag_none, oparity_unary, 0, sizeof(TEMPLATE_attr_t));
1356	op->ops.be_ops        = be_ops;
1357	op->ops.dump_node     = TEMPLATE_dump_node;
1358	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1359	op->ops.copy_attr     = TEMPLATE_copy_attr;
1360	set_op_tag(op, TEMPLATE_op_tag);
1361	op_TEMPLATE_fMinus = op;
1362	op = new_ir_op(cur_opcode + iro_TEMPLATE_Add, "TEMPLATE_Add", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1363	op->ops.be_ops        = be_ops;
1364	op->ops.dump_node     = TEMPLATE_dump_node;
1365	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1366	op->ops.copy_attr     = TEMPLATE_copy_attr;
1367	set_op_tag(op, TEMPLATE_op_tag);
1368	op_TEMPLATE_Add = op;
1369	op = new_ir_op(cur_opcode + iro_TEMPLATE_Store, "TEMPLATE_Store", op_pin_state_exc_pinned, irop_flag_uses_memory, oparity_trinary, 0, sizeof(TEMPLATE_attr_t));
1370	op->ops.be_ops        = be_ops;
1371	op->ops.dump_node     = TEMPLATE_dump_node;
1372	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1373	op->ops.copy_attr     = TEMPLATE_copy_attr;
1374	set_op_tag(op, TEMPLATE_op_tag);
1375	op_TEMPLATE_Store = op;
1376	op = new_ir_op(cur_opcode + iro_TEMPLATE_And, "TEMPLATE_And", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1377	op->ops.be_ops        = be_ops;
1378	op->ops.dump_node     = TEMPLATE_dump_node;
1379	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1380	op->ops.copy_attr     = TEMPLATE_copy_attr;
1381	set_op_tag(op, TEMPLATE_op_tag);
1382	op_TEMPLATE_And = op;
1383	op = new_ir_op(cur_opcode + iro_TEMPLATE_fStore, "TEMPLATE_fStore", op_pin_state_exc_pinned, irop_flag_uses_memory, oparity_trinary, 0, sizeof(TEMPLATE_attr_t));
1384	op->ops.be_ops        = be_ops;
1385	op->ops.dump_node     = TEMPLATE_dump_node;
1386	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1387	op->ops.copy_attr     = TEMPLATE_copy_attr;
1388	set_op_tag(op, TEMPLATE_op_tag);
1389	op_TEMPLATE_fStore = op;
1390	op = new_ir_op(cur_opcode + iro_TEMPLATE_fLoad, "TEMPLATE_fLoad", op_pin_state_exc_pinned, irop_flag_uses_memory, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1391	op->ops.be_ops        = be_ops;
1392	op->ops.dump_node     = TEMPLATE_dump_node;
1393	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1394	op->ops.copy_attr     = TEMPLATE_copy_attr;
1395	set_op_tag(op, TEMPLATE_op_tag);
1396	op_TEMPLATE_fLoad = op;
1397	op = new_ir_op(cur_opcode + iro_TEMPLATE_fSub, "TEMPLATE_fSub", op_pin_state_floats, irop_flag_none, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1398	op->ops.be_ops        = be_ops;
1399	op->ops.dump_node     = TEMPLATE_dump_node;
1400	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1401	op->ops.copy_attr     = TEMPLATE_copy_attr;
1402	set_op_tag(op, TEMPLATE_op_tag);
1403	op_TEMPLATE_fSub = op;
1404	op = new_ir_op(cur_opcode + iro_TEMPLATE_Minus, "TEMPLATE_Minus", op_pin_state_floats, irop_flag_none, oparity_unary, 0, sizeof(TEMPLATE_attr_t));
1405	op->ops.be_ops        = be_ops;
1406	op->ops.dump_node     = TEMPLATE_dump_node;
1407	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1408	op->ops.copy_attr     = TEMPLATE_copy_attr;
1409	set_op_tag(op, TEMPLATE_op_tag);
1410	op_TEMPLATE_Minus = op;
1411	op = new_ir_op(cur_opcode + iro_TEMPLATE_fDiv, "TEMPLATE_fDiv", op_pin_state_floats, irop_flag_none, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1412	op->ops.be_ops        = be_ops;
1413	op->ops.dump_node     = TEMPLATE_dump_node;
1414	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1415	op->ops.copy_attr     = TEMPLATE_copy_attr;
1416	set_op_tag(op, TEMPLATE_op_tag);
1417	op_TEMPLATE_fDiv = op;
1418	op = new_ir_op(cur_opcode + iro_TEMPLATE_Const, "TEMPLATE_Const", op_pin_state_floats, irop_flag_constlike, oparity_zero, 0, sizeof(TEMPLATE_attr_t));
1419	op->ops.be_ops        = be_ops;
1420	op->ops.dump_node     = TEMPLATE_dump_node;
1421	op->ops.node_cmp_attr = cmp_attr_TEMPLATE_Const;
1422	op->ops.copy_attr     = TEMPLATE_copy_attr;
1423	set_op_tag(op, TEMPLATE_op_tag);
1424	op_TEMPLATE_Const = op;
1425	op = new_ir_op(cur_opcode + iro_TEMPLATE_Sub, "TEMPLATE_Sub", op_pin_state_floats, irop_flag_none, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1426	op->ops.be_ops        = be_ops;
1427	op->ops.dump_node     = TEMPLATE_dump_node;
1428	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1429	op->ops.copy_attr     = TEMPLATE_copy_attr;
1430	set_op_tag(op, TEMPLATE_op_tag);
1431	op_TEMPLATE_Sub = op;
1432	op = new_ir_op(cur_opcode + iro_TEMPLATE_Load, "TEMPLATE_Load", op_pin_state_exc_pinned, irop_flag_uses_memory, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1433	op->ops.be_ops        = be_ops;
1434	op->ops.dump_node     = TEMPLATE_dump_node;
1435	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1436	op->ops.copy_attr     = TEMPLATE_copy_attr;
1437	set_op_tag(op, TEMPLATE_op_tag);
1438	op_TEMPLATE_Load = op;
1439	op = new_ir_op(cur_opcode + iro_TEMPLATE_Mul, "TEMPLATE_Mul", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, sizeof(TEMPLATE_attr_t));
1440	op->ops.be_ops        = be_ops;
1441	op->ops.dump_node     = TEMPLATE_dump_node;
1442	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1443	op->ops.copy_attr     = TEMPLATE_copy_attr;
1444	set_op_tag(op, TEMPLATE_op_tag);
1445	op_TEMPLATE_Mul = op;
1446	op = new_ir_op(cur_opcode + iro_TEMPLATE_Jmp, "TEMPLATE_Jmp", op_pin_state_pinned, irop_flag_cfopcode, oparity_zero, 0, sizeof(TEMPLATE_attr_t));
1447	op->ops.be_ops        = be_ops;
1448	op->ops.dump_node     = TEMPLATE_dump_node;
1449	op->ops.node_cmp_attr = TEMPLATE_compare_attr;
1450	op->ops.copy_attr     = TEMPLATE_copy_attr;
1451	set_op_tag(op, TEMPLATE_op_tag);
1452	op_TEMPLATE_Jmp = op;
1453
1454	TEMPLATE_opcode_end = cur_opcode + iro_TEMPLATE_last;
1455}
1456
1457void TEMPLATE_free_opcodes(void)
1458{
1459	free_ir_op(op_TEMPLATE_fConst); op_TEMPLATE_fConst = NULL;
1460	free_ir_op(op_TEMPLATE_Shr); op_TEMPLATE_Shr = NULL;
1461	free_ir_op(op_TEMPLATE_fMul); op_TEMPLATE_fMul = NULL;
1462	free_ir_op(op_TEMPLATE_Start); op_TEMPLATE_Start = NULL;
1463	free_ir_op(op_TEMPLATE_Or); op_TEMPLATE_Or = NULL;
1464	free_ir_op(op_TEMPLATE_Xor); op_TEMPLATE_Xor = NULL;
1465	free_ir_op(op_TEMPLATE_fAdd); op_TEMPLATE_fAdd = NULL;
1466	free_ir_op(op_TEMPLATE_Not); op_TEMPLATE_Not = NULL;
1467	free_ir_op(op_TEMPLATE_Shl); op_TEMPLATE_Shl = NULL;
1468	free_ir_op(op_TEMPLATE_Return); op_TEMPLATE_Return = NULL;
1469	free_ir_op(op_TEMPLATE_fMinus); op_TEMPLATE_fMinus = NULL;
1470	free_ir_op(op_TEMPLATE_Add); op_TEMPLATE_Add = NULL;
1471	free_ir_op(op_TEMPLATE_Store); op_TEMPLATE_Store = NULL;
1472	free_ir_op(op_TEMPLATE_And); op_TEMPLATE_And = NULL;
1473	free_ir_op(op_TEMPLATE_fStore); op_TEMPLATE_fStore = NULL;
1474	free_ir_op(op_TEMPLATE_fLoad); op_TEMPLATE_fLoad = NULL;
1475	free_ir_op(op_TEMPLATE_fSub); op_TEMPLATE_fSub = NULL;
1476	free_ir_op(op_TEMPLATE_Minus); op_TEMPLATE_Minus = NULL;
1477	free_ir_op(op_TEMPLATE_fDiv); op_TEMPLATE_fDiv = NULL;
1478	free_ir_op(op_TEMPLATE_Const); op_TEMPLATE_Const = NULL;
1479	free_ir_op(op_TEMPLATE_Sub); op_TEMPLATE_Sub = NULL;
1480	free_ir_op(op_TEMPLATE_Load); op_TEMPLATE_Load = NULL;
1481	free_ir_op(op_TEMPLATE_Mul); op_TEMPLATE_Mul = NULL;
1482	free_ir_op(op_TEMPLATE_Jmp); op_TEMPLATE_Jmp = NULL;
1483}
1484