fehler109
[libfirm] / ir / be / arm / arm_new_nodes.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief  This file implements the creation of the architecture specific firm
23  *         opcodes and the corresponding node constructors for the arm
24  *         assembler irg.
25  * @author Oliver Richter, Tobias Gneist
26  * @version $Id$
27  */
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32 #include <stdlib.h>
33
34 #include "irprog_t.h"
35 #include "irgraph_t.h"
36 #include "irnode_t.h"
37 #include "irmode_t.h"
38 #include "ircons_t.h"
39 #include "iropt_t.h"
40 #include "irop.h"
41 #include "firm_common_t.h"
42 #include "irvrfy_t.h"
43 #include "irprintf.h"
44 #include "xmalloc.h"
45
46 #include "../bearch_t.h"
47
48 #include "arm_nodes_attr.h"
49 #include "arm_new_nodes.h"
50
51 #include "../beabi.h"
52 #include "bearch_arm_t.h"
53
54 /**
55  * Returns the shift modifier string.
56  */
57 const char *arm_shf_mod_name(arm_shift_modifier mod) {
58   static const char *names[] = { NULL, NULL, "asr", "lsl", "lsr", "ror", "rrx" };
59         return names[mod];
60 }
61
62 /***********************************************************************************
63  *      _                                   _       _             __
64  *     | |                                 (_)     | |           / _|
65  *   __| |_   _ _ __ ___  _ __   ___ _ __   _ _ __ | |_ ___ _ __| |_ __ _  ___ ___
66  *  / _` | | | | '_ ` _ \| '_ \ / _ \ '__| | | '_ \| __/ _ \ '__|  _/ _` |/ __/ _ \
67  * | (_| | |_| | | | | | | |_) |  __/ |    | | | | | ||  __/ |  | || (_| | (_|  __/
68  *  \__,_|\__,_|_| |_| |_| .__/ \___|_|    |_|_| |_|\__\___|_|  |_| \__,_|\___\___|
69  *                       | |
70  *                       |_|
71  ***********************************************************************************/
72
73 /**
74  * Dumps the register requirements for either in or out.
75  */
76 static void dump_reg_req(FILE *F, const ir_node *node,
77                          const arch_register_req_t **reqs, int inout) {
78         char *dir = inout ? "out" : "in";
79         int   max = inout ? get_arm_n_res(node) : get_irn_arity(node);
80         char  buf[1024];
81         int   i;
82
83         memset(buf, 0, sizeof(buf));
84
85         if (reqs) {
86                 for (i = 0; i < max; i++) {
87                         fprintf(F, "%sreq #%d =", dir, i);
88
89                         if (reqs[i]->type == arch_register_req_type_none) {
90                                 fprintf(F, " n/a");
91                         }
92
93                         if (reqs[i]->type & arch_register_req_type_normal) {
94                                 fprintf(F, " %s", reqs[i]->cls->name);
95                         }
96
97                         if (reqs[i]->type & arch_register_req_type_limited) {
98                                 fprintf(F, " %s",
99                                         arch_register_req_format(buf, sizeof(buf), reqs[i], node));
100                         }
101
102                         if (reqs[i]->type & arch_register_req_type_should_be_same) {
103                                 const unsigned other = reqs[i]->other_same;
104                                 int i;
105
106                                 ir_fprintf(F, " same as");
107                                 for (i = 0; 1U << i <= other; ++i) {
108                                         if (other & (1U << i)) {
109                                                 ir_fprintf(F, " %+F", get_irn_n(node, i));
110                                         }
111                                 }
112                         }
113
114                         if (reqs[i]->type & arch_register_req_type_should_be_different) {
115                                 const unsigned other = reqs[i]->other_different;
116                                 int i;
117
118                                 ir_fprintf(F, " different from");
119                                 for (i = 0; 1U << i <= other; ++i) {
120                                         if (other & (1U << i)) {
121                                                 ir_fprintf(F, " %+F", get_irn_n(node, i));
122                                         }
123                                 }
124                         }
125
126                         fprintf(F, "\n");
127                 }
128
129                 fprintf(F, "\n");
130         } else {
131                 fprintf(F, "%sreq = N/A\n", dir);
132         }
133 }
134
135 /**
136  * Dumper interface for dumping arm nodes in vcg.
137  * @param n        the node to dump
138  * @param F        the output file
139  * @param reason   indicates which kind of information should be dumped
140  * @return 0 on success or != 0 on failure
141  */
142 static int arm_dump_node(ir_node *n, FILE *F, dump_reason_t reason) {
143         ir_mode     *mode = NULL;
144         int          bad  = 0;
145         int          i;
146         arm_attr_t  *attr = get_arm_attr(n);
147         const arch_register_req_t **reqs;
148         const arch_register_t     **slots;
149         arm_shift_modifier        mod;
150
151         switch (reason) {
152                 case dump_node_opcode_txt:
153                         fprintf(F, "%s", get_irn_opname(n));
154                         break;
155
156                 case dump_node_mode_txt:
157                         mode = get_irn_mode(n);
158
159                         if (mode) {
160                                 fprintf(F, "[%s]", get_mode_name(mode));
161                         }
162                         else {
163                                 fprintf(F, "[?NOMODE?]");
164                         }
165                         break;
166
167                 case dump_node_nodeattr_txt:
168                         mod = ARM_GET_SHF_MOD(attr);
169                         if (ARM_HAS_SHIFT(mod)) {
170                                 fprintf(F, "[%s #%ld]", arm_shf_mod_name(mod), get_tarval_long(attr->value));
171                         }
172                         else if (mod == ARM_SHF_IMM) {
173                                 /* immediate */
174                                 fprintf(F, "[#0x%X]", arm_decode_imm_w_shift(attr->value));
175                         }
176                         break;
177
178                 case dump_node_info_txt:
179                         fprintf(F, "=== arm attr begin ===\n");
180
181                         /* dump IN requirements */
182                         if (get_irn_arity(n) > 0) {
183                                 reqs = get_arm_in_req_all(n);
184                                 dump_reg_req(F, n, reqs, 0);
185                         }
186
187                         /* dump OUT requirements */
188                         if (ARR_LEN(attr->slots) > 0) {
189                                 reqs = get_arm_out_req_all(n);
190                                 dump_reg_req(F, n, reqs, 1);
191                         }
192
193                         /* dump assigned registers */
194                         slots = get_arm_slots(n);
195                         if (slots && ARR_LEN(attr->slots) > 0) {
196                                 for (i = 0; i < ARR_LEN(attr->slots); i++) {
197                                         if (slots[i]) {
198                                                 fprintf(F, "reg #%d = %s\n", i, slots[i]->name);
199                                         }
200                                         else {
201                                                 fprintf(F, "reg #%d = n/a\n", i);
202                                         }
203                                 }
204                         }
205                         fprintf(F, "\n");
206
207                         /* dump n_res */
208                         fprintf(F, "n_res = %d\n", get_arm_n_res(n));
209
210                         /* dump flags */
211                         fprintf(F, "flags =");
212                         if (attr->flags == arch_irn_flags_none) {
213                                 fprintf(F, " none");
214                         }
215                         else {
216                                 if (attr->flags & arch_irn_flags_dont_spill) {
217                                         fprintf(F, " unspillable");
218                                 }
219                                 if (attr->flags & arch_irn_flags_rematerializable) {
220                                         fprintf(F, " remat");
221                                 }
222                                 if (attr->flags & arch_irn_flags_ignore) {
223                                         fprintf(F, " ignore");
224                                 }
225                         }
226                         fprintf(F, " (%d)\n", attr->flags);
227
228                         if (get_arm_value(n)) {
229                                 if (is_arm_CopyB(n)) {
230                                         fprintf(F, "size = %lu\n", get_tarval_long(get_arm_value(n)));
231                                 } else {
232                                         if (mode_is_float(get_irn_mode(n))) {
233                                                 fprintf(F, "float value = (%f)\n", (double) get_tarval_double(get_arm_value(n)));
234                                         } else if (mode_is_int(get_irn_mode(n))) {
235                                                 long v =  get_tarval_long(get_arm_value(n));
236                                                 fprintf(F, "long value = %ld (0x%08lx)\n", v, v);
237                                         } else if (mode_is_reference(get_irn_mode(n))) {
238                                                 fprintf(F, "pointer\n");
239                                         } else {
240                                                 assert(0 && "unbehandelter Typ im const-Knoten");
241                                         }
242                                 }
243                         }
244                         if (is_arm_CmpBra(n) && get_arm_CondJmp_proj_num(n) >= 0) {
245                                 fprintf(F, "proj_num = (%d)\n", get_arm_CondJmp_proj_num(n));
246                         }
247                         /* TODO: dump all additional attributes */
248
249                         fprintf(F, "=== arm attr end ===\n");
250                         /* end of: case dump_node_info_txt */
251                         break;
252         }
253         return bad;
254 }
255
256
257
258 /***************************************************************************************************
259  *        _   _                   _       __        _                    _   _               _
260  *       | | | |                 | |     / /       | |                  | | | |             | |
261  *   __ _| |_| |_ _ __   ___  ___| |_   / /_ _  ___| |_   _ __ ___   ___| |_| |__   ___   __| |___
262  *  / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
263  * | (_| | |_| |_| |    \__ \  __/ |_ / / (_| |  __/ |_  | | | | | |  __/ |_| | | | (_) | (_| \__ \
264  *  \__,_|\__|\__|_|    |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
265  *                                        __/ |
266  *                                       |___/
267  ***************************************************************************************************/
268
269 /* Returns the attributes of a generic Arm node. */
270 arm_attr_t *get_arm_attr(ir_node *node) {
271         assert(is_arm_irn(node) && "need arm node to get attributes");
272         return get_irn_generic_attr(node);
273 }
274
275 const arm_attr_t *get_arm_attr_const(const ir_node *node) {
276         assert(is_arm_irn(node) && "need arm node to get attributes");
277         return get_irn_generic_attr_const(node);
278 }
279
280 /**
281  * Returns the attributes of an ARM SymConst node.
282  */
283 arm_SymConst_attr_t *get_arm_SymConst_attr(ir_node *node) {
284         assert(is_arm_SymConst(node));
285         return get_irn_generic_attr(node);
286 }
287
288 const arm_SymConst_attr_t *get_arm_SymConst_attr_const(const ir_node *node) {
289         assert(is_arm_SymConst(node));
290         return get_irn_generic_attr_const(node);
291 }
292
293 /* Returns the attributes of a CondJmp node. */
294 arm_CondJmp_attr_t *get_arm_CmpBra_attr(ir_node *node) {
295         assert(is_arm_CmpBra(node));
296         return get_irn_generic_attr(node);
297 }
298
299 const arm_CondJmp_attr_t *get_arm_CmpBra_attr_const(const ir_node *node) {
300         assert(is_arm_CmpBra(node));
301         return get_irn_generic_attr_const(node);
302 }
303
304 /* Returns the attributes of a SwitchJmp node. */
305 arm_SwitchJmp_attr_t *get_arm_SwitchJmp_attr(ir_node *node) {
306         assert(is_arm_SwitchJmp(node));
307         return get_irn_generic_attr(node);
308 }
309
310 const arm_SwitchJmp_attr_t *get_arm_SwitchJmp_attr_const(const ir_node *node) {
311         assert(is_arm_SwitchJmp(node));
312         return get_irn_generic_attr_const(node);
313 }
314
315 /**
316  * Returns the argument register requirements of a arm node.
317  */
318 const arch_register_req_t **get_arm_in_req_all(const ir_node *node) {
319         const arm_attr_t *attr = get_arm_attr_const(node);
320         return attr->in_req;
321 }
322
323 /**
324  * Returns the result register requirements of an arm node.
325  */
326 const arch_register_req_t **get_arm_out_req_all(const ir_node *node) {
327         const arm_attr_t *attr = get_arm_attr_const(node);
328         return attr->out_req;
329 }
330
331 /**
332  * Returns the argument register requirement at position pos of an arm node.
333  */
334 const arch_register_req_t *get_arm_in_req(const ir_node *node, int pos) {
335         const arm_attr_t *attr = get_arm_attr_const(node);
336         return attr->in_req[pos];
337 }
338
339 /**
340  * Returns the result register requirement at position pos of an arm node.
341  */
342 const arch_register_req_t *get_arm_out_req(const ir_node *node, int pos) {
343         const arm_attr_t *attr = get_arm_attr_const(node);
344         return attr->out_req[pos];
345 }
346
347 /**
348  * Sets the OUT register requirements at position pos.
349  */
350 void set_arm_req_out(ir_node *node, const arch_register_req_t *req, int pos) {
351         arm_attr_t *attr   = get_arm_attr(node);
352         attr->out_req[pos] = req;
353 }
354
355 /**
356  * Sets the complete OUT requirements of node.
357  */
358 void set_arm_req_out_all(ir_node *node, const arch_register_req_t **reqs) {
359         arm_attr_t *attr = get_arm_attr(node);
360         attr->out_req    = reqs;
361 }
362
363 /**
364  * Sets the IN register requirements at position pos.
365  */
366 void set_arm_req_in(ir_node *node, const arch_register_req_t *req, int pos) {
367         arm_attr_t *attr  = get_arm_attr(node);
368         attr->in_req[pos] = req;
369 }
370
371 /**
372  * Returns the register flag of an arm node.
373  */
374 arch_irn_flags_t get_arm_flags(const ir_node *node) {
375         const arm_attr_t *attr = get_arm_attr_const(node);
376         return attr->flags;
377 }
378
379 /**
380  * Sets the register flag of an arm node.
381  */
382 void set_arm_flags(ir_node *node, arch_irn_flags_t flags) {
383         arm_attr_t *attr = get_arm_attr(node);
384         attr->flags      = flags;
385 }
386
387 /**
388  * Returns the result register slots of an arm node.
389  */
390 const arch_register_t **get_arm_slots(const ir_node *node) {
391         const arm_attr_t *attr = get_arm_attr_const(node);
392         return attr->slots;
393 }
394
395 /**
396  * Returns the name of the OUT register at position pos.
397  */
398 const char *get_arm_out_reg_name(const ir_node *node, int pos) {
399         const arm_attr_t *attr = get_arm_attr_const(node);
400
401         assert(is_arm_irn(node) && "Not an arm node.");
402         assert(pos < ARR_LEN(attr->slots) && "Invalid OUT position.");
403         assert(attr->slots[pos]  && "No register assigned");
404
405         return arch_register_get_name(attr->slots[pos]);
406 }
407
408 /**
409  * Returns the index of the OUT register at position pos within its register class.
410  */
411 int get_arm_out_regnr(const ir_node *node, int pos) {
412         const arm_attr_t *attr = get_arm_attr_const(node);
413
414         assert(is_arm_irn(node) && "Not an arm node.");
415         assert(pos < ARR_LEN(attr->slots) && "Invalid OUT position.");
416         assert(attr->slots[pos]  && "No register assigned");
417
418         return arch_register_get_index(attr->slots[pos]);
419 }
420
421 /**
422  * Returns the OUT register at position pos.
423  */
424 const arch_register_t *get_arm_out_reg(const ir_node *node, int pos) {
425         const arm_attr_t *attr = get_arm_attr_const(node);
426
427         assert(is_arm_irn(node) && "Not an arm node.");
428         assert(pos < ARR_LEN(attr->slots) && "Invalid OUT position.");
429         assert(attr->slots[pos]  && "No register assigned");
430
431         return attr->slots[pos];
432 }
433
434 /**
435  * Sets the flags for the n'th out.
436  */
437 void set_arm_out_flags(ir_node *node, arch_irn_flags_t flags, int pos) {
438         arm_attr_t *attr = get_arm_attr(node);
439         assert(pos < ARR_LEN(attr->out_flags) && "Invalid OUT position.");
440         attr->out_flags[pos] = flags;
441 }
442
443 /**
444  * Gets the flags for the n'th out.
445  */
446 arch_irn_flags_t get_arm_out_flags(const ir_node *node, int pos) {
447         const arm_attr_t *attr = get_arm_attr_const(node);
448         assert(pos < ARR_LEN(attr->out_flags) && "Invalid OUT position.");
449         return attr->out_flags[pos];
450 }
451
452 /**
453  * Returns the number of results.
454  */
455 int get_arm_n_res(const ir_node *node) {
456         const arm_attr_t *attr = get_arm_attr_const(node);
457         return ARR_LEN(attr->slots);
458 }
459 /**
460  * Returns the tarvalue
461  */
462 tarval *get_arm_value(const ir_node *node) {
463         const arm_attr_t *attr = get_arm_attr_const(node);
464         return attr->value;
465 }
466
467 /**
468  * Sets the tarvalue
469  */
470 void set_arm_value(ir_node *node, tarval *tv) {
471         arm_attr_t *attr = get_arm_attr(node);
472         attr->value = tv;
473 }
474
475 /**
476  * Returns the proj num
477  */
478 int get_arm_CondJmp_proj_num(const ir_node *node) {
479         const arm_CondJmp_attr_t *attr = get_arm_CmpBra_attr_const(node);
480         return attr->proj_num;
481 }
482
483 /**
484  * Sets the proj num
485  */
486 void set_arm_CondJmp_proj_num(ir_node *node, int proj_num) {
487         arm_CondJmp_attr_t *attr = get_arm_CmpBra_attr(node);
488         attr->proj_num   = proj_num;
489 }
490
491 /**
492  * Returns the SymConst label
493  */
494 ident *get_arm_symconst_id(const ir_node *node) {
495         const arm_SymConst_attr_t *attr = get_arm_SymConst_attr_const(node);
496         return attr->symconst_id;
497 }
498
499 /**
500  * Sets the SymConst label
501  */
502 void set_arm_symconst_id(ir_node *node, ident *symconst_id) {
503         arm_SymConst_attr_t *attr = get_arm_SymConst_attr(node);
504         attr->symconst_id = symconst_id;
505 }
506
507 /**
508  * Returns the number of projs of a SwitchJmp.
509  */
510 int get_arm_SwitchJmp_n_projs(const ir_node *node) {
511         const arm_SwitchJmp_attr_t *attr = get_arm_SwitchJmp_attr_const(node);
512         return attr->n_projs;
513 }
514
515 /**
516  * Sets the number of projs.
517  */
518 void set_arm_SwitchJmp_n_projs(ir_node *node, int n_projs) {
519         arm_SwitchJmp_attr_t *attr = get_arm_SwitchJmp_attr(node);
520         attr->n_projs = n_projs;
521 }
522
523 /**
524  * Returns the default_proj_num.
525  */
526 long get_arm_SwitchJmp_default_proj_num(const ir_node *node) {
527         const arm_SwitchJmp_attr_t *attr = get_arm_SwitchJmp_attr_const(node);
528         return attr->default_proj_num;
529 }
530
531 /**
532  * Sets the default_proj_num.
533  */
534 void set_arm_SwitchJmp_default_proj_num(ir_node *node, long default_proj_num) {
535         arm_SwitchJmp_attr_t *attr = get_arm_SwitchJmp_attr(node);
536         attr->default_proj_num = default_proj_num;
537 }
538
539 /**
540  * Gets the shift modifier attribute.
541  */
542 arm_shift_modifier get_arm_shift_modifier(const ir_node *node) {
543         const arm_attr_t *attr = get_arm_attr_const(node);
544         return ARM_GET_SHF_MOD(attr);
545 }
546
547 /* Set the ARM machine node attributes to default values. */
548 static void init_arm_attributes(ir_node *node, int flags,
549                          const arch_register_req_t ** in_reqs,
550                                                  const arch_register_req_t ** out_reqs,
551                          const be_execution_unit_t ***execution_units,
552                                                  int n_res) {
553         ir_graph       *irg  = get_irn_irg(node);
554         struct obstack *obst = get_irg_obstack(irg);
555         arm_attr_t     *attr = get_arm_attr(node);
556         (void) execution_units;
557
558         attr->in_req           = in_reqs;
559         attr->out_req          = out_reqs;
560         attr->flags            = flags;
561         attr->instr_fl         = (ARM_COND_AL << 3) | ARM_SHF_NONE;
562         attr->value            = NULL;
563
564         attr->out_flags = NEW_ARR_D(int, obst, n_res);
565         memset(attr->out_flags, 0, n_res * sizeof(attr->out_flags[0]));
566
567         attr->slots = NEW_ARR_D(const arch_register_t*, obst, n_res);
568         memset(attr->slots, 0, n_res * sizeof(attr->slots[0]));
569 }
570
571 /************************************************
572  *   ___        _   _           _               *
573  *  / _ \ _ __ | |_(_)_ __ ___ (_)_______ _ __  *
574  * | | | | '_ \| __| | '_ ` _ \| |_  / _ \ '__| *
575  * | |_| | |_) | |_| | | | | | | |/ /  __/ |    *
576  *  \___/| .__/ \__|_|_| |_| |_|_/___\___|_|    *
577  *       |_|                                    *
578  ************************************************/
579
580 typedef struct _opt_tuple {
581         ir_op *op_imm_left;             /**< immediate is left */
582         ir_op *op_imm_right;    /**< immediate is right */
583         ir_op *op_shf_left;             /**< shift operand on left */
584         ir_op *op_shf_right;    /**< shift operand on right */
585 } opt_tuple;
586
587 //static const opt_tuple *opt_ops[iro_arm_last];
588
589 void arm_set_optimizers(void) {
590         /*
591 #define STD(op)         p_##op = { op_arm_##op##_i, op_arm_##op##_i, op_arm_##op, op_arm_##op }
592 #define LEFT(op)        p_##op = { op_arm_##op##_i, NULL, op_arm_##op, NULL }
593 #define SET(op)   opt_ops[iro_arm_##op] = &p_##op;
594
595         static const opt_tuple
596                 STD(Add),
597                 STD(And),
598                 STD(Or),
599                 STD(Eor),
600                 LEFT(Bic),
601                 LEFT(Shl),
602                 LEFT(Shr),
603                 LEFT(Shrs),
604                 p_Sub = { op_arm_Sub_i, op_arm_Rsb_i, op_arm_Sub, op_arm_Rsb },
605
606         memset(opt_ops, 0, sizeof(opt_ops));
607         SET(Add);
608         SET(And);
609         SET(Or);
610         SET(Eor);
611         SET(Sub);
612         SET(Bic);
613         SET(Shl);
614         SET(Shr);
615         SET(Shrs);
616         */
617 }
618
619 static int cmp_attr_arm_SymConst(ir_node *a, ir_node *b) {
620         const arm_SymConst_attr_t *attr_a = get_irn_generic_attr_const(a);
621         const arm_SymConst_attr_t *attr_b = get_irn_generic_attr_const(b);
622         return attr_a->symconst_id != attr_b->symconst_id;
623 }
624
625 static int cmp_attr_arm(ir_node *a, ir_node *b) {
626         arm_attr_t *attr_a = get_irn_generic_attr(a);
627         arm_attr_t *attr_b = get_irn_generic_attr(b);
628         return (attr_a->instr_fl != attr_b->instr_fl) || (attr_a->value != attr_b->value);
629 }
630
631 static int cmp_attr_arm_CondJmp(ir_node *a, ir_node *b) {
632         (void) a;
633         (void) b;
634         /* never identical */
635         return 1;
636 }
637
638 static int cmp_attr_arm_SwitchJmp(ir_node *a, ir_node *b) {
639         (void) a;
640         (void) b;
641         /* never identical */
642         return 1;
643 }
644
645 /** copies the ARM attributes of a node. */
646 static void arm_copy_attr(const ir_node *old_node, ir_node *new_node) {
647         ir_graph          *irg     = get_irn_irg(new_node);
648         struct obstack    *obst    = get_irg_obstack(irg);
649         const arm_attr_t *attr_old = get_arm_attr_const(old_node);
650         arm_attr_t       *attr_new = get_arm_attr(new_node);
651
652         /* copy the attributes */
653         memcpy(attr_new, attr_old, get_op_attr_size(get_irn_op(old_node)));
654
655         /* copy out flags */
656         attr_new->out_flags =
657                 DUP_ARR_D(int, obst, attr_old->out_flags);
658         /* copy register assignments */
659         attr_new->slots =
660                 DUP_ARR_D(arch_register_t*, obst, attr_old->slots);
661 }
662
663
664
665 /* Include the generated constructor functions */
666 #include "gen_arm_new_nodes.c.inl"