3 # This is the specification for the ia32 assembler Firm-operations
10 # the cpu architecture (ia32, ia64, mips, sparc, ppc, ...)
13 # The node description is done as a perl hash initializer with the
14 # following structure:
19 # op_flags => "N|L|C|X|I|F|Y|H|c|K",
21 # arity => "0|1|2|3 ... |variable|dynamic|any",
22 # state => "floats|pinned|mem_pinned|exc_pinned",
24 # { type => "type 1", name => "name 1" },
25 # { type => "type 2", name => "name 2" },
28 # comment => "any comment for constructor",
29 # reg_req => { in => [ "reg_class|register" ], out => [ "reg_class|register|in_rX" ] },
30 # cmp_attr => "c source code for comparing node attributes",
31 # outs => { "out1", "out2" } # optional, creates pn_op_out1, ... consts
32 # ins => { "in1", "in2" } # optional, creates n_op_in1, ... consts
33 # mode => "mode_Iu" # optional, predefines the mode
34 # emit => "emit code with templates",
35 # attr => "additional attribute arguments for constructor",
36 # init_attr => "emit attribute initialization template",
37 # rd_constructor => "c source code which constructs an ir_node",
38 # hash_func => "name of the hash function for this operation",
39 # latency => "latency of this operation (can be float)"
40 # attr_type => "name of the attribute struct",
41 # modified_flags => [ "CF", ... ] # optional, list of modified flags
44 # ... # (all nodes you need to describe)
46 # ); # close the %nodes initializer
48 # op_flags: flags for the operation, OPTIONAL (default is "N")
49 # the op_flags correspond to the firm irop_flags:
52 # C irop_flag_commutative
53 # X irop_flag_cfopcode
54 # I irop_flag_ip_cfopcode
57 # H irop_flag_highlevel
58 # c irop_flag_constlike
60 # NB irop_flag_dump_noblock
61 # NI irop_flag_dump_noinput
63 # irn_flags: special node flags, OPTIONAL (default is 0)
64 # following irn_flags are supported:
68 # state: state of the operation, OPTIONAL (default is "floats")
70 # arity: arity of the operation, MUST NOT BE OMITTED
72 # args: the OPTIONAL arguments of the node constructor (debug, irg and block
73 # are always the first 3 arguments and are always autmatically
75 # If this key is missing the following arguments will be created:
76 # for i = 1 .. arity: ir_node *op_i
79 # outs: if a node defines more than one output, the names of the projections
80 # nodes having outs having automatically the mode mode_T
81 # example: [ "frame", "stack", "M" ]
83 # comment: OPTIONAL comment for the node constructor
85 # rd_constructor: for every operation there will be a
86 # new_rd_<arch>_<op-name> function with the arguments from above
87 # which creates the ir_node corresponding to the defined operation
88 # you can either put the complete source code of this function here
90 # This key is OPTIONAL. If omitted, the following constructor will
92 # if (!op_<arch>_<op-name>) assert(0);
96 # res = new_ir_node(db, irg, block, op_<arch>_<op-name>, mode, arity, in)
99 # NOTE: rd_constructor and args are only optional if and only if arity is 0,1,2 or 3
103 # 0 - no special type
104 # 1 - caller save (register must be saved by the caller of a function)
105 # 2 - callee save (register must be saved by the called function)
106 # 4 - ignore (do not automatically assign this register)
107 # 8 - emitter can choose an arbitrary register of this class
108 # 16 - the register is a virtual one
109 # 32 - register represents a state
110 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
113 { name => "edx", type => 1 },
114 { name => "ecx", type => 1 },
115 { name => "eax", type => 1 },
116 { name => "ebx", type => 2 },
117 { name => "esi", type => 2 },
118 { name => "edi", type => 2 },
119 { name => "ebp", type => 2 },
120 { name => "esp", type => 4 },
121 { name => "gp_NOREG", type => 4 | 8 | 16 }, # we need a dummy register for NoReg nodes
122 { name => "gp_UKNWN", type => 4 | 8 | 16 }, # we need a dummy register for Unknown nodes
123 { mode => "mode_Iu" }
126 { name => "mm0", type => 4 },
127 { name => "mm1", type => 4 },
128 { name => "mm2", type => 4 },
129 { name => "mm3", type => 4 },
130 { name => "mm4", type => 4 },
131 { name => "mm5", type => 4 },
132 { name => "mm6", type => 4 },
133 { name => "mm7", type => 4 },
134 { mode => "mode_E", flags => "manual_ra" }
137 { name => "xmm0", type => 1 },
138 { name => "xmm1", type => 1 },
139 { name => "xmm2", type => 1 },
140 { name => "xmm3", type => 1 },
141 { name => "xmm4", type => 1 },
142 { name => "xmm5", type => 1 },
143 { name => "xmm6", type => 1 },
144 { name => "xmm7", type => 1 },
145 { name => "xmm_NOREG", type => 4 | 16 }, # we need a dummy register for NoReg nodes
146 { name => "xmm_UKNWN", type => 4 | 8 | 16}, # we need a dummy register for Unknown nodes
150 { name => "vf0", type => 1 },
151 { name => "vf1", type => 1 },
152 { name => "vf2", type => 1 },
153 { name => "vf3", type => 1 },
154 { name => "vf4", type => 1 },
155 { name => "vf5", type => 1 },
156 { name => "vf6", type => 1 },
157 { name => "vf7", type => 1 },
158 { name => "vfp_NOREG", type => 4 | 8 | 16 }, # we need a dummy register for NoReg nodes
159 { name => "vfp_UKNWN", type => 4 | 8 | 16 }, # we need a dummy register for Unknown nodes
163 { name => "st0", realname => "st", type => 4 },
164 { name => "st1", realname => "st(1)", type => 4 },
165 { name => "st2", realname => "st(2)", type => 4 },
166 { name => "st3", realname => "st(3)", type => 4 },
167 { name => "st4", realname => "st(4)", type => 4 },
168 { name => "st5", realname => "st(5)", type => 4 },
169 { name => "st6", realname => "st(6)", type => 4 },
170 { name => "st7", realname => "st(7)", type => 4 },
171 { mode => "mode_E", flags => "manual_ra" }
173 fp_cw => [ # the floating point control word
174 { name => "fpcw", type => 4|32 },
175 { mode => "mode_fpcw", flags => "manual_ra|state" }
178 { name => "eflags", type => 0 },
179 { mode => "mode_Iu", flags => "manual_ra" }
184 GP => [ 1, "GP_EAX", "GP_EBX", "GP_ECX", "GP_EDX", "GP_ESI", "GP_EDI", "GP_EBP" ],
185 SSE => [ 1, "SSE_XMM0", "SSE_XMM1", "SSE_XMM2", "SSE_XMM3", "SSE_XMM4", "SSE_XMM5", "SSE_XMM6", "SSE_XMM7" ],
186 VFP => [ 1, "VFP_VF0", "VFP_VF1", "VFP_VF2", "VFP_VF3", "VFP_VF4", "VFP_VF5", "VFP_VF6", "VFP_VF7" ],
187 BRANCH => [ 1, "BRANCH1", "BRANCH2" ],
192 bundels_per_cycle => 1
196 S0 => "${arch}_emit_source_register(node, 0);",
197 S1 => "${arch}_emit_source_register(node, 1);",
198 S2 => "${arch}_emit_source_register(node, 2);",
199 S3 => "${arch}_emit_source_register(node, 3);",
200 SB0 => "${arch}_emit_8bit_source_register_or_immediate(node, 0);",
201 SB1 => "${arch}_emit_8bit_source_register_or_immediate(node, 1);",
202 SB2 => "${arch}_emit_8bit_source_register_or_immediate(node, 2);",
203 SB3 => "${arch}_emit_8bit_source_register_or_immediate(node, 3);",
204 SH0 => "${arch}_emit_8bit_high_source_register(node, 0);",
205 SS0 => "${arch}_emit_16bit_source_register_or_immediate(node, 0);",
206 SI0 => "${arch}_emit_source_register_or_immediate(node, 0);",
207 SI1 => "${arch}_emit_source_register_or_immediate(node, 1);",
208 SI3 => "${arch}_emit_source_register_or_immediate(node, 3);",
209 D0 => "${arch}_emit_dest_register(node, 0);",
210 D1 => "${arch}_emit_dest_register(node, 1);",
211 DS0 => "${arch}_emit_dest_register_size(node, 0);",
212 DB0 => "${arch}_emit_8bit_dest_register(node, 0);",
213 X0 => "${arch}_emit_x87_register(node, 0);",
214 X1 => "${arch}_emit_x87_register(node, 1);",
215 EX => "${arch}_emit_extend_suffix(node);",
216 M => "${arch}_emit_mode_suffix(node);",
217 XM => "${arch}_emit_x87_mode_suffix(node);",
218 XXM => "${arch}_emit_xmm_mode_suffix(node);",
219 XSD => "${arch}_emit_xmm_mode_suffix_s(node);",
220 AM => "${arch}_emit_am(node);",
221 unop3 => "${arch}_emit_unop(node, n_ia32_unary_op);",
222 unop4 => "${arch}_emit_unop(node, n_ia32_binary_right);",
223 binop => "${arch}_emit_binop(node);",
224 x87_binop => "${arch}_emit_x87_binop(node);",
225 CMP0 => "${arch}_emit_cmp_suffix_node(node, 0);",
226 CMP3 => "${arch}_emit_cmp_suffix_node(node, 3);",
229 #--------------------------------------------------#
232 # _ __ _____ __ _ _ __ ___ _ __ ___ #
233 # | '_ \ / _ \ \ /\ / / | | '__| / _ \| '_ \/ __| #
234 # | | | | __/\ V V / | | | | (_) | |_) \__ \ #
235 # |_| |_|\___| \_/\_/ |_|_| \___/| .__/|___/ #
238 #--------------------------------------------------#
240 $default_op_attr_type = "ia32_op_attr_t";
241 $default_attr_type = "ia32_attr_t";
242 $default_copy_attr = "ia32_copy_attr";
244 sub ia32_custom_init_attr {
249 if(defined($node->{modified_flags})) {
250 $res .= "\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n";
252 if(defined($node->{am})) {
253 my $am = $node->{am};
254 if($am eq "source,unary") {
255 $res .= "\tset_ia32_am_support(res, ia32_am_unary);";
256 } elsif($am eq "source,binary") {
257 $res .= "\tset_ia32_am_support(res, ia32_am_binary);";
258 } elsif($am eq "none") {
261 die("Invalid address mode '$am' specified on op $name");
264 if($node->{state} ne "exc_pinned"
265 and $node->{state} ne "pinned") {
266 die("AM nodes must have pinned or AM pinned state ($name)");
272 $custom_init_attr_func = \&ia32_custom_init_attr;
276 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
277 "\tinit_ia32_x87_attributes(res);".
278 "\tinit_ia32_asm_attributes(res);",
280 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);",
282 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
283 "\tinit_ia32_call_attributes(res, pop, call_tp);",
284 ia32_condcode_attr_t =>
285 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
286 "\tinit_ia32_condcode_attributes(res, pnc);",
288 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
289 "\tinit_ia32_copyb_attributes(res, size);",
290 ia32_immediate_attr_t =>
291 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
292 "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, no_pic_adjust, offset);",
294 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
295 "\tinit_ia32_x87_attributes(res);",
296 ia32_climbframe_attr_t =>
297 "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
298 "\tinit_ia32_climbframe_attributes(res, count);",
302 ia32_asm_attr_t => "ia32_compare_asm_attr",
303 ia32_attr_t => "ia32_compare_nodes_attr",
304 ia32_call_attr_t => "ia32_compare_call_attr",
305 ia32_condcode_attr_t => "ia32_compare_condcode_attr",
306 ia32_copyb_attr_t => "ia32_compare_copyb_attr",
307 ia32_immediate_attr_t => "ia32_compare_immediate_attr",
308 ia32_x87_attr_t => "ia32_compare_x87_attr",
309 ia32_climbframe_attr_t => "ia32_compare_climbframe_attr",
315 $mode_xmm = "mode_E";
316 $mode_gp = "mode_Iu";
317 $mode_flags = "mode_Iu";
318 $mode_fpcw = "mode_fpcw";
319 $status_flags = [ "CF", "PF", "AF", "ZF", "SF", "OF" ];
320 $status_flags_wo_cf = [ "PF", "AF", "ZF", "SF", "OF" ];
321 $fpcw_flags = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
322 "FP_PC0", "FP_PC1", "FP_RC0", "FP_RC1", "FP_X" ];
329 reg_req => { out => [ "gp_NOREG:I" ] },
330 attr => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
331 attr_type => "ia32_immediate_attr_t",
332 hash_func => "ia32_hash_Immediate",
340 out_arity => "variable",
341 attr_type => "ia32_asm_attr_t",
342 attr => "ident *asm_text, const ia32_asm_reg_t *register_map",
343 init_attr => "attr->asm_text = asm_text;\n".
344 "\tattr->register_map = register_map;\n",
346 modified_flags => $status_flags,
349 # "allocates" a free register
353 reg_req => { out => [ "gp" ] },
358 cmp_attr => "return 1;",
361 #-----------------------------------------------------------------#
364 # _ _ __ | |_ ___ __ _ ___ _ __ _ __ ___ __| | ___ ___ #
365 # | | '_ \| __/ _ \/ _` |/ _ \ '__| | '_ \ / _ \ / _` |/ _ \/ __| #
366 # | | | | | || __/ (_| | __/ | | | | | (_) | (_| | __/\__ \ #
367 # |_|_| |_|\__\___|\__, |\___|_| |_| |_|\___/ \__,_|\___||___/ #
370 #-----------------------------------------------------------------#
372 # commutative operations
376 state => "exc_pinned",
377 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
378 out => [ "in_r4 in_r5", "flags", "none" ] },
379 ins => [ "base", "index", "mem", "left", "right" ],
380 outs => [ "res", "flags", "M" ],
381 emit => '. add%M %binop',
382 am => "source,binary",
386 modified_flags => $status_flags
391 state => "exc_pinned",
392 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
393 ins => [ "base", "index", "mem", "val" ],
394 emit => ". add%M %SI3, %AM",
398 modified_flags => $status_flags
403 state => "exc_pinned",
404 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
405 ins => [ "base", "index", "mem", "val" ],
406 emit => ". add%M %SB3, %AM",
410 modified_flags => $status_flags
414 state => "exc_pinned",
415 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "flags" ],
416 out => [ "in_r4 in_r5", "flags", "none" ] },
417 ins => [ "base", "index", "mem", "left", "right", "eflags" ],
418 outs => [ "res", "flags", "M" ],
419 emit => '. adc%M %binop',
420 am => "source,binary",
424 modified_flags => $status_flags
429 reg_req => { in => [ "none", "none" ], out => [ "none" ] },
430 ins => [ "left", "right" ],
434 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
435 ins => [ "left", "right", "eflags" ],
439 # we should not rematrialize this node. It produces 2 results and has
440 # very strict constraints
441 state => "exc_pinned",
442 reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
443 out => [ "eax", "flags", "none", "edx" ] },
444 ins => [ "base", "index", "mem", "left", "right" ],
445 emit => '. mul%M %unop4',
446 outs => [ "res_low", "flags", "M", "res_high" ],
447 am => "source,binary",
450 modified_flags => $status_flags
454 # we should not rematrialize this node. It produces 2 results and has
455 # very strict constraints
457 cmp_attr => "return 1;",
458 reg_req => { in => [ "none", "none" ],
459 out => [ "none", "none", "none", "none" ] },
460 ins => [ "left", "right" ],
461 outs => [ "res_low", "flags", "M", "res_high" ],
466 state => "exc_pinned",
467 # TODO: adjust out requirements for the 3 operand form
468 # (no need for should_be_same then)
469 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
470 out => [ "in_r4 in_r5", "flags", "none" ] },
471 ins => [ "base", "index", "mem", "left", "right" ],
472 outs => [ "res", "flags", "M" ],
473 am => "source,binary",
477 modified_flags => $status_flags
482 state => "exc_pinned",
483 reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
484 out => [ "eax", "flags", "none", "edx" ] },
485 ins => [ "base", "index", "mem", "left", "right" ],
486 emit => '. imul%M %unop4',
487 outs => [ "res_low", "flags", "M", "res_high" ],
488 am => "source,binary",
491 modified_flags => $status_flags
496 cmp_attr => "return 1;",
497 reg_req => { in => [ "none", "none" ],
498 out => [ "none", "none", "none", "none" ] },
499 ins => [ "left", "right" ],
500 outs => [ "res_low", "flags", "M", "res_high" ],
505 state => "exc_pinned",
506 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
507 out => [ "in_r4 in_r5", "flags", "none" ] },
508 ins => [ "base", "index", "mem", "left", "right" ],
509 outs => [ "res", "flags", "M" ],
510 op_modes => "commutative | am | immediate | mode_neutral",
511 am => "source,binary",
512 emit => '. and%M %binop',
516 modified_flags => $status_flags
521 state => "exc_pinned",
522 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
523 ins => [ "base", "index", "mem", "val" ],
524 emit => '. and%M %SI3, %AM',
528 modified_flags => $status_flags
533 state => "exc_pinned",
534 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
535 ins => [ "base", "index", "mem", "val" ],
536 emit => '. and%M %SB3, %AM',
540 modified_flags => $status_flags
545 state => "exc_pinned",
546 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
547 out => [ "in_r4 in_r5", "flags", "none" ] },
548 ins => [ "base", "index", "mem", "left", "right" ],
549 outs => [ "res", "flags", "M" ],
550 am => "source,binary",
551 emit => '. or%M %binop',
555 modified_flags => $status_flags
560 state => "exc_pinned",
561 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
562 ins => [ "base", "index", "mem", "val" ],
563 emit => '. or%M %SI3, %AM',
567 modified_flags => $status_flags
572 state => "exc_pinned",
573 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
574 ins => [ "base", "index", "mem", "val" ],
575 emit => '. or%M %SB3, %AM',
579 modified_flags => $status_flags
584 state => "exc_pinned",
585 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
586 out => [ "in_r4 in_r5", "flags", "none" ] },
587 ins => [ "base", "index", "mem", "left", "right" ],
588 outs => [ "res", "flags", "M" ],
589 am => "source,binary",
590 emit => '. xor%M %binop',
594 modified_flags => $status_flags
600 reg_req => { out => [ "gp", "flags" ] },
601 outs => [ "res", "flags" ],
602 emit => ". xor%M %D0, %D0",
606 modified_flags => $status_flags
611 state => "exc_pinned",
612 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
613 ins => [ "base", "index", "mem", "val" ],
614 emit => '. xor%M %SI3, %AM',
618 modified_flags => $status_flags
623 state => "exc_pinned",
624 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
625 ins => [ "base", "index", "mem", "val" ],
626 emit => '. xor%M %SB3, %AM',
630 modified_flags => $status_flags
633 # not commutative operations
637 state => "exc_pinned",
638 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
639 out => [ "in_r4", "flags", "none" ] },
640 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
641 outs => [ "res", "flags", "M" ],
642 am => "source,binary",
643 emit => '. sub%M %binop',
647 modified_flags => $status_flags
652 state => "exc_pinned",
653 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none" ] },
654 ins => [ "base", "index", "mem", "subtrahend" ],
655 emit => '. sub%M %SI3, %AM',
659 modified_flags => $status_flags
664 state => "exc_pinned",
665 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => [ "none" ] },
666 ins => [ "base", "index", "mem", "subtrahend" ],
667 emit => '. sub%M %SB3, %AM',
671 modified_flags => $status_flags
675 state => "exc_pinned",
676 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "flags" ],
677 out => [ "in_r4 !in_r5", "flags", "none" ] },
678 ins => [ "base", "index", "mem", "minuend", "subtrahend", "eflags" ],
679 outs => [ "res", "flags", "M" ],
680 am => "source,binary",
681 emit => '. sbb%M %binop',
685 modified_flags => $status_flags
690 reg_req => { in => [ "flags" ], out => [ "gp", "flags" ] },
691 outs => [ "res", "flags" ],
692 emit => ". sbb%M %D0, %D0",
696 modified_flags => $status_flags
700 reg_req => { in => [ "none", "none" ], out => [ "none" ] },
701 ins => [ "minuend", "subtrahend" ],
705 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
706 ins => [ "minuend", "subtrahend", "eflags" ],
711 state => "exc_pinned",
712 reg_req => { in => [ "gp", "gp", "none", "gp", "eax", "edx" ],
713 out => [ "eax", "flags", "none", "edx", "none" ] },
714 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
715 outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
716 am => "source,unary",
717 emit => ". idiv%M %unop3",
720 modified_flags => $status_flags
725 state => "exc_pinned",
726 reg_req => { in => [ "gp", "gp", "none", "gp", "eax", "edx" ],
727 out => [ "eax", "flags", "none", "edx", "none" ] },
728 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
729 outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
730 am => "source,unary",
731 emit => ". div%M %unop3",
734 modified_flags => $status_flags
739 reg_req => { in => [ "gp", "ecx" ],
740 out => [ "in_r1 !in_r2", "flags" ] },
741 ins => [ "val", "count" ],
742 outs => [ "res", "flags" ],
743 emit => '. shl%M %SB1, %S0',
747 modified_flags => $status_flags
752 state => "exc_pinned",
753 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
754 ins => [ "base", "index", "mem", "count" ],
755 emit => '. shl%M %SB3, %AM',
759 modified_flags => $status_flags
763 cmp_attr => "return 1;",
764 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
765 ins => [ "val", "count", "dep" ],
770 reg_req => { in => [ "gp", "gp", "ecx" ],
771 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
772 ins => [ "val_high", "val_low", "count" ],
773 outs => [ "res", "flags" ],
774 emit => ". shld%M %SB2, %S1, %D0",
778 modified_flags => $status_flags
782 cmp_attr => "return 1;",
783 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
784 ins => [ "val_high", "val_low", "count" ],
789 reg_req => { in => [ "gp", "ecx" ],
790 out => [ "in_r1 !in_r2", "flags" ] },
791 ins => [ "val", "count" ],
792 outs => [ "res", "flags" ],
793 emit => '. shr%M %SB1, %S0',
797 modified_flags => $status_flags
802 state => "exc_pinned",
803 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
804 ins => [ "base", "index", "mem", "count" ],
805 emit => '. shr%M %SB3, %AM',
809 modified_flags => $status_flags
813 cmp_attr => "return 1;",
814 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
815 ins => [ "val", "count", "dep" ],
820 reg_req => { in => [ "gp", "gp", "ecx" ],
821 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
822 ins => [ "val_high", "val_low", "count" ],
823 outs => [ "res", "flags" ],
824 emit => ". shrd%M %SB2, %S1, %D0",
828 modified_flags => $status_flags
832 cmp_attr => "return 1;",
833 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
834 ins => [ "val_high", "val_low", "count" ],
839 reg_req => { in => [ "gp", "ecx" ],
840 out => [ "in_r1 !in_r2", "flags" ] },
841 ins => [ "val", "count" ],
842 outs => [ "res", "flags" ],
843 emit => '. sar%M %SB1, %S0',
847 modified_flags => $status_flags
852 state => "exc_pinned",
853 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
854 ins => [ "base", "index", "mem", "count" ],
855 emit => '. sar%M %SB3, %AM',
859 modified_flags => $status_flags
863 cmp_attr => "return 1;",
864 ins => [ "val", "count", "dep" ],
865 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
870 reg_req => { in => [ "gp", "ecx" ],
871 out => [ "in_r1 !in_r2", "flags" ] },
872 ins => [ "val", "count" ],
873 outs => [ "res", "flags" ],
874 emit => '. ror%M %SB1, %S0',
878 modified_flags => $status_flags
883 state => "exc_pinned",
884 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
885 ins => [ "base", "index", "mem", "count" ],
886 emit => '. ror%M %SB3, %AM',
890 modified_flags => $status_flags
895 reg_req => { in => [ "gp", "ecx" ],
896 out => [ "in_r1 !in_r2", "flags" ] },
897 ins => [ "val", "count" ],
898 outs => [ "res", "flags" ],
899 emit => '. rol%M %SB1, %S0',
903 modified_flags => $status_flags
908 state => "exc_pinned",
909 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
910 ins => [ "base", "index", "mem", "count" ],
911 emit => '. rol%M %SB3, %AM',
915 modified_flags => $status_flags
922 reg_req => { in => [ "gp" ],
923 out => [ "in_r1", "flags" ] },
924 emit => '. neg%M %S0',
926 outs => [ "res", "flags" ],
930 modified_flags => $status_flags
935 state => "exc_pinned",
936 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
937 ins => [ "base", "index", "mem" ],
938 emit => '. neg%M %AM',
942 modified_flags => $status_flags
947 reg_req => { in => [ "gp", "gp" ], out => [ "in_r1", "in_r2" ] },
948 outs => [ "low_res", "high_res" ],
951 modified_flags => $status_flags
957 reg_req => { in => [ "gp" ],
958 out => [ "in_r1", "flags" ] },
960 outs => [ "res", "flags" ],
961 emit => '. inc%M %S0',
965 modified_flags => $status_flags_wo_cf
970 state => "exc_pinned",
971 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
972 ins => [ "base", "index", "mem" ],
973 emit => '. inc%M %AM',
977 modified_flags => $status_flags_wo_cf
982 reg_req => { in => [ "gp" ],
983 out => [ "in_r1", "flags" ] },
985 outs => [ "res", "flags" ],
986 emit => '. dec%M %S0',
990 modified_flags => $status_flags_wo_cf
995 state => "exc_pinned",
996 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
997 ins => [ "base", "index", "mem" ],
998 emit => '. dec%M %AM',
1002 modified_flags => $status_flags_wo_cf
1007 reg_req => { in => [ "gp" ],
1008 out => [ "in_r1", "flags" ] },
1010 outs => [ "res", "flags" ],
1011 emit => '. not%M %S0',
1020 state => "exc_pinned",
1021 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1022 ins => [ "base", "index", "mem" ],
1023 emit => '. not%M %AM',
1031 reg_req => { in => [ "flags" ], out => [ "flags" ] },
1035 mode => $mode_flags,
1036 modified_flags => $status_flags
1040 reg_req => { out => [ "flags" ] },
1044 mode => $mode_flags,
1045 modified_flags => $status_flags
1052 state => "exc_pinned",
1053 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
1054 out => [ "flags", "none", "none" ] },
1055 ins => [ "base", "index", "mem", "left", "right" ],
1056 outs => [ "eflags", "unused", "M" ],
1057 am => "source,binary",
1058 emit => '. cmp%M %binop',
1059 attr => "int ins_permuted, int cmp_unsigned",
1060 init_attr => "attr->data.ins_permuted = ins_permuted;\n".
1061 "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
1064 mode => $mode_flags,
1065 modified_flags => $status_flags
1070 state => "exc_pinned",
1071 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
1072 out => [ "flags", "none", "none" ] },
1073 ins => [ "base", "index", "mem", "left", "right" ],
1074 outs => [ "eflags", "unused", "M" ],
1075 am => "source,binary",
1076 emit => '. cmpb %binop',
1077 attr => "int ins_permuted, int cmp_unsigned",
1078 init_attr => "attr->data.ins_permuted = ins_permuted;\n".
1079 "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
1082 mode => $mode_flags,
1083 modified_flags => $status_flags
1088 state => "exc_pinned",
1089 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ] ,
1090 out => [ "flags", "none", "none" ] },
1091 ins => [ "base", "index", "mem", "left", "right" ],
1092 outs => [ "eflags", "unused", "M" ],
1093 am => "source,binary",
1094 emit => '. test%M %binop',
1095 attr => "int ins_permuted, int cmp_unsigned",
1096 init_attr => "attr->data.ins_permuted = ins_permuted;\n".
1097 "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
1100 mode => $mode_flags,
1101 modified_flags => $status_flags
1106 state => "exc_pinned",
1107 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
1108 out => [ "flags", "none", "none" ] },
1109 ins => [ "base", "index", "mem", "left", "right" ],
1110 outs => [ "eflags", "unused", "M" ],
1111 am => "source,binary",
1112 emit => '. testb %binop',
1113 attr => "int ins_permuted, int cmp_unsigned",
1114 init_attr => "attr->data.ins_permuted = ins_permuted;\n".
1115 "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
1118 mode => $mode_flags,
1119 modified_flags => $status_flags
1124 reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] },
1125 ins => [ "eflags" ],
1126 attr_type => "ia32_condcode_attr_t",
1127 attr => "pn_Cmp pnc, int ins_permuted",
1128 init_attr => "attr->attr.data.ins_permuted = ins_permuted;\n".
1129 "\tset_ia32_ls_mode(res, mode_Bu);\n",
1130 emit => '. set%CMP0 %DB0',
1138 state => "exc_pinned",
1139 reg_req => { in => [ "gp", "gp", "none", "eflags" ], out => [ "none" ] },
1140 ins => [ "base", "index", "mem","eflags" ],
1141 attr_type => "ia32_condcode_attr_t",
1142 attr => "pn_Cmp pnc, int ins_permuted",
1143 init_attr => "attr->attr.data.ins_permuted = ins_permuted;\n".
1144 "\tset_ia32_ls_mode(res, mode_Bu);\n",
1145 emit => '. set%CMP3 %AM',
1153 # (note: leave the false,true order intact to make it compatible with other
1155 state => "exc_pinned",
1156 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "eflags" ],
1157 out => [ "in_r4 in_r5", "flags", "none" ] },
1158 ins => [ "base", "index", "mem", "val_false", "val_true", "eflags" ],
1159 outs => [ "res", "flags", "M" ],
1160 am => "source,binary",
1161 attr_type => "ia32_condcode_attr_t",
1162 attr => "int ins_permuted, pn_Cmp pnc",
1163 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
1171 op_flags => "L|X|Y",
1172 reg_req => { in => [ "eflags" ], out => [ "none", "none" ] },
1173 ins => [ "eflags" ],
1174 outs => [ "false", "true" ],
1175 attr_type => "ia32_condcode_attr_t",
1176 attr => "pn_Cmp pnc",
1178 units => [ "BRANCH" ],
1183 op_flags => "L|X|Y",
1184 reg_req => { in => [ "gp" ] },
1186 attr_type => "ia32_condcode_attr_t",
1189 units => [ "BRANCH" ],
1190 modified_flags => $status_flags,
1191 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1197 reg_req => { out => [ "none" ] },
1199 units => [ "BRANCH" ],
1206 reg_req => { in => [ "gp", "gp", "none", "gp" ] },
1207 ins => [ "base", "index", "mem", "target" ],
1208 am => "source,unary",
1209 emit => '. jmp *%unop3',
1211 units => [ "BRANCH" ],
1213 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1219 reg_req => { out => [ "gp" ] },
1221 attr => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
1222 attr_type => "ia32_immediate_attr_t",
1229 reg_req => { out => [ "gp" ] },
1233 modified_flags => $status_flags,
1239 reg_req => { out => [ "gp_UKNWN:I" ] },
1249 reg_req => { out => [ "vfp_UKNWN:I" ] },
1254 attr_type => "ia32_x87_attr_t",
1260 reg_req => { out => [ "xmm_UKNWN:I" ] },
1269 op_flags => "c|NB|NI",
1270 reg_req => { out => [ "gp_NOREG:I" ] },
1279 op_flags => "c|NB|NI",
1280 reg_req => { out => [ "vfp_NOREG:I" ] },
1285 attr_type => "ia32_x87_attr_t",
1290 op_flags => "c|NB|NI",
1291 reg_req => { out => [ "xmm_NOREG:I" ] },
1301 reg_req => { out => [ "fpcw:I" ] },
1305 modified_flags => $fpcw_flags
1311 reg_req => { in => [ "gp", "gp", "none" ], out => [ "fpcw:I" ] },
1312 ins => [ "base", "index", "mem" ],
1314 emit => ". fldcw %AM",
1317 modified_flags => $fpcw_flags
1323 reg_req => { in => [ "gp", "gp", "none", "fp_cw" ], out => [ "none" ] },
1324 ins => [ "base", "index", "mem", "fpcw" ],
1326 emit => ". fnstcw %AM",
1334 reg_req => { in => [ "fp_cw" ], out => [ "none" ] },
1342 # we should not rematrialize this node. It has very strict constraints.
1343 reg_req => { in => [ "eax", "edx" ], out => [ "edx" ] },
1344 ins => [ "val", "clobbered" ],
1353 # Note that we add additional latency values depending on address mode, so a
1354 # lateny of 0 for load is correct
1358 state => "exc_pinned",
1359 reg_req => { in => [ "gp", "gp", "none" ],
1360 out => [ "gp", "none", "none", "none" ] },
1361 ins => [ "base", "index", "mem" ],
1362 outs => [ "res", "unused", "M", "X_exc" ],
1364 emit => ". mov%EX%.l %AM, %D0",
1370 state => "exc_pinned",
1371 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none", "none" ] },
1372 ins => [ "base", "index", "mem", "val" ],
1373 outs => [ "M", "X_exc" ],
1374 emit => '. mov%M %SI3, %AM',
1382 state => "exc_pinned",
1383 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => ["none", "none" ] },
1384 ins => [ "base", "index", "mem", "val" ],
1385 outs => [ "M", "X_exc" ],
1386 emit => '. mov%M %SB3, %AM',
1394 reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
1395 ins => [ "base", "index" ],
1396 emit => '. leal %AM, %D0',
1400 # lea doesn't modify the flags, but setting this seems advantageous since it
1401 # increases chances that the Lea is transformed back to an Add
1402 modified_flags => 1,
1406 state => "exc_pinned",
1407 reg_req => { in => [ "gp", "gp", "none", "gp", "esp" ], out => [ "esp:I|S", "none" ] },
1408 ins => [ "base", "index", "mem", "val", "stack" ],
1409 emit => '. push%M %unop3',
1410 outs => [ "stack", "M" ],
1411 am => "source,unary",
1417 state => "exc_pinned",
1418 reg_req => { in => [ "none", "esp" ], out => [ "gp", "none", "none", "esp:I|S" ] },
1419 ins => [ "mem", "stack" ],
1420 outs => [ "res", "M", "unused", "stack" ],
1421 emit => '. pop%M %D0',
1422 latency => 3, # Pop is more expensive than Push on Athlon
1427 state => "exc_pinned",
1428 reg_req => { in => [ "none", "esp" ], out => [ "ebp:I", "none", "none", "esp:I|S" ] },
1429 ins => [ "mem", "stack" ],
1430 outs => [ "res", "M", "unused", "stack" ],
1431 emit => '. pop%M %D0',
1432 latency => 3, # Pop is more expensive than Push on Athlon
1437 state => "exc_pinned",
1438 reg_req => { in => [ "gp", "gp", "none", "esp" ], out => [ "none", "none", "none", "esp:I|S" ] },
1439 ins => [ "base", "index", "mem", "stack" ],
1440 outs => [ "unused0", "M", "unused1", "stack" ],
1441 emit => '. pop%M %AM',
1442 latency => 3, # Pop is more expensive than Push on Athlon
1447 reg_req => { in => [ "esp" ], out => [ "ebp", "esp:I|S", "none" ] },
1449 outs => [ "frame", "stack", "M" ],
1455 reg_req => { in => [ "ebp" ], out => [ "ebp:I", "esp:I|S" ] },
1457 outs => [ "frame", "stack" ],
1464 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "none" ] },
1465 ins => [ "base", "index", "mem", "stack", "size" ],
1466 am => "source,binary",
1467 emit => '. addl %binop',
1469 outs => [ "stack", "M" ],
1471 modified_flags => $status_flags
1476 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "gp", "none" ] },
1477 ins => [ "base", "index", "mem", "stack", "size" ],
1478 am => "source,binary",
1479 emit => ". subl %binop\n".
1480 ". movl %%esp, %D1",
1482 outs => [ "stack", "addr", "M" ],
1484 modified_flags => $status_flags
1497 reg_req => { out => [ "gp" ] },
1503 # BT supports source address mode, but this is unused yet
1507 state => "exc_pinned",
1508 reg_req => { in => [ "gp", "gp" ], out => [ "flags" ] },
1509 ins => [ "left", "right" ],
1510 emit => '. bt%M %S1, %S0',
1513 mode => $mode_flags,
1514 modified_flags => $status_flags # only CF is set, but the other flags are undefined
1519 state => "exc_pinned",
1520 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1521 out => [ "gp", "flags", "none" ] },
1522 ins => [ "base", "index", "mem", "operand" ],
1523 outs => [ "res", "flags", "M" ],
1524 am => "source,binary",
1525 emit => '. bsf%M %unop3, %D0',
1529 modified_flags => $status_flags
1534 state => "exc_pinned",
1535 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1536 out => [ "gp", "flags", "none" ] },
1537 ins => [ "base", "index", "mem", "operand" ],
1538 outs => [ "res", "flags", "M" ],
1539 am => "source,binary",
1540 emit => '. bsr%M %unop3, %D0',
1544 modified_flags => $status_flags
1548 # SSE4.2 or SSE4a popcnt instruction
1552 state => "exc_pinned",
1553 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1554 out => [ "gp", "flags", "none" ] },
1555 ins => [ "base", "index", "mem", "operand" ],
1556 outs => [ "res", "flags", "M" ],
1557 am => "source,binary",
1558 emit => '. popcnt%M %unop3, %D0',
1562 modified_flags => $status_flags
1566 state => "exc_pinned",
1568 in => [ "gp", "gp", "none", "gp", "esp", "fpcw", "eax", "ecx", "edx" ],
1569 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" ]
1571 ins => [ "base", "index", "mem", "addr", "stack", "fpcw", "eax", "ecx", "edx" ],
1572 outs => [ "stack", "fpcw", "M", "eax", "ecx", "edx", "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" ],
1573 attr_type => "ia32_call_attr_t",
1574 attr => "unsigned pop, ir_type *call_tp",
1575 am => "source,unary",
1576 units => [ "BRANCH" ],
1577 latency => 4, # random number
1578 modified_flags => $status_flags
1582 # a Helper node for frame-climbing, needed for __builtin_(frame|return)_address
1584 # PS: try gcc __builtin_frame_address(100000) :-)
1587 reg_req => { in => [ "gp", "gp", "gp"], out => [ "in_r3" ] },
1588 ins => [ "frame", "cnt", "tmp" ],
1590 latency => 4, # random number
1591 attr_type => "ia32_climbframe_attr_t",
1592 attr => "unsigned count",
1602 reg_req => { in => [ "gp" ],
1603 out => [ "in_r1" ] },
1604 emit => '. bswap%M %S0',
1612 # bswap16, use xchg here
1616 reg_req => { in => [ "eax ebx ecx edx" ],
1617 out => [ "in_r1" ] },
1618 emit => '. xchg %SB0, %SH0',
1630 reg_req => { in => [ "none" ], out => [ "none" ] },
1639 # Undefined Instruction on ALL x86 CPU's
1643 reg_req => { in => [ "none" ], out => [ "none" ] },
1646 emit => ". .value 0x0b0f",
1657 reg_req => { in => [ "edx", "eax", "none" ], out => [ "none" ] },
1658 ins => [ "port", "value", "mem" ],
1659 emit => '. out%M %SS0, %SI1',
1663 modified_flags => $status_flags
1672 reg_req => { in => [ "edx", "none" ], out => [ "eax", "none" ] },
1673 ins => [ "port", "mem" ],
1674 outs => [ "res", "M" ],
1675 emit => '. in%M %DS0, %SS0',
1679 modified_flags => $status_flags
1683 # Intel style prefetching
1687 state => "exc_pinned",
1688 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1689 ins => [ "base", "index", "mem" ],
1692 emit => ". prefetcht0 %AM",
1698 state => "exc_pinned",
1699 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1700 ins => [ "base", "index", "mem" ],
1703 emit => ". prefetcht1 %AM",
1709 state => "exc_pinned",
1710 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1711 ins => [ "base", "index", "mem" ],
1714 emit => ". prefetcht2 %AM",
1720 state => "exc_pinned",
1721 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1722 ins => [ "base", "index", "mem" ],
1725 emit => ". prefetchnta %AM",
1730 # 3DNow! prefetch instructions
1734 state => "exc_pinned",
1735 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1736 ins => [ "base", "index", "mem" ],
1739 emit => ". prefetch %AM",
1745 state => "exc_pinned",
1746 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1747 ins => [ "base", "index", "mem" ],
1750 emit => ". prefetchw %AM",
1754 #-----------------------------------------------------------------------------#
1755 # _____ _____ ______ __ _ _ _ #
1756 # / ____/ ____| ____| / _| | | | | | #
1757 # | (___| (___ | |__ | |_| | ___ __ _| |_ _ __ ___ __| | ___ ___ #
1758 # \___ \\___ \| __| | _| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1759 # ____) |___) | |____ | | | | (_) | (_| | |_ | | | | (_) | (_| | __/\__ \ #
1760 # |_____/_____/|______| |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1761 #-----------------------------------------------------------------------------#
1766 reg_req => { out => [ "xmm" ] },
1767 emit => '. xorp%XSD %D0, %D0',
1775 reg_req => { out => [ "xmm" ] },
1776 emit => '. pxor %D0, %D0',
1782 # produces all 1 bits
1785 reg_req => { out => [ "xmm" ] },
1786 emit => '. pcmpeqb %D0, %D0',
1792 # integer shift left, dword
1795 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1796 emit => '. pslld %SI1, %D0',
1802 # integer shift left, qword
1805 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1806 emit => '. psllq %SI1, %D0',
1812 # integer shift right, dword
1815 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1816 emit => '. psrld %SI1, %D0',
1822 # mov from integer to SSE register
1825 reg_req => { in => [ "gp" ], out => [ "xmm" ] },
1826 emit => '. movd %S0, %D0',
1832 # commutative operations
1836 state => "exc_pinned",
1837 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1838 out => [ "in_r4 in_r5", "flags", "none" ] },
1839 ins => [ "base", "index", "mem", "left", "right" ],
1840 outs => [ "res", "flags", "M" ],
1841 am => "source,binary",
1842 emit => '. add%XXM %binop',
1850 state => "exc_pinned",
1851 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1852 out => [ "in_r4 in_r5", "flags", "none" ] },
1853 ins => [ "base", "index", "mem", "left", "right" ],
1854 outs => [ "res", "flags", "M" ],
1855 am => "source,binary",
1856 emit => '. mul%XXM %binop',
1864 state => "exc_pinned",
1865 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1866 out => [ "in_r4 in_r5", "flags", "none" ] },
1867 ins => [ "base", "index", "mem", "left", "right" ],
1868 outs => [ "res", "flags", "M" ],
1869 am => "source,binary",
1870 emit => '. max%XXM %binop',
1878 state => "exc_pinned",
1879 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1880 out => [ "in_r4 in_r5", "flags", "none" ] },
1881 ins => [ "base", "index", "mem", "left", "right" ],
1882 outs => [ "res", "flags", "M" ],
1883 am => "source,binary",
1884 emit => '. min%XXM %binop',
1892 state => "exc_pinned",
1893 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1894 out => [ "in_r4 in_r5", "flags", "none" ] },
1895 ins => [ "base", "index", "mem", "left", "right" ],
1896 outs => [ "res", "flags", "M" ],
1897 am => "source,binary",
1898 emit => '. andp%XSD %binop',
1906 state => "exc_pinned",
1907 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1908 out => [ "in_r4 in_r5", "flags", "none" ] },
1909 ins => [ "base", "index", "mem", "left", "right" ],
1910 outs => [ "res", "flags", "M" ],
1911 am => "source,binary",
1912 emit => '. orp%XSD %binop',
1920 state => "exc_pinned",
1921 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1922 out => [ "in_r4 in_r5", "flags", "none" ] },
1923 ins => [ "base", "index", "mem", "left", "right" ],
1924 outs => [ "res", "flags", "M" ],
1925 am => "source,binary",
1926 emit => '. xorp%XSD %binop',
1932 # not commutative operations
1936 state => "exc_pinned",
1937 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1938 out => [ "in_r4 !in_r5", "flags", "none" ] },
1939 ins => [ "base", "index", "mem", "left", "right" ],
1940 outs => [ "res", "flags", "M" ],
1941 am => "source,binary",
1942 emit => '. andnp%XSD %binop',
1950 state => "exc_pinned",
1951 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1952 out => [ "in_r4", "flags", "none" ] },
1953 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
1954 outs => [ "res", "flags", "M" ],
1955 am => "source,binary",
1956 emit => '. sub%XXM %binop',
1964 state => "exc_pinned",
1965 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1966 out => [ "in_r4 !in_r5", "flags", "none" ] },
1967 ins => [ "base", "index", "mem", "dividend", "divisor" ],
1968 outs => [ "res", "flags", "M" ],
1969 am => "source,binary",
1970 emit => '. div%XXM %binop',
1979 state => "exc_pinned",
1980 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1981 out => [ "eflags" ] },
1982 ins => [ "base", "index", "mem", "left", "right" ],
1983 outs => [ "flags" ],
1984 am => "source,binary",
1985 attr => "int ins_permuted",
1986 init_attr => "attr->data.ins_permuted = ins_permuted;",
1987 emit => ' .ucomi%XXM %binop',
1990 mode => $mode_flags,
1991 modified_flags => 1,
1998 state => "exc_pinned",
1999 reg_req => { in => [ "gp", "gp", "none" ],
2000 out => [ "xmm", "none", "none", "none" ] },
2001 ins => [ "base", "index", "mem" ],
2002 outs => [ "res", "unused", "M", "X_exc" ],
2003 emit => '. mov%XXM %AM, %D0',
2004 attr => "ir_mode *load_mode",
2005 init_attr => "attr->ls_mode = load_mode;",
2012 state => "exc_pinned",
2013 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none", "none" ] },
2014 ins => [ "base", "index", "mem", "val" ],
2015 outs => [ "M", "X_exc" ],
2016 emit => '. mov%XXM %S3, %AM',
2024 state => "exc_pinned",
2025 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none" ] },
2026 ins => [ "base", "index", "mem", "val" ],
2028 emit => '. mov%XXM %S3, %AM',
2036 state => "exc_pinned",
2037 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
2038 ins => [ "base", "index", "mem", "val" ],
2039 am => "source,unary",
2040 emit => '. cvtsi2ss %unop3, %D0',
2048 state => "exc_pinned",
2049 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
2050 ins => [ "base", "index", "mem", "val" ],
2051 am => "source,unary",
2052 emit => '. cvtsi2sd %unop3, %D0',
2061 cmp_attr => "return 1;",
2062 ins => [ "val_high", "val_low" ],
2063 reg_req => { in => [ "none", "none" ], out => [ "none" ] }
2068 cmp_attr => "return 1;",
2070 outs => [ "res_high", "res_low" ],
2071 reg_req => { in => [ "none" ], out => [ "none", "none" ] }
2079 reg_req => { in => [ "edi", "esi", "ecx", "none" ], out => [ "edi", "esi", "ecx", "none" ] },
2080 outs => [ "DST", "SRC", "CNT", "M" ],
2081 attr_type => "ia32_copyb_attr_t",
2082 attr => "unsigned size",
2085 # we don't care about this flag, so no need to mark this node
2086 # modified_flags => [ "DF" ]
2092 reg_req => { in => [ "edi", "esi", "none" ], out => [ "edi", "esi", "none" ] },
2093 outs => [ "DST", "SRC", "M" ],
2094 attr_type => "ia32_copyb_attr_t",
2095 attr => "unsigned size",
2098 # we don't care about this flag, so no need to mark this node
2099 # modified_flags => [ "DF" ]
2105 state => "exc_pinned",
2106 reg_req => { in => [ "eax" ], out => [ "eax" ] },
2116 state => "exc_pinned",
2117 reg_req => { in => [ "gp", "gp", "none", "gp" ],
2118 out => [ "gp", "none", "none" ] },
2119 ins => [ "base", "index", "mem", "val" ],
2120 outs => [ "res", "flags", "M" ],
2121 am => "source,unary",
2124 attr => "ir_mode *smaller_mode",
2125 init_attr => "attr->ls_mode = smaller_mode;",
2130 state => "exc_pinned",
2131 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ],
2132 out => [ "gp", "none", "none" ] },
2133 ins => [ "base", "index", "mem", "val" ],
2134 outs => [ "res", "flags", "M" ],
2135 am => "source,unary",
2138 attr => "ir_mode *smaller_mode",
2139 init_attr => "attr->ls_mode = smaller_mode;",
2144 state => "exc_pinned",
2145 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm", "none" ] },
2146 ins => [ "base", "index", "mem", "val" ],
2147 am => "source,unary",
2154 state => "exc_pinned",
2155 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "gp", "none" ] },
2156 ins => [ "base", "index", "mem", "val" ],
2157 am => "source,unary",
2164 state => "exc_pinned",
2165 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "xmm", "none" ] },
2166 ins => [ "base", "index", "mem", "val" ],
2167 am => "source,unary",
2173 #----------------------------------------------------------#
2175 # (_) | | | | / _| | | | #
2176 # __ ___ _ __| |_ _ _ __ _| | | |_| | ___ __ _| |_ #
2177 # \ \ / / | '__| __| | | |/ _` | | | _| |/ _ \ / _` | __| #
2178 # \ V /| | | | |_| |_| | (_| | | | | | | (_) | (_| | |_ #
2179 # \_/ |_|_| \__|\__,_|\__,_|_| |_| |_|\___/ \__,_|\__| #
2181 # _ __ ___ __| | ___ ___ #
2182 # | '_ \ / _ \ / _` |/ _ \/ __| #
2183 # | | | | (_) | (_| | __/\__ \ #
2184 # |_| |_|\___/ \__,_|\___||___/ #
2185 #----------------------------------------------------------#
2187 # rematerialisation disabled for all float nodes for now, because the fpcw
2188 # handler runs before spilling and we might end up with wrong fpcw then
2192 state => "exc_pinned",
2193 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2194 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2195 am => "source,binary",
2199 attr_type => "ia32_x87_attr_t",
2204 state => "exc_pinned",
2205 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2206 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2207 am => "source,binary",
2211 attr_type => "ia32_x87_attr_t",
2216 state => "exc_pinned",
2217 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2218 ins => [ "base", "index", "mem", "minuend", "subtrahend", "fpcw" ],
2219 am => "source,binary",
2223 attr_type => "ia32_x87_attr_t",
2227 state => "exc_pinned",
2228 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ], out => [ "vfp", "none" ] },
2229 ins => [ "base", "index", "mem", "dividend", "divisor", "fpcw" ],
2230 am => "source,binary",
2231 outs => [ "res", "M" ],
2234 attr_type => "ia32_x87_attr_t",
2238 reg_req => { in => [ "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2239 ins => [ "left", "right", "fpcw" ],
2243 attr_type => "ia32_x87_attr_t",
2248 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2253 attr_type => "ia32_x87_attr_t",
2258 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2263 attr_type => "ia32_x87_attr_t",
2266 # virtual Load and Store
2271 state => "exc_pinned",
2272 reg_req => { in => [ "gp", "gp", "none" ],
2273 out => [ "vfp", "none", "none", "none" ] },
2274 ins => [ "base", "index", "mem" ],
2275 outs => [ "res", "unused", "M", "X_exc" ],
2276 attr => "ir_mode *load_mode",
2277 init_attr => "attr->attr.ls_mode = load_mode;",
2280 attr_type => "ia32_x87_attr_t",
2286 state => "exc_pinned",
2287 reg_req => { in => [ "gp", "gp", "none", "vfp" ],
2288 out => [ "none", "none" ] },
2289 ins => [ "base", "index", "mem", "val" ],
2290 outs => [ "M", "X_exc" ],
2291 attr => "ir_mode *store_mode",
2292 init_attr => "attr->attr.ls_mode = store_mode;",
2296 attr_type => "ia32_x87_attr_t",
2302 state => "exc_pinned",
2303 reg_req => { in => [ "gp", "gp", "none" ],
2304 out => [ "vfp", "none", "none" ] },
2305 outs => [ "res", "unused", "M" ],
2306 ins => [ "base", "index", "mem" ],
2309 attr_type => "ia32_x87_attr_t",
2313 state => "exc_pinned",
2314 reg_req => { in => [ "gp", "gp", "none", "vfp", "fpcw" ], out => [ "none" ] },
2315 ins => [ "base", "index", "mem", "val", "fpcw" ],
2320 attr_type => "ia32_x87_attr_t",
2323 # SSE3 fisttp instruction
2325 state => "exc_pinned",
2326 reg_req => { in => [ "gp", "gp", "none", "vfp" ], out => [ "in_r4", "none" ]},
2327 ins => [ "base", "index", "mem", "val" ],
2328 outs => [ "res", "M" ],
2331 attr_type => "ia32_x87_attr_t",
2339 reg_req => { out => [ "vfp" ] },
2344 attr_type => "ia32_x87_attr_t",
2349 reg_req => { out => [ "vfp" ] },
2354 attr_type => "ia32_x87_attr_t",
2359 reg_req => { out => [ "vfp" ] },
2364 attr_type => "ia32_x87_attr_t",
2369 reg_req => { out => [ "vfp" ] },
2374 attr_type => "ia32_x87_attr_t",
2379 reg_req => { out => [ "vfp" ] },
2384 attr_type => "ia32_x87_attr_t",
2389 reg_req => { out => [ "vfp" ] },
2394 attr_type => "ia32_x87_attr_t",
2399 reg_req => { out => [ "vfp" ] },
2404 attr_type => "ia32_x87_attr_t",
2410 # we can't allow to rematerialize this node so we don't have
2411 # accidently produce Phi(Fucom, Fucom(ins_permuted))
2413 reg_req => { in => [ "vfp", "vfp" ], out => [ "eax" ] },
2414 ins => [ "left", "right" ],
2415 outs => [ "flags" ],
2416 attr => "int ins_permuted",
2417 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2420 attr_type => "ia32_x87_attr_t",
2426 reg_req => { in => [ "vfp", "vfp" ], out => [ "eflags" ] },
2427 ins => [ "left", "right" ],
2428 outs => [ "flags" ],
2429 attr => "int ins_permuted",
2430 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2433 attr_type => "ia32_x87_attr_t",
2439 reg_req => { in => [ "vfp" ], out => [ "eax" ] },
2441 outs => [ "flags" ],
2442 attr => "int ins_permuted",
2443 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2446 attr_type => "ia32_x87_attr_t",
2452 reg_req => { in => [ "eax" ], out => [ "eflags" ] },
2454 outs => [ "flags" ],
2458 mode => $mode_flags,
2461 #------------------------------------------------------------------------#
2462 # ___ _____ __ _ _ _ #
2463 # __ _( _ )___ | / _| | ___ __ _| |_ _ __ ___ __| | ___ ___ #
2464 # \ \/ / _ \ / / | |_| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
2465 # > < (_) |/ / | _| | (_) | (_| | |_ | | | | (_) | (_| | __/\__ \ #
2466 # /_/\_\___//_/ |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
2467 #------------------------------------------------------------------------#
2469 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
2470 # are swapped, we work this around in the emitter...
2473 state => "exc_pinned",
2474 rd_constructor => "NONE",
2476 emit => '. fadd%XM %x87_binop',
2478 attr_type => "ia32_x87_attr_t",
2482 state => "exc_pinned",
2483 rd_constructor => "NONE",
2485 emit => '. faddp%XM %x87_binop',
2487 attr_type => "ia32_x87_attr_t",
2491 state => "exc_pinned",
2492 rd_constructor => "NONE",
2494 emit => '. fmul%XM %x87_binop',
2496 attr_type => "ia32_x87_attr_t",
2500 state => "exc_pinned",
2501 rd_constructor => "NONE",
2503 emit => '. fmulp%XM %x87_binop',,
2505 attr_type => "ia32_x87_attr_t",
2509 state => "exc_pinned",
2510 rd_constructor => "NONE",
2512 emit => '. fsub%XM %x87_binop',
2514 attr_type => "ia32_x87_attr_t",
2518 state => "exc_pinned",
2519 rd_constructor => "NONE",
2521 # see note about gas bugs
2522 emit => '. fsubrp%XM %x87_binop',
2524 attr_type => "ia32_x87_attr_t",
2528 state => "exc_pinned",
2529 rd_constructor => "NONE",
2532 emit => '. fsubr%XM %x87_binop',
2534 attr_type => "ia32_x87_attr_t",
2538 state => "exc_pinned",
2539 rd_constructor => "NONE",
2542 # see note about gas bugs
2543 emit => '. fsubp%XM %x87_binop',
2545 attr_type => "ia32_x87_attr_t",
2549 rd_constructor => "NONE",
2553 attr_type => "ia32_x87_attr_t",
2556 # this node is just here, to keep the simulator running
2557 # we can omit this when a fprem simulation function exists
2559 rd_constructor => "NONE",
2561 emit => '. fprem1\n'.
2564 attr_type => "ia32_x87_attr_t",
2568 state => "exc_pinned",
2569 rd_constructor => "NONE",
2571 emit => '. fdiv%XM %x87_binop',
2573 attr_type => "ia32_x87_attr_t",
2577 state => "exc_pinned",
2578 rd_constructor => "NONE",
2580 # see note about gas bugs
2581 emit => '. fdivrp%XM %x87_binop',
2583 attr_type => "ia32_x87_attr_t",
2587 state => "exc_pinned",
2588 rd_constructor => "NONE",
2590 emit => '. fdivr%XM %x87_binop',
2592 attr_type => "ia32_x87_attr_t",
2596 state => "exc_pinned",
2597 rd_constructor => "NONE",
2599 # see note about gas bugs
2600 emit => '. fdivp%XM %x87_binop',
2602 attr_type => "ia32_x87_attr_t",
2606 rd_constructor => "NONE",
2610 attr_type => "ia32_x87_attr_t",
2615 rd_constructor => "NONE",
2619 attr_type => "ia32_x87_attr_t",
2622 # x87 Load and Store
2625 rd_constructor => "NONE",
2626 op_flags => "R|L|F",
2627 state => "exc_pinned",
2629 emit => '. fld%XM %AM',
2630 attr_type => "ia32_x87_attr_t",
2635 rd_constructor => "NONE",
2636 op_flags => "R|L|F",
2637 state => "exc_pinned",
2639 emit => '. fst%XM %AM',
2641 attr_type => "ia32_x87_attr_t",
2646 rd_constructor => "NONE",
2647 op_flags => "R|L|F",
2648 state => "exc_pinned",
2650 emit => '. fstp%XM %AM',
2652 attr_type => "ia32_x87_attr_t",
2659 state => "exc_pinned",
2660 rd_constructor => "NONE",
2662 emit => '. fild%XM %AM',
2663 attr_type => "ia32_x87_attr_t",
2668 state => "exc_pinned",
2669 rd_constructor => "NONE",
2671 emit => '. fist%XM %AM',
2673 attr_type => "ia32_x87_attr_t",
2678 state => "exc_pinned",
2679 rd_constructor => "NONE",
2681 emit => '. fistp%XM %AM',
2683 attr_type => "ia32_x87_attr_t",
2687 # SSE3 fisttp instruction
2689 state => "exc_pinned",
2690 rd_constructor => "NONE",
2692 emit => '. fisttp%XM %AM',
2694 attr_type => "ia32_x87_attr_t",
2701 op_flags => "R|c|K",
2703 reg_req => { out => [ "vfp" ] },
2705 attr_type => "ia32_x87_attr_t",
2710 op_flags => "R|c|K",
2712 reg_req => { out => [ "vfp" ] },
2714 attr_type => "ia32_x87_attr_t",
2719 op_flags => "R|c|K",
2721 reg_req => { out => [ "vfp" ] },
2723 attr_type => "ia32_x87_attr_t",
2728 op_flags => "R|c|K",
2730 reg_req => { out => [ "vfp" ] },
2732 attr_type => "ia32_x87_attr_t",
2737 op_flags => "R|c|K",
2739 reg_req => { out => [ "vfp" ] },
2741 attr_type => "ia32_x87_attr_t",
2746 op_flags => "R|c|K",
2748 reg_req => { out => [ "vfp" ] },
2749 emit => '. fldll2t',
2750 attr_type => "ia32_x87_attr_t",
2755 op_flags => "R|c|K",
2757 reg_req => { out => [ "vfp" ] },
2759 attr_type => "ia32_x87_attr_t",
2764 # Note that it is NEVER allowed to do CSE on these nodes
2765 # Moreover, note the virtual register requierements!
2769 reg_req => { out => [ "none" ] },
2770 cmp_attr => "return 1;",
2771 emit => '. fxch %X0',
2772 attr_type => "ia32_x87_attr_t",
2779 reg_req => { out => [ "none" ] },
2780 cmp_attr => "return 1;",
2781 emit => '. fld %X0',
2782 attr_type => "ia32_x87_attr_t",
2788 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2789 cmp_attr => "return 1;",
2790 emit => '. fld %X0',
2791 attr_type => "ia32_x87_attr_t",
2797 reg_req => { out => [ "none" ] },
2798 cmp_attr => "return 1;",
2799 emit => '. fstp %X0',
2800 attr_type => "ia32_x87_attr_t",
2807 reg_req => { out => [ "none" ] },
2808 cmp_attr => "return 1;",
2809 emit => '. ffreep %X0',
2810 attr_type => "ia32_x87_attr_t",
2817 reg_req => { out => [ "none" ] },
2818 cmp_attr => "return 1;",
2820 attr_type => "ia32_x87_attr_t",
2827 reg_req => { out => [ "none" ] },
2828 cmp_attr => "return 1;",
2830 attr_type => "ia32_x87_attr_t",
2839 emit => ". fucom %X1\n".
2841 attr_type => "ia32_x87_attr_t",
2847 emit => ". fucomp %X1\n".
2849 attr_type => "ia32_x87_attr_t",
2855 emit => ". fucompp\n".
2857 attr_type => "ia32_x87_attr_t",
2863 emit => '. fucomi %X1',
2864 attr_type => "ia32_x87_attr_t",
2870 emit => '. fucompi %X1',
2871 attr_type => "ia32_x87_attr_t",
2879 attr_type => "ia32_x87_attr_t",
2884 # -------------------------------------------------------------------------------- #
2885 # ____ ____ _____ _ _ #
2886 # / ___/ ___|| ____| __ _____ ___| |_ ___ _ __ _ __ ___ __| | ___ ___ #
2887 # \___ \___ \| _| \ \ / / _ \/ __| __/ _ \| '__| | '_ \ / _ \ / _` |/ _ \/ __| #
2888 # ___) |__) | |___ \ V / __/ (__| || (_) | | | | | | (_) | (_| | __/\__ \ #
2889 # |____/____/|_____| \_/ \___|\___|\__\___/|_| |_| |_|\___/ \__,_|\___||___/ #
2891 # -------------------------------------------------------------------------------- #
2894 # Spilling and reloading of SSE registers, hardcoded, not generated #
2898 state => "exc_pinned",
2899 reg_req => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2900 emit => '. movdqu %D0, %AM',
2901 outs => [ "res", "M" ],
2908 state => "exc_pinned",
2909 reg_req => { in => [ "gp", "gp", "none", "xmm" ] },
2910 ins => [ "base", "index", "mem", "val" ],
2911 emit => '. movdqu %binop',
2919 # Include the generated SIMD node specification written by the SIMD optimization
2920 $my_script_name = dirname($myname) . "/../ia32/ia32_simd_spec.pl";
2921 unless ($return = do $my_script_name) {
2922 warn "couldn't parse $my_script_name: $@" if $@;
2923 warn "couldn't do $my_script_name: $!" unless defined $return;
2924 warn "couldn't run $my_script_name" unless $return;
2927 # Transform some attributes
2928 foreach my $op (keys(%nodes)) {
2929 my $node = $nodes{$op};
2930 my $op_attr_init = $node->{op_attr_init};
2932 if(defined($op_attr_init)) {
2933 $op_attr_init .= "\n\t";
2938 if(!defined($node->{latency})) {
2940 $node->{latency} = 0;
2942 die("Latency missing for op $op");
2945 $op_attr_init .= "attr->latency = ".$node->{latency} . ";";
2947 $node->{op_attr_init} = $op_attr_init;