3 # This is the specification for the ia32 assembler Firm-operations
8 $normal = 0; # no special type
9 $caller_save = 1; # caller save (register must be saved by the caller of a function)
10 $callee_save = 2; # callee save (register must be saved by the called function)
11 $ignore = 4; # ignore (do not assign this register)
12 $arbitrary = 8; # emitter can choose an arbitrary register of this class
13 $virtual = 16; # the register is a virtual one
14 $state = 32; # register represents a state
15 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
18 { name => "edx", type => $caller_save },
19 { name => "ecx", type => $caller_save },
20 { name => "eax", type => $caller_save },
21 { name => "ebx", type => $callee_save },
22 { name => "esi", type => $callee_save },
23 { name => "edi", type => $callee_save },
24 { name => "ebp", type => $callee_save },
25 { name => "esp", type => $ignore },
26 { name => "gp_NOREG", type => $ignore | $arbitrary | $virtual }, # we need a dummy register for NoReg nodes
30 { name => "mm0", type => $ignore },
31 { name => "mm1", type => $ignore },
32 { name => "mm2", type => $ignore },
33 { name => "mm3", type => $ignore },
34 { name => "mm4", type => $ignore },
35 { name => "mm5", type => $ignore },
36 { name => "mm6", type => $ignore },
37 { name => "mm7", type => $ignore },
38 { mode => "mode_E", flags => "manual_ra" }
41 { name => "xmm0", type => $caller_save },
42 { name => "xmm1", type => $caller_save },
43 { name => "xmm2", type => $caller_save },
44 { name => "xmm3", type => $caller_save },
45 { name => "xmm4", type => $caller_save },
46 { name => "xmm5", type => $caller_save },
47 { name => "xmm6", type => $caller_save },
48 { name => "xmm7", type => $caller_save },
49 { name => "xmm_NOREG", type => $ignore | $virtual }, # we need a dummy register for NoReg nodes
53 { name => "vf0", type => $caller_save },
54 { name => "vf1", type => $caller_save },
55 { name => "vf2", type => $caller_save },
56 { name => "vf3", type => $caller_save },
57 { name => "vf4", type => $caller_save },
58 { name => "vf5", type => $caller_save },
59 { name => "vf6", type => $caller_save },
60 { name => "vf7", type => $caller_save },
61 { name => "vfp_NOREG", type => $ignore | $arbitrary | $virtual }, # we need a dummy register for NoReg nodes
65 { name => "st0", realname => "st", type => $ignore },
66 { name => "st1", realname => "st(1)", type => $ignore },
67 { name => "st2", realname => "st(2)", type => $ignore },
68 { name => "st3", realname => "st(3)", type => $ignore },
69 { name => "st4", realname => "st(4)", type => $ignore },
70 { name => "st5", realname => "st(5)", type => $ignore },
71 { name => "st6", realname => "st(6)", type => $ignore },
72 { name => "st7", realname => "st(7)", type => $ignore },
73 { mode => "mode_E", flags => "manual_ra" }
75 fp_cw => [ # the floating point control word
76 { name => "fpcw", type => $ignore | $state },
77 { mode => "ia32_mode_fpcw", flags => "manual_ra|state" }
80 { name => "eflags", type => 0 },
81 { mode => "mode_Iu", flags => "manual_ra" }
86 GP => [ 1, "GP_EAX", "GP_EBX", "GP_ECX", "GP_EDX", "GP_ESI", "GP_EDI", "GP_EBP" ],
87 SSE => [ 1, "SSE_XMM0", "SSE_XMM1", "SSE_XMM2", "SSE_XMM3", "SSE_XMM4", "SSE_XMM5", "SSE_XMM6", "SSE_XMM7" ],
88 VFP => [ 1, "VFP_VF0", "VFP_VF1", "VFP_VF2", "VFP_VF3", "VFP_VF4", "VFP_VF5", "VFP_VF6", "VFP_VF7" ],
89 BRANCH => [ 1, "BRANCH1", "BRANCH2" ],
94 bundels_per_cycle => 1
98 S0 => "${arch}_emit_source_register(node, 0);",
99 S1 => "${arch}_emit_source_register(node, 1);",
100 S2 => "${arch}_emit_source_register(node, 2);",
101 S3 => "${arch}_emit_source_register(node, 3);",
102 SB0 => "${arch}_emit_8bit_source_register_or_immediate(node, 0);",
103 SB1 => "${arch}_emit_8bit_source_register_or_immediate(node, 1);",
104 SB2 => "${arch}_emit_8bit_source_register_or_immediate(node, 2);",
105 SB3 => "${arch}_emit_8bit_source_register_or_immediate(node, 3);",
106 SH0 => "${arch}_emit_8bit_high_source_register(node, 0);",
107 SS0 => "${arch}_emit_16bit_source_register_or_immediate(node, 0);",
108 SI0 => "${arch}_emit_source_register_or_immediate(node, 0);",
109 SI1 => "${arch}_emit_source_register_or_immediate(node, 1);",
110 SI3 => "${arch}_emit_source_register_or_immediate(node, 3);",
111 D0 => "${arch}_emit_dest_register(node, 0);",
112 D1 => "${arch}_emit_dest_register(node, 1);",
113 DS0 => "${arch}_emit_dest_register_size(node, 0);",
114 DB0 => "${arch}_emit_8bit_dest_register(node, 0);",
115 X0 => "${arch}_emit_x87_register(node, 0);",
116 X1 => "${arch}_emit_x87_register(node, 1);",
117 EX => "${arch}_emit_extend_suffix(node);",
118 M => "${arch}_emit_mode_suffix(node);",
119 XM => "${arch}_emit_x87_mode_suffix(node);",
120 XXM => "${arch}_emit_xmm_mode_suffix(node);",
121 XSD => "${arch}_emit_xmm_mode_suffix_s(node);",
122 AM => "${arch}_emit_am(node);",
123 unop3 => "${arch}_emit_unop(node, n_ia32_unary_op);",
124 unop4 => "${arch}_emit_unop(node, n_ia32_binary_right);",
125 binop => "${arch}_emit_binop(node);",
126 x87_binop => "${arch}_emit_x87_binop(node);",
127 CMP3 => "${arch}_emit_cmp_suffix_node(node, 3);",
133 $default_op_attr_type = "ia32_op_attr_t";
134 $default_attr_type = "ia32_attr_t";
135 $default_copy_attr = "ia32_copy_attr";
137 sub ia32_custom_init_attr {
143 if(defined($node->{modified_flags})) {
144 $res .= "\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n";
146 if(defined($node->{am})) {
147 my $am = $node->{am};
148 if($am eq "source,unary") {
149 $res .= "\tset_ia32_am_support(res, ia32_am_unary);";
150 } elsif($am eq "source,binary") {
151 $res .= "\tset_ia32_am_support(res, ia32_am_binary);";
152 } elsif($am eq "none") {
155 die("Invalid address mode '$am' specified on op $name");
158 if($node->{state} ne "exc_pinned"
159 and $node->{state} ne "pinned") {
160 die("AM nodes must have pinned or AM pinned state ($name)");
166 $custom_init_attr_func = \&ia32_custom_init_attr;
170 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
171 "\tinit_ia32_x87_attributes(res);".
172 "\tinit_ia32_asm_attributes(res);",
174 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);",
176 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
177 "\tinit_ia32_call_attributes(res, pop, call_tp);",
178 ia32_condcode_attr_t =>
179 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
180 "\tinit_ia32_condcode_attributes(res, condition_code);",
181 ia32_switch_attr_t =>
182 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
183 "\tinit_ia32_switch_attributes(res, default_pn);",
185 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
186 "\tinit_ia32_copyb_attributes(res, size);",
187 ia32_immediate_attr_t =>
188 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
189 "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, no_pic_adjust, offset);",
191 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
192 "\tinit_ia32_x87_attributes(res);",
193 ia32_climbframe_attr_t =>
194 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
195 "\tinit_ia32_climbframe_attributes(res, count);",
199 ia32_asm_attr_t => "ia32_compare_asm_attr",
200 ia32_attr_t => "ia32_compare_nodes_attr",
201 ia32_call_attr_t => "ia32_compare_call_attr",
202 ia32_condcode_attr_t => "ia32_compare_condcode_attr",
203 ia32_switch_attr_t => "ia32_compare_switch_attr",
204 ia32_copyb_attr_t => "ia32_compare_copyb_attr",
205 ia32_immediate_attr_t => "ia32_compare_immediate_attr",
206 ia32_x87_attr_t => "ia32_compare_x87_attr",
207 ia32_climbframe_attr_t => "ia32_compare_climbframe_attr",
213 $mode_xmm = "mode_E";
214 $mode_gp = "mode_Iu";
215 $mode_flags = "mode_Iu";
216 $mode_fpcw = "ia32_mode_fpcw";
217 $status_flags = [ "CF", "PF", "AF", "ZF", "SF", "OF" ];
218 $status_flags_wo_cf = [ "PF", "AF", "ZF", "SF", "OF" ];
219 $fpcw_flags = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
220 "FP_PC0", "FP_PC1", "FP_RC0", "FP_RC1", "FP_X" ];
226 op_flags => [ "constlike" ],
227 irn_flags => [ "not_scheduled" ],
228 reg_req => { out => [ "gp_NOREG:I" ] },
229 attr => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
230 attr_type => "ia32_immediate_attr_t",
231 hash_func => "ia32_hash_Immediate",
239 out_arity => "variable",
240 attr_type => "ia32_asm_attr_t",
241 attr => "ident *asm_text, const ia32_asm_reg_t *register_map",
242 init_attr => "attr->asm_text = asm_text;\n".
243 "\tattr->register_map = register_map;\n",
245 modified_flags => $status_flags,
248 # "allocates" a free register
250 op_flags => [ "constlike", "cse_neutral" ],
251 irn_flags => [ "rematerializable" ],
252 reg_req => { out => [ "gp" ] },
257 cmp_attr => "return 1;",
261 irn_flags => [ "rematerializable" ],
262 state => "exc_pinned",
263 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
264 out => [ "in_r4 in_r5", "flags", "none" ] },
265 ins => [ "base", "index", "mem", "left", "right" ],
266 outs => [ "res", "flags", "M" ],
267 emit => '. add%M %binop',
268 am => "source,binary",
272 modified_flags => $status_flags
276 irn_flags => [ "rematerializable" ],
277 state => "exc_pinned",
278 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
279 ins => [ "base", "index", "mem", "val" ],
280 emit => ". add%M %SI3, %AM",
284 modified_flags => $status_flags
288 irn_flags => [ "rematerializable" ],
289 state => "exc_pinned",
290 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
291 ins => [ "base", "index", "mem", "val" ],
292 emit => ". add%M %SB3, %AM",
296 modified_flags => $status_flags
300 state => "exc_pinned",
301 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "flags" ],
302 out => [ "in_r4 in_r5", "flags", "none" ] },
303 ins => [ "base", "index", "mem", "left", "right", "eflags" ],
304 outs => [ "res", "flags", "M" ],
305 emit => '. adc%M %binop',
306 am => "source,binary",
310 modified_flags => $status_flags
314 op_flags => [ "constlike" ],
315 reg_req => { in => [ "none", "none" ], out => [ "none" ] },
316 ins => [ "left", "right" ],
320 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
321 ins => [ "left", "right", "eflags" ],
325 # we should not rematrialize this node. It produces 2 results and has
326 # very strict constraints
327 state => "exc_pinned",
328 reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
329 out => [ "eax", "flags", "none", "edx" ] },
330 ins => [ "base", "index", "mem", "left", "right" ],
331 emit => '. mul%M %unop4',
332 outs => [ "res_low", "flags", "M", "res_high" ],
333 am => "source,binary",
336 modified_flags => $status_flags
340 # we should not rematrialize this node. It produces 2 results and has
341 # very strict constraints
342 op_flags => [ "constlike" ],
343 cmp_attr => "return 1;",
344 reg_req => { in => [ "none", "none" ],
345 out => [ "none", "none", "none", "none" ] },
346 ins => [ "left", "right" ],
347 outs => [ "res_low", "flags", "M", "res_high" ],
351 irn_flags => [ "rematerializable" ],
352 state => "exc_pinned",
353 # TODO: adjust out requirements for the 3 operand form
354 # (no need for should_be_same then)
355 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
356 out => [ "in_r4 in_r5", "flags", "none" ] },
357 ins => [ "base", "index", "mem", "left", "right" ],
358 outs => [ "res", "flags", "M" ],
359 am => "source,binary",
363 modified_flags => $status_flags
367 irn_flags => [ "rematerializable" ],
368 state => "exc_pinned",
369 reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
370 out => [ "eax", "flags", "none", "edx" ] },
371 ins => [ "base", "index", "mem", "left", "right" ],
372 emit => '. imul%M %unop4',
373 outs => [ "res_low", "flags", "M", "res_high" ],
374 am => "source,binary",
377 modified_flags => $status_flags
381 op_flags => [ "constlike" ],
382 cmp_attr => "return 1;",
383 reg_req => { in => [ "none", "none" ],
384 out => [ "none", "none", "none", "none" ] },
385 ins => [ "left", "right" ],
386 outs => [ "res_low", "flags", "M", "res_high" ],
390 irn_flags => [ "rematerializable" ],
391 state => "exc_pinned",
392 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
393 out => [ "in_r4 in_r5", "flags", "none" ] },
394 ins => [ "base", "index", "mem", "left", "right" ],
395 outs => [ "res", "flags", "M" ],
396 am => "source,binary",
397 emit => '. and%M %binop',
401 modified_flags => $status_flags
405 irn_flags => [ "rematerializable" ],
406 state => "exc_pinned",
407 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
408 ins => [ "base", "index", "mem", "val" ],
409 emit => '. and%M %SI3, %AM',
413 modified_flags => $status_flags
417 irn_flags => [ "rematerializable" ],
418 state => "exc_pinned",
419 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
420 ins => [ "base", "index", "mem", "val" ],
421 emit => '. and%M %SB3, %AM',
425 modified_flags => $status_flags
429 irn_flags => [ "rematerializable" ],
430 state => "exc_pinned",
431 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
432 out => [ "in_r4 in_r5", "flags", "none" ] },
433 ins => [ "base", "index", "mem", "left", "right" ],
434 outs => [ "res", "flags", "M" ],
435 am => "source,binary",
436 emit => '. or%M %binop',
440 modified_flags => $status_flags
444 irn_flags => [ "rematerializable" ],
445 state => "exc_pinned",
446 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
447 ins => [ "base", "index", "mem", "val" ],
448 emit => '. or%M %SI3, %AM',
452 modified_flags => $status_flags
456 irn_flags => [ "rematerializable" ],
457 state => "exc_pinned",
458 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
459 ins => [ "base", "index", "mem", "val" ],
460 emit => '. or%M %SB3, %AM',
464 modified_flags => $status_flags
468 irn_flags => [ "rematerializable" ],
469 state => "exc_pinned",
470 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
471 out => [ "in_r4 in_r5", "flags", "none" ] },
472 ins => [ "base", "index", "mem", "left", "right" ],
473 outs => [ "res", "flags", "M" ],
474 am => "source,binary",
475 emit => '. xor%M %binop',
479 modified_flags => $status_flags
483 op_flags => [ "constlike" ],
484 irn_flags => [ "rematerializable" ],
485 reg_req => { out => [ "gp", "flags" ] },
486 outs => [ "res", "flags" ],
487 emit => ". xor%M %D0, %D0",
491 modified_flags => $status_flags
495 irn_flags => [ "rematerializable" ],
496 state => "exc_pinned",
497 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
498 ins => [ "base", "index", "mem", "val" ],
499 emit => '. xor%M %SI3, %AM',
503 modified_flags => $status_flags
507 irn_flags => [ "rematerializable" ],
508 state => "exc_pinned",
509 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
510 ins => [ "base", "index", "mem", "val" ],
511 emit => '. xor%M %SB3, %AM',
515 modified_flags => $status_flags
519 irn_flags => [ "rematerializable" ],
520 state => "exc_pinned",
521 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
522 out => [ "in_r4", "flags", "none" ] },
523 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
524 outs => [ "res", "flags", "M" ],
525 am => "source,binary",
526 emit => '. sub%M %binop',
530 modified_flags => $status_flags
534 irn_flags => [ "rematerializable" ],
535 state => "exc_pinned",
536 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
537 ins => [ "base", "index", "mem", "subtrahend" ],
538 emit => '. sub%M %SI3, %AM',
542 modified_flags => $status_flags
546 irn_flags => [ "rematerializable" ],
547 state => "exc_pinned",
548 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
549 ins => [ "base", "index", "mem", "subtrahend" ],
550 emit => '. sub%M %SB3, %AM',
554 modified_flags => $status_flags
558 state => "exc_pinned",
559 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "flags" ],
560 out => [ "in_r4 !in_r5", "flags", "none" ] },
561 ins => [ "base", "index", "mem", "minuend", "subtrahend", "eflags" ],
562 outs => [ "res", "flags", "M" ],
563 am => "source,binary",
564 emit => '. sbb%M %binop',
568 modified_flags => $status_flags
572 # Spiller currently fails when rematerializing flag consumers
573 # irn_flags => [ "rematerializable" ],
574 reg_req => { in => [ "flags" ], out => [ "gp", "flags" ] },
575 outs => [ "res", "flags" ],
576 emit => ". sbb%M %D0, %D0",
580 modified_flags => $status_flags
584 reg_req => { in => [ "none", "none" ], out => [ "none" ] },
585 ins => [ "minuend", "subtrahend" ],
589 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
590 ins => [ "minuend", "subtrahend", "eflags" ],
594 op_flags => [ "fragile", "labeled" ],
595 state => "exc_pinned",
596 reg_req => { in => [ "gp", "gp", "none", "gp", "eax", "edx" ],
597 out => [ "eax", "flags", "none", "edx", "none", "none" ] },
598 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
599 outs => [ "div_res", "flags", "M", "mod_res", "X_regular", "X_except" ],
600 am => "source,unary",
601 emit => ". idiv%M %unop3",
604 modified_flags => $status_flags
608 op_flags => [ "fragile", "labeled" ],
609 state => "exc_pinned",
610 reg_req => { in => [ "gp", "gp", "none", "gp", "eax", "edx" ],
611 out => [ "eax", "flags", "none", "edx", "none", "none" ] },
612 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
613 outs => [ "div_res", "flags", "M", "mod_res", "X_regular", "X_except" ],
614 am => "source,unary",
615 emit => ". div%M %unop3",
618 modified_flags => $status_flags
622 irn_flags => [ "rematerializable" ],
623 reg_req => { in => [ "gp", "ecx" ],
624 out => [ "in_r1 !in_r2", "flags" ] },
625 ins => [ "val", "count" ],
626 outs => [ "res", "flags" ],
627 emit => '. shl%M %SB1, %S0',
631 modified_flags => $status_flags
635 irn_flags => [ "rematerializable" ],
636 state => "exc_pinned",
637 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
638 ins => [ "base", "index", "mem", "count" ],
639 emit => '. shl%M %SB3, %AM',
643 modified_flags => $status_flags
647 irn_flags => [ "rematerializable" ],
648 reg_req => { in => [ "gp", "gp", "ecx" ],
649 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
650 ins => [ "val_high", "val_low", "count" ],
651 outs => [ "res", "flags" ],
652 emit => ". shld%M %SB2, %S1, %D0",
656 modified_flags => $status_flags
660 irn_flags => [ "rematerializable" ],
661 reg_req => { in => [ "gp", "ecx" ],
662 out => [ "in_r1 !in_r2", "flags" ] },
663 ins => [ "val", "count" ],
664 outs => [ "res", "flags" ],
665 emit => '. shr%M %SB1, %S0',
669 modified_flags => $status_flags
673 irn_flags => [ "rematerializable" ],
674 state => "exc_pinned",
675 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
676 ins => [ "base", "index", "mem", "count" ],
677 emit => '. shr%M %SB3, %AM',
681 modified_flags => $status_flags
685 irn_flags => [ "rematerializable" ],
686 reg_req => { in => [ "gp", "gp", "ecx" ],
687 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
688 ins => [ "val_high", "val_low", "count" ],
689 outs => [ "res", "flags" ],
690 emit => ". shrd%M %SB2, %S1, %D0",
694 modified_flags => $status_flags
698 irn_flags => [ "rematerializable" ],
699 reg_req => { in => [ "gp", "ecx" ],
700 out => [ "in_r1 !in_r2", "flags" ] },
701 ins => [ "val", "count" ],
702 outs => [ "res", "flags" ],
703 emit => '. sar%M %SB1, %S0',
707 modified_flags => $status_flags
711 irn_flags => [ "rematerializable" ],
712 state => "exc_pinned",
713 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
714 ins => [ "base", "index", "mem", "count" ],
715 emit => '. sar%M %SB3, %AM',
719 modified_flags => $status_flags
723 irn_flags => [ "rematerializable" ],
724 reg_req => { in => [ "gp", "ecx" ],
725 out => [ "in_r1 !in_r2", "flags" ] },
726 ins => [ "val", "count" ],
727 outs => [ "res", "flags" ],
728 emit => '. ror%M %SB1, %S0',
732 modified_flags => $status_flags
736 irn_flags => [ "rematerializable" ],
737 state => "exc_pinned",
738 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
739 ins => [ "base", "index", "mem", "count" ],
740 emit => '. ror%M %SB3, %AM',
744 modified_flags => $status_flags
748 irn_flags => [ "rematerializable" ],
749 reg_req => { in => [ "gp", "ecx" ],
750 out => [ "in_r1 !in_r2", "flags" ] },
751 ins => [ "val", "count" ],
752 outs => [ "res", "flags" ],
753 emit => '. rol%M %SB1, %S0',
757 modified_flags => $status_flags
761 irn_flags => [ "rematerializable" ],
762 state => "exc_pinned",
763 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
764 ins => [ "base", "index", "mem", "count" ],
765 emit => '. rol%M %SB3, %AM',
769 modified_flags => $status_flags
773 irn_flags => [ "rematerializable" ],
774 reg_req => { in => [ "gp" ],
775 out => [ "in_r1", "flags" ] },
776 emit => '. neg%M %S0',
778 outs => [ "res", "flags" ],
782 modified_flags => $status_flags
786 irn_flags => [ "rematerializable" ],
787 state => "exc_pinned",
788 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
789 ins => [ "base", "index", "mem" ],
790 emit => '. neg%M %AM',
794 modified_flags => $status_flags
798 irn_flags => [ "rematerializable" ],
799 reg_req => { in => [ "gp", "gp" ], out => [ "in_r1", "in_r2" ] },
800 outs => [ "low_res", "high_res" ],
803 modified_flags => $status_flags
808 irn_flags => [ "rematerializable" ],
809 reg_req => { in => [ "gp" ],
810 out => [ "in_r1", "flags" ] },
812 outs => [ "res", "flags" ],
813 emit => '. inc%M %S0',
817 modified_flags => $status_flags_wo_cf
821 irn_flags => [ "rematerializable" ],
822 state => "exc_pinned",
823 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
824 ins => [ "base", "index", "mem" ],
825 emit => '. inc%M %AM',
829 modified_flags => $status_flags_wo_cf
833 irn_flags => [ "rematerializable" ],
834 reg_req => { in => [ "gp" ],
835 out => [ "in_r1", "flags" ] },
837 outs => [ "res", "flags" ],
838 emit => '. dec%M %S0',
842 modified_flags => $status_flags_wo_cf
846 irn_flags => [ "rematerializable" ],
847 state => "exc_pinned",
848 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
849 ins => [ "base", "index", "mem" ],
850 emit => '. dec%M %AM',
854 modified_flags => $status_flags_wo_cf
858 irn_flags => [ "rematerializable" ],
859 reg_req => { in => [ "gp" ],
860 out => [ "in_r1" ] },
863 emit => '. not%M %S0',
871 irn_flags => [ "rematerializable" ],
872 state => "exc_pinned",
873 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
874 ins => [ "base", "index", "mem" ],
875 emit => '. not%M %AM',
883 reg_req => { in => [ "flags" ], out => [ "flags" ] },
888 modified_flags => $status_flags
892 reg_req => { out => [ "flags" ] },
897 modified_flags => $status_flags
901 irn_flags => [ "rematerializable" ],
902 state => "exc_pinned",
903 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
904 out => [ "flags", "none", "none" ] },
905 ins => [ "base", "index", "mem", "left", "right" ],
906 outs => [ "eflags", "unused", "M" ],
907 am => "source,binary",
908 emit => '. cmp%M %binop',
909 attr => "bool ins_permuted",
910 init_attr => "attr->data.ins_permuted = ins_permuted;",
914 modified_flags => $status_flags
918 irn_flags => [ "rematerializable" ],
919 state => "exc_pinned",
920 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
921 out => [ "flags", "none", "none" ] },
922 ins => [ "base", "index", "mem", "left", "right" ],
923 outs => [ "eflags", "unused", "M" ],
924 am => "source,binary",
925 emit => '. cmpb %binop',
926 attr => "bool ins_permuted",
927 init_attr => "attr->data.ins_permuted = ins_permuted;",
931 modified_flags => $status_flags
935 irn_flags => [ "rematerializable" ],
936 state => "exc_pinned",
937 reg_req => { in => [ "eax ebx ecx edx" ],
938 out => [ "in_r1", "flags" ] },
939 emit => '. xorb %SH0, %SB0',
941 outs => [ "res", "flags" ],
945 modified_flags => $status_flags,
949 irn_flags => [ "rematerializable" ],
950 state => "exc_pinned",
951 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ] ,
952 out => [ "flags", "none", "none" ] },
953 ins => [ "base", "index", "mem", "left", "right" ],
954 outs => [ "eflags", "unused", "M" ],
955 am => "source,binary",
956 emit => '. test%M %binop',
957 attr => "bool ins_permuted",
958 init_attr => "attr->data.ins_permuted = ins_permuted;",
962 modified_flags => $status_flags
966 irn_flags => [ "rematerializable" ],
967 state => "exc_pinned",
968 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
969 out => [ "flags", "none", "none" ] },
970 ins => [ "base", "index", "mem", "left", "right" ],
971 outs => [ "eflags", "unused", "M" ],
972 am => "source,binary",
973 emit => '. testb %binop',
974 attr => "bool ins_permuted",
975 init_attr => "attr->data.ins_permuted = ins_permuted;",
979 modified_flags => $status_flags
983 #irn_flags => [ "rematerializable" ],
984 reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] },
987 attr_type => "ia32_condcode_attr_t",
988 attr => "ia32_condition_code_t condition_code",
989 # The way we handle Setcc with float nodes (potentially) destroys the flags
990 # (when we emit the setX; setp; orb and the setX;setnp;andb sequences)
991 init_attr => "set_ia32_ls_mode(res, mode_Bu);\n"
992 . "\tif (condition_code & ia32_cc_additional_float_cases) {\n"
993 . "\t\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n"
994 . "\t\t/* attr->latency = 3; */\n"
1002 #irn_flags => [ "rematerializable" ],
1003 state => "exc_pinned",
1004 reg_req => { in => [ "gp", "gp", "none", "eflags" ], out => [ "none" ] },
1005 ins => [ "base", "index", "mem","eflags" ],
1006 attr_type => "ia32_condcode_attr_t",
1007 attr => "ia32_condition_code_t condition_code",
1008 init_attr => "set_ia32_ls_mode(res, mode_Bu);\n",
1009 emit => '. set%CMP3 %AM',
1016 #irn_flags => [ "rematerializable" ],
1017 state => "exc_pinned",
1018 # (note: leave the false,true order intact to make it compatible with other
1020 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "eflags" ],
1021 out => [ "in_r4 in_r5", "flags", "none" ] },
1022 ins => [ "base", "index", "mem", "val_false", "val_true", "eflags" ],
1023 outs => [ "res", "flags", "M" ],
1024 am => "source,binary",
1025 attr_type => "ia32_condcode_attr_t",
1026 attr => "ia32_condition_code_t condition_code",
1034 op_flags => [ "labeled", "cfopcode", "forking" ],
1035 reg_req => { in => [ "eflags" ], out => [ "none", "none" ] },
1036 ins => [ "eflags" ],
1037 outs => [ "false", "true" ],
1038 attr_type => "ia32_condcode_attr_t",
1039 attr => "ia32_condition_code_t condition_code",
1041 units => [ "BRANCH" ],
1046 op_flags => [ "labeled", "cfopcode", "forking" ],
1047 reg_req => { in => [ "gp" ] },
1049 attr_type => "ia32_switch_attr_t",
1050 attr => "long default_pn",
1052 units => [ "BRANCH" ],
1053 modified_flags => $status_flags,
1054 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1059 irn_flags => [ "simple_jump" ],
1060 op_flags => [ "cfopcode" ],
1061 reg_req => { out => [ "none" ] },
1063 units => [ "BRANCH" ],
1069 op_flags => [ "cfopcode", "unknown_jump" ],
1070 reg_req => { in => [ "gp", "gp", "none", "gp" ] },
1071 ins => [ "base", "index", "mem", "target" ],
1072 am => "source,unary",
1073 emit => '. jmp *%unop3',
1075 units => [ "BRANCH" ],
1077 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1081 op_flags => [ "constlike" ],
1082 irn_flags => [ "rematerializable" ],
1083 reg_req => { out => [ "gp" ] },
1085 attr => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
1086 attr_type => "ia32_immediate_attr_t",
1092 op_flags => [ "constlike" ],
1093 irn_flags => [ "rematerializable" ],
1094 reg_req => { out => [ "gp" ] },
1101 op_flags => [ "constlike" ],
1102 reg_req => { out => [ "gp" ] },
1106 modified_flags => $status_flags,
1111 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1112 irn_flags => [ "not_scheduled" ],
1113 reg_req => { out => [ "gp_NOREG:I" ] },
1122 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1123 irn_flags => [ "not_scheduled" ],
1124 reg_req => { out => [ "vfp_NOREG:I" ] },
1129 attr_type => "ia32_x87_attr_t",
1134 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1135 irn_flags => [ "not_scheduled" ],
1136 reg_req => { out => [ "xmm_NOREG:I" ] },
1145 op_flags => [ "constlike" ],
1146 irn_flags => [ "not_scheduled" ],
1147 reg_req => { out => [ "fpcw:I" ] },
1151 modified_flags => $fpcw_flags
1155 op_flags => [ "labeled" ],
1157 reg_req => { in => [ "gp", "gp", "none" ], out => [ "fpcw:I" ] },
1158 ins => [ "base", "index", "mem" ],
1160 emit => ". fldcw %AM",
1163 modified_flags => $fpcw_flags
1167 op_flags => [ "labeled" ],
1169 reg_req => { in => [ "gp", "gp", "none", "fp_cw" ], out => [ "none" ] },
1170 ins => [ "base", "index", "mem", "fpcw" ],
1172 emit => ". fnstcw %AM",
1178 op_flags => [ "labeled" ],
1180 reg_req => { in => [ "fp_cw" ], out => [ "none" ] },
1188 # we should not rematrialize this node. It has very strict constraints.
1189 reg_req => { in => [ "eax", "edx" ], out => [ "edx" ] },
1190 ins => [ "val", "clobbered" ],
1199 # Note that we add additional latency values depending on address mode, so a
1200 # lateny of 0 for load is correct
1203 op_flags => [ "fragile", "labeled" ],
1204 state => "exc_pinned",
1205 reg_req => { in => [ "gp", "gp", "none" ],
1206 out => [ "gp", "none", "none", "none", "none" ] },
1207 ins => [ "base", "index", "mem" ],
1208 outs => [ "res", "unused", "M", "X_regular", "X_except" ],
1210 emit => ". mov%EX%.l %AM, %D0",
1215 op_flags => [ "fragile", "labeled" ],
1216 state => "exc_pinned",
1217 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1218 out => [ "none", "none", "none" ] },
1219 ins => [ "base", "index", "mem", "val" ],
1220 outs => [ "M", "X_regular", "X_except" ],
1221 emit => '. mov%M %SI3, %AM',
1228 op_flags => [ "fragile", "labeled" ],
1229 state => "exc_pinned",
1230 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ],
1231 out => ["none", "none", "none" ] },
1232 ins => [ "base", "index", "mem", "val" ],
1233 outs => [ "M", "X_regular", "X_except" ],
1234 emit => '. mov%M %SB3, %AM',
1241 irn_flags => [ "rematerializable" ],
1242 reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
1243 ins => [ "base", "index" ],
1244 emit => '. leal %AM, %D0',
1248 # lea doesn't modify the flags, but setting this seems advantageous since it
1249 # increases chances that the Lea is transformed back to an Add
1250 modified_flags => 1,
1254 state => "exc_pinned",
1255 reg_req => { in => [ "gp", "gp", "none", "gp", "esp" ], out => [ "esp:I|S", "none" ] },
1256 ins => [ "base", "index", "mem", "val", "stack" ],
1257 emit => '. push%M %unop3',
1258 outs => [ "stack", "M" ],
1259 am => "source,unary",
1265 state => "exc_pinned",
1266 reg_req => { in => [ "esp" ], out => [ "esp:I|S" ] },
1268 outs => [ "stack" ],
1269 emit => '. pushl %%eax',
1276 state => "exc_pinned",
1277 reg_req => { in => [ "none", "esp" ], out => [ "gp", "none", "none", "esp:I|S" ] },
1278 ins => [ "mem", "stack" ],
1279 outs => [ "res", "M", "unused", "stack" ],
1280 emit => '. pop%M %D0',
1281 latency => 3, # Pop is more expensive than Push on Athlon
1286 state => "exc_pinned",
1287 reg_req => { in => [ "none", "esp" ], out => [ "ebp:I", "none", "none", "esp:I|S" ] },
1288 ins => [ "mem", "stack" ],
1289 outs => [ "res", "M", "unused", "stack" ],
1290 emit => '. pop%M %D0',
1291 latency => 3, # Pop is more expensive than Push on Athlon
1296 state => "exc_pinned",
1297 reg_req => { in => [ "ebp" ], out => [ "esp:I|S" ] },
1300 emit => '. movl %S0, %D0',
1307 state => "exc_pinned",
1308 reg_req => { in => [ "gp", "gp", "none", "esp" ], out => [ "none", "none", "none", "esp:I|S" ] },
1309 ins => [ "base", "index", "mem", "stack" ],
1310 outs => [ "unused0", "M", "unused1", "stack" ],
1311 emit => '. pop%M %AM',
1312 latency => 3, # Pop is more expensive than Push on Athlon
1317 reg_req => { in => [ "esp" ], out => [ "ebp", "esp:I|S", "none" ] },
1319 outs => [ "frame", "stack", "M" ],
1325 reg_req => { in => [ "ebp" ], out => [ "ebp:I", "esp:I|S" ] },
1327 outs => [ "frame", "stack" ],
1330 state => "exc_pinned",
1335 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "none" ] },
1336 ins => [ "base", "index", "mem", "stack", "size" ],
1337 am => "source,binary",
1338 emit => '. addl %binop',
1340 outs => [ "stack", "M" ],
1342 modified_flags => $status_flags
1347 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "gp", "none" ] },
1348 ins => [ "base", "index", "mem", "stack", "size" ],
1349 am => "source,binary",
1350 emit => ". subl %binop\n".
1351 ". movl %%esp, %D1",
1353 outs => [ "stack", "addr", "M" ],
1355 modified_flags => $status_flags
1359 op_flags => [ "keep" ],
1367 irn_flags => [ "rematerializable" ],
1368 reg_req => { out => [ "gp" ] },
1370 emit => ". movl %%gs:0, %D0",
1376 # BT supports source address mode, but this is unused yet
1379 irn_flags => [ "rematerializable" ],
1380 state => "exc_pinned",
1381 reg_req => { in => [ "gp", "gp" ], out => [ "flags" ] },
1382 ins => [ "left", "right" ],
1383 emit => '. bt%M %S1, %S0',
1386 mode => $mode_flags,
1387 modified_flags => $status_flags # only CF is set, but the other flags are undefined
1391 irn_flags => [ "rematerializable" ],
1392 state => "exc_pinned",
1393 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1394 out => [ "gp", "flags", "none" ] },
1395 ins => [ "base", "index", "mem", "operand" ],
1396 outs => [ "res", "flags", "M" ],
1397 am => "source,binary",
1398 emit => '. bsf%M %unop3, %D0',
1402 modified_flags => $status_flags
1406 irn_flags => [ "rematerializable" ],
1407 state => "exc_pinned",
1408 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1409 out => [ "gp", "flags", "none" ] },
1410 ins => [ "base", "index", "mem", "operand" ],
1411 outs => [ "res", "flags", "M" ],
1412 am => "source,binary",
1413 emit => '. bsr%M %unop3, %D0',
1417 modified_flags => $status_flags
1421 # SSE4.2 or SSE4a popcnt instruction
1424 irn_flags => [ "rematerializable" ],
1425 state => "exc_pinned",
1426 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1427 out => [ "gp", "flags", "none" ] },
1428 ins => [ "base", "index", "mem", "operand" ],
1429 outs => [ "res", "flags", "M" ],
1430 am => "source,binary",
1431 emit => '. popcnt%M %unop3, %D0',
1435 modified_flags => $status_flags
1439 state => "exc_pinned",
1441 in => [ "gp", "gp", "none", "gp", "esp", "fpcw", "eax", "ecx", "edx" ],
1442 out => [ "esp:I|S", "fpcw:I", "none", "eax", "ecx", "edx", "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" ]
1444 ins => [ "base", "index", "mem", "addr", "stack", "fpcw", "eax", "ecx", "edx" ],
1445 outs => [ "stack", "fpcw", "M", "eax", "ecx", "edx", "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" ],
1446 attr_type => "ia32_call_attr_t",
1447 attr => "unsigned pop, ir_type *call_tp",
1448 am => "source,unary",
1449 units => [ "BRANCH" ],
1450 latency => 4, # random number
1451 modified_flags => $status_flags
1455 # a Helper node for frame-climbing, needed for __builtin_(frame|return)_address
1457 # PS: try gcc __builtin_frame_address(100000) :-)
1460 reg_req => { in => [ "gp", "gp", "gp"], out => [ "in_r3" ] },
1461 ins => [ "frame", "cnt", "tmp" ],
1463 latency => 4, # random number
1464 attr_type => "ia32_climbframe_attr_t",
1465 attr => "unsigned count",
1474 irn_flags => [ "rematerializable" ],
1475 reg_req => { in => [ "gp" ],
1476 out => [ "in_r1" ] },
1477 emit => '. bswap%M %S0',
1485 # bswap16, use xchg here
1488 irn_flags => [ "rematerializable" ],
1489 reg_req => { in => [ "eax ebx ecx edx" ],
1490 out => [ "in_r1" ] },
1491 emit => '. xchg %SB0, %SH0',
1503 reg_req => { in => [ "none" ], out => [ "none" ] },
1512 # Undefined Instruction on ALL x86 CPU's
1516 reg_req => { in => [ "none" ], out => [ "none" ] },
1519 emit => ". .value 0x0b0f",
1528 irn_flags => [ "rematerializable" ],
1530 reg_req => { in => [ "edx", "eax", "none" ], out => [ "none" ] },
1531 ins => [ "port", "value", "mem" ],
1532 emit => '. out%M %SS0, %SI1',
1536 modified_flags => $status_flags
1543 irn_flags => [ "rematerializable" ],
1545 reg_req => { in => [ "edx", "none" ], out => [ "eax", "none" ] },
1546 ins => [ "port", "mem" ],
1547 outs => [ "res", "M" ],
1548 emit => '. in%M %DS0, %SS0',
1552 modified_flags => $status_flags
1556 # Intel style prefetching
1559 op_flags => [ "labeled" ],
1560 state => "exc_pinned",
1561 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1562 ins => [ "base", "index", "mem" ],
1565 emit => ". prefetcht0 %AM",
1570 op_flags => [ "labeled" ],
1571 state => "exc_pinned",
1572 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1573 ins => [ "base", "index", "mem" ],
1576 emit => ". prefetcht1 %AM",
1581 op_flags => [ "labeled" ],
1582 state => "exc_pinned",
1583 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1584 ins => [ "base", "index", "mem" ],
1587 emit => ". prefetcht2 %AM",
1592 op_flags => [ "labeled" ],
1593 state => "exc_pinned",
1594 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1595 ins => [ "base", "index", "mem" ],
1598 emit => ". prefetchnta %AM",
1603 # 3DNow! prefetch instructions
1606 op_flags => [ "labeled" ],
1607 state => "exc_pinned",
1608 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1609 ins => [ "base", "index", "mem" ],
1612 emit => ". prefetch %AM",
1617 op_flags => [ "labeled" ],
1618 state => "exc_pinned",
1619 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1620 ins => [ "base", "index", "mem" ],
1623 emit => ". prefetchw %AM",
1629 irn_flags => [ "rematerializable" ],
1630 reg_req => { out => [ "xmm" ] },
1631 emit => '. xorp%XSD %D0, %D0',
1638 op_flags => [ "constlike" ],
1639 irn_flags => [ "rematerializable" ],
1640 reg_req => { out => [ "xmm" ] },
1647 irn_flags => [ "rematerializable" ],
1648 reg_req => { out => [ "xmm" ] },
1649 emit => '. pxor %D0, %D0',
1655 # produces all 1 bits
1657 irn_flags => [ "rematerializable" ],
1658 reg_req => { out => [ "xmm" ] },
1659 emit => '. pcmpeqb %D0, %D0',
1665 # integer shift left, dword
1667 irn_flags => [ "rematerializable" ],
1668 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1669 emit => '. pslld %SI1, %D0',
1675 # integer shift left, qword
1677 irn_flags => [ "rematerializable" ],
1678 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1679 emit => '. psllq %SI1, %D0',
1685 # integer shift right, dword
1687 irn_flags => [ "rematerializable" ],
1688 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1689 emit => '. psrld %SI1, %D0',
1695 # mov from integer to SSE register
1697 irn_flags => [ "rematerializable" ],
1698 reg_req => { in => [ "gp" ], out => [ "xmm" ] },
1699 emit => '. movd %S0, %D0',
1706 irn_flags => [ "rematerializable" ],
1707 state => "exc_pinned",
1708 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1709 out => [ "in_r4 in_r5", "flags", "none" ] },
1710 ins => [ "base", "index", "mem", "left", "right" ],
1711 outs => [ "res", "flags", "M" ],
1712 am => "source,binary",
1713 emit => '. add%XXM %binop',
1720 irn_flags => [ "rematerializable" ],
1721 state => "exc_pinned",
1722 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1723 out => [ "in_r4 in_r5", "flags", "none" ] },
1724 ins => [ "base", "index", "mem", "left", "right" ],
1725 outs => [ "res", "flags", "M" ],
1726 am => "source,binary",
1727 emit => '. mul%XXM %binop',
1734 irn_flags => [ "rematerializable" ],
1735 state => "exc_pinned",
1736 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1737 out => [ "in_r4 in_r5", "flags", "none" ] },
1738 ins => [ "base", "index", "mem", "left", "right" ],
1739 outs => [ "res", "flags", "M" ],
1740 am => "source,binary",
1741 emit => '. max%XXM %binop',
1748 irn_flags => [ "rematerializable" ],
1749 state => "exc_pinned",
1750 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1751 out => [ "in_r4 in_r5", "flags", "none" ] },
1752 ins => [ "base", "index", "mem", "left", "right" ],
1753 outs => [ "res", "flags", "M" ],
1754 am => "source,binary",
1755 emit => '. min%XXM %binop',
1762 irn_flags => [ "rematerializable" ],
1763 state => "exc_pinned",
1764 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1765 out => [ "in_r4 in_r5", "flags", "none" ] },
1766 ins => [ "base", "index", "mem", "left", "right" ],
1767 outs => [ "res", "flags", "M" ],
1768 am => "source,binary",
1769 emit => '. andp%XSD %binop',
1776 irn_flags => [ "rematerializable" ],
1777 state => "exc_pinned",
1778 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1779 out => [ "in_r4 in_r5", "flags", "none" ] },
1780 ins => [ "base", "index", "mem", "left", "right" ],
1781 outs => [ "res", "flags", "M" ],
1782 am => "source,binary",
1783 emit => '. orp%XSD %binop',
1790 irn_flags => [ "rematerializable" ],
1791 state => "exc_pinned",
1792 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1793 out => [ "in_r4 in_r5", "flags", "none" ] },
1794 ins => [ "base", "index", "mem", "left", "right" ],
1795 outs => [ "res", "flags", "M" ],
1796 am => "source,binary",
1797 emit => '. xorp%XSD %binop',
1804 irn_flags => [ "rematerializable" ],
1805 state => "exc_pinned",
1806 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1807 out => [ "in_r4 !in_r5", "flags", "none" ] },
1808 ins => [ "base", "index", "mem", "left", "right" ],
1809 outs => [ "res", "flags", "M" ],
1810 am => "source,binary",
1811 emit => '. andnp%XSD %binop',
1818 irn_flags => [ "rematerializable" ],
1819 state => "exc_pinned",
1820 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1821 out => [ "in_r4", "flags", "none" ] },
1822 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
1823 outs => [ "res", "flags", "M" ],
1824 am => "source,binary",
1825 emit => '. sub%XXM %binop',
1832 irn_flags => [ "rematerializable" ],
1833 state => "exc_pinned",
1834 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1835 out => [ "in_r4 !in_r5", "flags", "none" ] },
1836 ins => [ "base", "index", "mem", "dividend", "divisor" ],
1837 outs => [ "res", "flags", "M" ],
1838 am => "source,binary",
1839 emit => '. div%XXM %binop',
1845 irn_flags => [ "rematerializable" ],
1846 state => "exc_pinned",
1847 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1848 out => [ "eflags" ] },
1849 ins => [ "base", "index", "mem", "left", "right" ],
1850 outs => [ "flags" ],
1851 am => "source,binary",
1852 attr => "bool ins_permuted",
1853 init_attr => "attr->data.ins_permuted = ins_permuted;",
1854 emit => ' .ucomi%XXM %binop',
1857 mode => $mode_flags,
1858 modified_flags => 1,
1862 op_flags => [ "fragile", "labeled" ],
1863 state => "exc_pinned",
1864 reg_req => { in => [ "gp", "gp", "none" ],
1865 out => [ "xmm", "none", "none", "none", "none" ] },
1866 ins => [ "base", "index", "mem" ],
1867 outs => [ "res", "unused", "M", "X_regular", "X_except" ],
1868 emit => '. mov%XXM %AM, %D0',
1869 attr => "ir_mode *load_mode",
1870 init_attr => "attr->ls_mode = load_mode;",
1876 op_flags => [ "fragile", "labeled" ],
1877 state => "exc_pinned",
1878 reg_req => { in => [ "gp", "gp", "none", "xmm" ],
1879 out => [ "none", "none", "none" ] },
1880 ins => [ "base", "index", "mem", "val" ],
1881 outs => [ "M", "X_regular", "X_except" ],
1882 emit => '. mov%XXM %S3, %AM',
1889 op_flags => [ "fragile", "labeled" ],
1890 state => "exc_pinned",
1891 reg_req => { in => [ "gp", "gp", "none", "xmm" ],
1892 out => [ "none", "none", "none" ] },
1893 ins => [ "base", "index", "mem", "val" ],
1894 outs => [ "M", "X_regular", "X_except" ],
1895 emit => '. mov%XXM %S3, %AM',
1902 op_flags => [ "labeled" ],
1903 state => "exc_pinned",
1904 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1905 ins => [ "base", "index", "mem", "val" ],
1906 am => "source,unary",
1907 emit => '. cvtsi2ss %unop3, %D0',
1914 op_flags => [ "labeled" ],
1915 state => "exc_pinned",
1916 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1917 ins => [ "base", "index", "mem", "val" ],
1918 am => "source,unary",
1919 emit => '. cvtsi2sd %unop3, %D0',
1927 op_flags => [ "labeled" ],
1928 cmp_attr => "return 1;",
1929 ins => [ "val_high", "val_low" ],
1930 reg_req => { in => [ "none", "none" ], out => [ "none" ] }
1934 op_flags => [ "labeled" ],
1935 cmp_attr => "return 1;",
1937 outs => [ "res_high", "res_low" ],
1938 reg_req => { in => [ "none" ], out => [ "none", "none" ] }
1942 op_flags => [ "fragile" ],
1944 reg_req => { in => [ "edi", "esi", "ecx", "none" ],
1945 out => [ "edi", "esi", "ecx", "none", "none", "none" ] },
1946 ins => [ "dest", "source", "count", "mem" ],
1947 outs => [ "dest", "source", "count", "M", "X_regular", "X_except" ],
1948 attr_type => "ia32_copyb_attr_t",
1949 attr => "unsigned size",
1952 # we don't care about this flag, so no need to mark this node
1953 # modified_flags => [ "DF" ]
1957 op_flags => [ "fragile" ],
1959 reg_req => { in => [ "edi", "esi", "none" ],
1960 out => [ "edi", "esi", "none", "none", "none" ] },
1961 ins => [ "dest", "source", "mem" ],
1962 outs => [ "dest", "source", "M", "X_regular", "X_except" ],
1963 attr_type => "ia32_copyb_attr_t",
1964 attr => "unsigned size",
1967 # we don't care about this flag, so no need to mark this node
1968 # modified_flags => [ "DF" ]
1972 state => "exc_pinned",
1973 reg_req => { in => [ "eax" ], out => [ "eax" ] },
1983 state => "exc_pinned",
1984 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1985 out => [ "gp", "none", "none" ] },
1986 ins => [ "base", "index", "mem", "val" ],
1987 outs => [ "res", "flags", "M" ],
1988 am => "source,unary",
1991 attr => "ir_mode *smaller_mode",
1992 init_attr => "attr->ls_mode = smaller_mode;",
1997 state => "exc_pinned",
1998 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ],
1999 out => [ "gp", "none", "none" ] },
2000 ins => [ "base", "index", "mem", "val" ],
2001 outs => [ "res", "flags", "M" ],
2002 am => "source,unary",
2005 attr => "ir_mode *smaller_mode",
2006 init_attr => "attr->ls_mode = smaller_mode;",
2011 state => "exc_pinned",
2012 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm", "none" ] },
2013 ins => [ "base", "index", "mem", "val" ],
2014 am => "source,unary",
2021 state => "exc_pinned",
2022 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "gp", "none" ] },
2023 ins => [ "base", "index", "mem", "val" ],
2024 am => "source,unary",
2031 state => "exc_pinned",
2032 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "xmm", "none" ] },
2033 ins => [ "base", "index", "mem", "val" ],
2034 am => "source,unary",
2040 # rematerialisation disabled for all float nodes for now, because the fpcw
2041 # handler runs before spilling and we might end up with wrong fpcw then
2044 # irn_flags => [ "rematerializable" ],
2045 state => "exc_pinned",
2046 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2047 out => [ "vfp", "none", "none" ] },
2048 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2049 outs => [ "res", "dummy", "M" ],
2050 am => "source,binary",
2054 attr_type => "ia32_x87_attr_t",
2058 # irn_flags => [ "rematerializable" ],
2059 state => "exc_pinned",
2060 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2061 out => [ "vfp", "none", "none" ] },
2062 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2063 outs => [ "res", "dummy", "M" ],
2064 am => "source,binary",
2068 attr_type => "ia32_x87_attr_t",
2072 # irn_flags => [ "rematerializable" ],
2073 state => "exc_pinned",
2074 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2075 out => [ "vfp", "none", "none" ] },
2076 ins => [ "base", "index", "mem", "minuend", "subtrahend", "fpcw" ],
2077 outs => [ "res", "dummy", "M" ],
2078 am => "source,binary",
2082 attr_type => "ia32_x87_attr_t",
2086 state => "exc_pinned",
2087 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2088 out => [ "vfp", "none", "none" ] },
2089 ins => [ "base", "index", "mem", "dividend", "divisor", "fpcw" ],
2090 outs => [ "res", "dummy", "M" ],
2091 am => "source,binary",
2094 attr_type => "ia32_x87_attr_t",
2098 reg_req => { in => [ "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2099 ins => [ "left", "right", "fpcw" ],
2103 attr_type => "ia32_x87_attr_t",
2107 irn_flags => [ "rematerializable" ],
2108 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2113 attr_type => "ia32_x87_attr_t",
2117 irn_flags => [ "rematerializable" ],
2118 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2123 attr_type => "ia32_x87_attr_t",
2127 irn_flags => [ "rematerializable" ],
2128 op_flags => [ "fragile", "labeled" ],
2129 state => "exc_pinned",
2130 reg_req => { in => [ "gp", "gp", "none" ],
2131 out => [ "vfp", "none", "none", "none", "none" ] },
2132 ins => [ "base", "index", "mem" ],
2133 outs => [ "res", "unused", "M", "X_regular", "X_except" ],
2134 attr => "ir_mode *load_mode",
2135 init_attr => "attr->attr.ls_mode = load_mode;",
2138 attr_type => "ia32_x87_attr_t",
2142 irn_flags => [ "rematerializable" ],
2143 op_flags => [ "fragile", "labeled" ],
2144 state => "exc_pinned",
2145 reg_req => { in => [ "gp", "gp", "none", "vfp" ],
2146 out => [ "none", "none", "none" ] },
2147 ins => [ "base", "index", "mem", "val" ],
2148 outs => [ "M", "X_regular", "X_except" ],
2149 attr => "ir_mode *store_mode",
2150 init_attr => "attr->attr.ls_mode = store_mode;",
2154 attr_type => "ia32_x87_attr_t",
2158 state => "exc_pinned",
2159 reg_req => { in => [ "gp", "gp", "none" ],
2160 out => [ "vfp", "none", "none" ] },
2161 outs => [ "res", "unused", "M" ],
2162 ins => [ "base", "index", "mem" ],
2165 attr_type => "ia32_x87_attr_t",
2169 state => "exc_pinned",
2170 reg_req => { in => [ "gp", "gp", "none", "vfp", "fpcw" ], out => [ "none" ] },
2171 ins => [ "base", "index", "mem", "val", "fpcw" ],
2176 attr_type => "ia32_x87_attr_t",
2179 # SSE3 fisttp instruction
2181 state => "exc_pinned",
2182 reg_req => { in => [ "gp", "gp", "none", "vfp" ], out => [ "in_r4", "none" ]},
2183 ins => [ "base", "index", "mem", "val" ],
2184 outs => [ "res", "M" ],
2187 attr_type => "ia32_x87_attr_t",
2191 irn_flags => [ "rematerializable" ],
2192 reg_req => { out => [ "vfp" ] },
2197 attr_type => "ia32_x87_attr_t",
2201 irn_flags => [ "rematerializable" ],
2202 reg_req => { out => [ "vfp" ] },
2207 attr_type => "ia32_x87_attr_t",
2211 irn_flags => [ "rematerializable" ],
2212 reg_req => { out => [ "vfp" ] },
2217 attr_type => "ia32_x87_attr_t",
2221 irn_flags => [ "rematerializable" ],
2222 reg_req => { out => [ "vfp" ] },
2227 attr_type => "ia32_x87_attr_t",
2231 irn_flags => [ "rematerializable" ],
2232 reg_req => { out => [ "vfp" ] },
2237 attr_type => "ia32_x87_attr_t",
2241 irn_flags => [ "rematerializable" ],
2242 reg_req => { out => [ "vfp" ] },
2247 attr_type => "ia32_x87_attr_t",
2251 irn_flags => [ "rematerializable" ],
2252 reg_req => { out => [ "vfp" ] },
2257 attr_type => "ia32_x87_attr_t",
2261 # we can't allow to rematerialize this node so we don't
2262 # accidently produce Phi(Fucom, Fucom(ins_permuted))
2263 # irn_flags => [ "rematerializable" ],
2264 reg_req => { in => [ "vfp", "vfp" ], out => [ "eax" ] },
2265 ins => [ "left", "right" ],
2266 outs => [ "flags" ],
2267 attr => "bool ins_permuted",
2268 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2271 attr_type => "ia32_x87_attr_t",
2276 irn_flags => [ "rematerializable" ],
2277 reg_req => { in => [ "vfp", "vfp" ], out => [ "eflags" ] },
2278 ins => [ "left", "right" ],
2279 outs => [ "flags" ],
2280 attr => "bool ins_permuted",
2281 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2284 attr_type => "ia32_x87_attr_t",
2289 # irn_flags => [ "rematerializable" ],
2290 reg_req => { in => [ "vfp" ], out => [ "eax" ] },
2292 outs => [ "flags" ],
2293 attr => "bool ins_permuted",
2294 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2297 attr_type => "ia32_x87_attr_t",
2302 irn_flags => [ "rematerializable" ],
2303 reg_req => { in => [ "eax" ], out => [ "eflags" ] },
2305 outs => [ "flags" ],
2309 mode => $mode_flags,
2313 state => "exc_pinned",
2314 emit => '. fadd%XM %x87_binop',
2316 attr_type => "ia32_x87_attr_t",
2321 state => "exc_pinned",
2322 emit => '. faddp%XM %x87_binop',
2324 attr_type => "ia32_x87_attr_t",
2329 state => "exc_pinned",
2330 emit => '. fmul%XM %x87_binop',
2332 attr_type => "ia32_x87_attr_t",
2337 state => "exc_pinned",
2338 emit => '. fmulp%XM %x87_binop',,
2340 attr_type => "ia32_x87_attr_t",
2345 state => "exc_pinned",
2346 emit => '. fsub%XM %x87_binop',
2348 attr_type => "ia32_x87_attr_t",
2352 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
2353 # are swapped, we work this around in the emitter...
2356 state => "exc_pinned",
2357 # see note about gas bugs
2358 emit => '. fsubrp%XM %x87_binop',
2360 attr_type => "ia32_x87_attr_t",
2365 state => "exc_pinned",
2366 irn_flags => [ "rematerializable" ],
2367 emit => '. fsubr%XM %x87_binop',
2369 attr_type => "ia32_x87_attr_t",
2374 state => "exc_pinned",
2375 irn_flags => [ "rematerializable" ],
2376 # see note about gas bugs before fsubp
2377 emit => '. fsubp%XM %x87_binop',
2379 attr_type => "ia32_x87_attr_t",
2386 attr_type => "ia32_x87_attr_t",
2390 # this node is just here, to keep the simulator running
2391 # we can omit this when a fprem simulation function exists
2393 emit => '. fprem1\n'.
2396 attr_type => "ia32_x87_attr_t",
2401 state => "exc_pinned",
2402 emit => '. fdiv%XM %x87_binop',
2404 attr_type => "ia32_x87_attr_t",
2409 state => "exc_pinned",
2410 # see note about gas bugs before fsubp
2411 emit => '. fdivrp%XM %x87_binop',
2413 attr_type => "ia32_x87_attr_t",
2418 state => "exc_pinned",
2419 emit => '. fdivr%XM %x87_binop',
2421 attr_type => "ia32_x87_attr_t",
2426 state => "exc_pinned",
2427 # see note about gas bugs before fsubp
2428 emit => '. fdivp%XM %x87_binop',
2430 attr_type => "ia32_x87_attr_t",
2437 attr_type => "ia32_x87_attr_t",
2442 op_flags => [ "keep" ],
2443 irn_flags => [ "rematerializable" ],
2446 attr_type => "ia32_x87_attr_t",
2451 irn_flags => [ "rematerializable" ],
2452 op_flags => [ "labeled" ],
2453 state => "exc_pinned",
2454 emit => '. fld%XM %AM',
2455 attr_type => "ia32_x87_attr_t",
2461 irn_flags => [ "rematerializable" ],
2462 op_flags => [ "labeled" ],
2463 state => "exc_pinned",
2464 emit => '. fst%XM %AM',
2466 attr_type => "ia32_x87_attr_t",
2472 irn_flags => [ "rematerializable" ],
2473 op_flags => [ "labeled" ],
2474 state => "exc_pinned",
2475 emit => '. fstp%XM %AM',
2477 attr_type => "ia32_x87_attr_t",
2483 state => "exc_pinned",
2484 emit => '. fild%XM %AM',
2485 attr_type => "ia32_x87_attr_t",
2491 state => "exc_pinned",
2492 emit => '. fist%XM %AM',
2494 attr_type => "ia32_x87_attr_t",
2500 state => "exc_pinned",
2501 emit => '. fistp%XM %AM',
2503 attr_type => "ia32_x87_attr_t",
2508 # SSE3 fisttp instruction
2510 state => "exc_pinned",
2511 emit => '. fisttp%XM %AM',
2513 attr_type => "ia32_x87_attr_t",
2519 op_flags => [ "constlike", "keep" ],
2520 irn_flags => [ "rematerializable" ],
2521 reg_req => { out => [ "vfp" ] },
2523 attr_type => "ia32_x87_attr_t",
2528 op_flags => [ "constlike", "keep" ],
2529 irn_flags => [ "rematerializable" ],
2530 reg_req => { out => [ "vfp" ] },
2532 attr_type => "ia32_x87_attr_t",
2537 op_flags => [ "constlike", "keep" ],
2538 irn_flags => [ "rematerializable" ],
2539 reg_req => { out => [ "vfp" ] },
2541 attr_type => "ia32_x87_attr_t",
2546 op_flags => [ "constlike", "keep" ],
2547 irn_flags => [ "rematerializable" ],
2548 reg_req => { out => [ "vfp" ] },
2550 attr_type => "ia32_x87_attr_t",
2555 op_flags => [ "constlike", "keep" ],
2556 irn_flags => [ "rematerializable" ],
2557 reg_req => { out => [ "vfp" ] },
2559 attr_type => "ia32_x87_attr_t",
2564 op_flags => [ "constlike", "keep" ],
2565 irn_flags => [ "rematerializable" ],
2566 reg_req => { out => [ "vfp" ] },
2567 emit => '. fldll2t',
2568 attr_type => "ia32_x87_attr_t",
2573 op_flags => [ "constlike", "keep" ],
2574 irn_flags => [ "rematerializable" ],
2575 reg_req => { out => [ "vfp" ] },
2577 attr_type => "ia32_x87_attr_t",
2582 # Note that it is NEVER allowed to do CSE on these nodes
2583 # Moreover, note the virtual register requierements!
2586 op_flags => [ "keep" ],
2587 reg_req => { out => [ "none" ] },
2588 cmp_attr => "return 1;",
2589 emit => '. fxch %X0',
2590 attr_type => "ia32_x87_attr_t",
2596 op_flags => [ "keep" ],
2597 reg_req => { out => [ "none" ] },
2598 cmp_attr => "return 1;",
2599 emit => '. fld %X0',
2600 attr_type => "ia32_x87_attr_t",
2606 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2607 cmp_attr => "return 1;",
2608 emit => '. fld %X0',
2609 attr_type => "ia32_x87_attr_t",
2614 op_flags => [ "keep" ],
2615 reg_req => { out => [ "none" ] },
2616 cmp_attr => "return 1;",
2617 emit => '. fstp %X0',
2618 attr_type => "ia32_x87_attr_t",
2624 op_flags => [ "keep" ],
2625 reg_req => { out => [ "none" ] },
2626 cmp_attr => "return 1;",
2627 emit => '. ffreep %X0',
2628 attr_type => "ia32_x87_attr_t",
2634 op_flags => [ "keep" ],
2635 reg_req => { out => [ "none" ] },
2636 cmp_attr => "return 1;",
2638 attr_type => "ia32_x87_attr_t",
2644 op_flags => [ "keep" ],
2645 reg_req => { out => [ "none" ] },
2646 cmp_attr => "return 1;",
2648 attr_type => "ia32_x87_attr_t",
2655 emit => ". fucom %X1\n".
2657 attr_type => "ia32_x87_attr_t",
2663 emit => ". fucomp %X1\n".
2665 attr_type => "ia32_x87_attr_t",
2671 emit => ". fucompp\n".
2673 attr_type => "ia32_x87_attr_t",
2679 emit => '. fucomi %X1',
2680 attr_type => "ia32_x87_attr_t",
2686 emit => '. fucompi %X1',
2687 attr_type => "ia32_x87_attr_t",
2695 attr_type => "ia32_x87_attr_t",
2699 # Spilling and reloading of SSE registers, hardcoded, not generated #
2702 op_flags => [ "fragile", "labeled" ],
2703 state => "exc_pinned",
2704 reg_req => { in => [ "gp", "gp", "none" ],
2705 out => [ "xmm", "none", "none", "none" ] },
2706 emit => '. movdqu %D0, %AM',
2707 ins => [ "base", "index", "mem" ],
2708 outs => [ "res", "M", "X_regular", "X_except" ],
2714 op_flags => [ "fragile", "labeled" ],
2715 state => "exc_pinned",
2716 reg_req => { in => [ "gp", "gp", "none", "xmm" ],
2717 out => [ "none", "none", "none" ] },
2718 ins => [ "base", "index", "mem", "val" ],
2719 outs => [ "M", "X_regular", "X_except" ],
2720 emit => '. movdqu %binop',
2728 # Transform some attributes
2729 foreach my $op (keys(%nodes)) {
2730 my $node = $nodes{$op};
2731 my $op_attr_init = $node->{op_attr_init};
2733 if(defined($op_attr_init)) {
2734 $op_attr_init .= "\n\t";
2739 if(!defined($node->{latency})) {
2741 $node->{latency} = 0;
2743 die("Latency missing for op $op");
2746 $op_attr_init .= "attr->latency = ".$node->{latency} . ";";
2748 $node->{op_attr_init} = $op_attr_init;