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" ] },
598 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
599 outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
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" ] },
612 ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
613 outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
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 cmp_attr => "return 1;",
648 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
649 ins => [ "val", "count", "dep" ],
653 irn_flags => [ "rematerializable" ],
654 reg_req => { in => [ "gp", "gp", "ecx" ],
655 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
656 ins => [ "val_high", "val_low", "count" ],
657 outs => [ "res", "flags" ],
658 emit => ". shld%M %SB2, %S1, %D0",
662 modified_flags => $status_flags
666 cmp_attr => "return 1;",
667 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
668 ins => [ "val_high", "val_low", "count" ],
672 irn_flags => [ "rematerializable" ],
673 reg_req => { in => [ "gp", "ecx" ],
674 out => [ "in_r1 !in_r2", "flags" ] },
675 ins => [ "val", "count" ],
676 outs => [ "res", "flags" ],
677 emit => '. shr%M %SB1, %S0',
681 modified_flags => $status_flags
685 irn_flags => [ "rematerializable" ],
686 state => "exc_pinned",
687 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
688 ins => [ "base", "index", "mem", "count" ],
689 emit => '. shr%M %SB3, %AM',
693 modified_flags => $status_flags
697 cmp_attr => "return 1;",
698 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
699 ins => [ "val", "count", "dep" ],
703 irn_flags => [ "rematerializable" ],
704 reg_req => { in => [ "gp", "gp", "ecx" ],
705 out => [ "in_r1 !in_r2 !in_r3", "flags" ] },
706 ins => [ "val_high", "val_low", "count" ],
707 outs => [ "res", "flags" ],
708 emit => ". shrd%M %SB2, %S1, %D0",
712 modified_flags => $status_flags
716 cmp_attr => "return 1;",
717 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
718 ins => [ "val_high", "val_low", "count" ],
722 irn_flags => [ "rematerializable" ],
723 reg_req => { in => [ "gp", "ecx" ],
724 out => [ "in_r1 !in_r2", "flags" ] },
725 ins => [ "val", "count" ],
726 outs => [ "res", "flags" ],
727 emit => '. sar%M %SB1, %S0',
731 modified_flags => $status_flags
735 irn_flags => [ "rematerializable" ],
736 state => "exc_pinned",
737 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
738 ins => [ "base", "index", "mem", "count" ],
739 emit => '. sar%M %SB3, %AM',
743 modified_flags => $status_flags
747 cmp_attr => "return 1;",
748 ins => [ "val", "count", "dep" ],
749 reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
753 irn_flags => [ "rematerializable" ],
754 reg_req => { in => [ "gp", "ecx" ],
755 out => [ "in_r1 !in_r2", "flags" ] },
756 ins => [ "val", "count" ],
757 outs => [ "res", "flags" ],
758 emit => '. ror%M %SB1, %S0',
762 modified_flags => $status_flags
766 irn_flags => [ "rematerializable" ],
767 state => "exc_pinned",
768 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
769 ins => [ "base", "index", "mem", "count" ],
770 emit => '. ror%M %SB3, %AM',
774 modified_flags => $status_flags
778 irn_flags => [ "rematerializable" ],
779 reg_req => { in => [ "gp", "ecx" ],
780 out => [ "in_r1 !in_r2", "flags" ] },
781 ins => [ "val", "count" ],
782 outs => [ "res", "flags" ],
783 emit => '. rol%M %SB1, %S0',
787 modified_flags => $status_flags
791 irn_flags => [ "rematerializable" ],
792 state => "exc_pinned",
793 reg_req => { in => [ "gp", "gp", "none", "ecx" ], out => [ "none" ] },
794 ins => [ "base", "index", "mem", "count" ],
795 emit => '. rol%M %SB3, %AM',
799 modified_flags => $status_flags
803 irn_flags => [ "rematerializable" ],
804 reg_req => { in => [ "gp" ],
805 out => [ "in_r1", "flags" ] },
806 emit => '. neg%M %S0',
808 outs => [ "res", "flags" ],
812 modified_flags => $status_flags
816 irn_flags => [ "rematerializable" ],
817 state => "exc_pinned",
818 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
819 ins => [ "base", "index", "mem" ],
820 emit => '. neg%M %AM',
824 modified_flags => $status_flags
828 irn_flags => [ "rematerializable" ],
829 reg_req => { in => [ "gp", "gp" ], out => [ "in_r1", "in_r2" ] },
830 outs => [ "low_res", "high_res" ],
833 modified_flags => $status_flags
838 irn_flags => [ "rematerializable" ],
839 reg_req => { in => [ "gp" ],
840 out => [ "in_r1", "flags" ] },
842 outs => [ "res", "flags" ],
843 emit => '. inc%M %S0',
847 modified_flags => $status_flags_wo_cf
851 irn_flags => [ "rematerializable" ],
852 state => "exc_pinned",
853 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
854 ins => [ "base", "index", "mem" ],
855 emit => '. inc%M %AM',
859 modified_flags => $status_flags_wo_cf
863 irn_flags => [ "rematerializable" ],
864 reg_req => { in => [ "gp" ],
865 out => [ "in_r1", "flags" ] },
867 outs => [ "res", "flags" ],
868 emit => '. dec%M %S0',
872 modified_flags => $status_flags_wo_cf
876 irn_flags => [ "rematerializable" ],
877 state => "exc_pinned",
878 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
879 ins => [ "base", "index", "mem" ],
880 emit => '. dec%M %AM',
884 modified_flags => $status_flags_wo_cf
888 irn_flags => [ "rematerializable" ],
889 reg_req => { in => [ "gp" ],
890 out => [ "in_r1" ] },
893 emit => '. not%M %S0',
901 irn_flags => [ "rematerializable" ],
902 state => "exc_pinned",
903 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
904 ins => [ "base", "index", "mem" ],
905 emit => '. not%M %AM',
913 reg_req => { in => [ "flags" ], out => [ "flags" ] },
918 modified_flags => $status_flags
922 reg_req => { out => [ "flags" ] },
927 modified_flags => $status_flags
931 irn_flags => [ "rematerializable" ],
932 state => "exc_pinned",
933 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ],
934 out => [ "flags", "none", "none" ] },
935 ins => [ "base", "index", "mem", "left", "right" ],
936 outs => [ "eflags", "unused", "M" ],
937 am => "source,binary",
938 emit => '. cmp%M %binop',
939 attr => "bool ins_permuted",
940 init_attr => "attr->data.ins_permuted = ins_permuted;",
944 modified_flags => $status_flags
948 irn_flags => [ "rematerializable" ],
949 state => "exc_pinned",
950 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
951 out => [ "flags", "none", "none" ] },
952 ins => [ "base", "index", "mem", "left", "right" ],
953 outs => [ "eflags", "unused", "M" ],
954 am => "source,binary",
955 emit => '. cmpb %binop',
956 attr => "bool ins_permuted",
957 init_attr => "attr->data.ins_permuted = ins_permuted;",
961 modified_flags => $status_flags
965 irn_flags => [ "rematerializable" ],
966 state => "exc_pinned",
967 reg_req => { in => [ "eax ebx ecx edx" ],
968 out => [ "in_r1", "flags" ] },
969 emit => '. xorb %SH0, %SB0',
971 outs => [ "res", "flags" ],
975 modified_flags => $status_flags,
979 irn_flags => [ "rematerializable" ],
980 state => "exc_pinned",
981 reg_req => { in => [ "gp", "gp", "none", "gp", "gp" ] ,
982 out => [ "flags", "none", "none" ] },
983 ins => [ "base", "index", "mem", "left", "right" ],
984 outs => [ "eflags", "unused", "M" ],
985 am => "source,binary",
986 emit => '. test%M %binop',
987 attr => "bool ins_permuted",
988 init_attr => "attr->data.ins_permuted = ins_permuted;",
992 modified_flags => $status_flags
996 irn_flags => [ "rematerializable" ],
997 state => "exc_pinned",
998 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx", "eax ebx ecx edx" ] ,
999 out => [ "flags", "none", "none" ] },
1000 ins => [ "base", "index", "mem", "left", "right" ],
1001 outs => [ "eflags", "unused", "M" ],
1002 am => "source,binary",
1003 emit => '. testb %binop',
1004 attr => "bool ins_permuted",
1005 init_attr => "attr->data.ins_permuted = ins_permuted;",
1008 mode => $mode_flags,
1009 modified_flags => $status_flags
1013 #irn_flags => [ "rematerializable" ],
1014 reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] },
1015 ins => [ "eflags" ],
1017 attr_type => "ia32_condcode_attr_t",
1018 attr => "ia32_condition_code_t condition_code",
1019 # The way we handle Setcc with float nodes (potentially) destroys the flags
1020 # (when we emit the setX; setp; orb and the setX;setnp;andb sequences)
1021 init_attr => "set_ia32_ls_mode(res, mode_Bu);\n"
1022 . "\tif (condition_code & ia32_cc_additional_float_cases) {\n"
1023 . "\t\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n"
1024 . "\t\t/* attr->latency = 3; */\n"
1032 #irn_flags => [ "rematerializable" ],
1033 state => "exc_pinned",
1034 reg_req => { in => [ "gp", "gp", "none", "eflags" ], out => [ "none" ] },
1035 ins => [ "base", "index", "mem","eflags" ],
1036 attr_type => "ia32_condcode_attr_t",
1037 attr => "ia32_condition_code_t condition_code",
1038 init_attr => "set_ia32_ls_mode(res, mode_Bu);\n",
1039 emit => '. set%CMP3 %AM',
1046 #irn_flags => [ "rematerializable" ],
1047 state => "exc_pinned",
1048 # (note: leave the false,true order intact to make it compatible with other
1050 reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "eflags" ],
1051 out => [ "in_r4 in_r5", "flags", "none" ] },
1052 ins => [ "base", "index", "mem", "val_false", "val_true", "eflags" ],
1053 outs => [ "res", "flags", "M" ],
1054 am => "source,binary",
1055 attr_type => "ia32_condcode_attr_t",
1056 attr => "ia32_condition_code_t condition_code",
1064 op_flags => [ "labeled", "cfopcode", "forking" ],
1065 reg_req => { in => [ "eflags" ], out => [ "none", "none" ] },
1066 ins => [ "eflags" ],
1067 outs => [ "false", "true" ],
1068 attr_type => "ia32_condcode_attr_t",
1069 attr => "ia32_condition_code_t condition_code",
1071 units => [ "BRANCH" ],
1076 op_flags => [ "labeled", "cfopcode", "forking" ],
1077 reg_req => { in => [ "gp" ] },
1079 attr_type => "ia32_switch_attr_t",
1080 attr => "long default_pn",
1082 units => [ "BRANCH" ],
1083 modified_flags => $status_flags,
1084 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1089 irn_flags => [ "simple_jump" ],
1090 op_flags => [ "cfopcode" ],
1091 reg_req => { out => [ "none" ] },
1093 units => [ "BRANCH" ],
1099 op_flags => [ "cfopcode" ],
1100 reg_req => { in => [ "gp", "gp", "none", "gp" ] },
1101 ins => [ "base", "index", "mem", "target" ],
1102 am => "source,unary",
1103 emit => '. jmp *%unop3',
1105 units => [ "BRANCH" ],
1107 init_attr => "info->out_infos = NULL;", # XXX ugly hack for out requirements
1111 op_flags => [ "constlike" ],
1112 irn_flags => [ "rematerializable" ],
1113 reg_req => { out => [ "gp" ] },
1115 attr => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
1116 attr_type => "ia32_immediate_attr_t",
1122 op_flags => [ "constlike" ],
1123 irn_flags => [ "rematerializable" ],
1124 reg_req => { out => [ "gp" ] },
1131 op_flags => [ "constlike" ],
1132 reg_req => { out => [ "gp" ] },
1136 modified_flags => $status_flags,
1141 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1142 irn_flags => [ "not_scheduled" ],
1143 reg_req => { out => [ "gp_NOREG:I" ] },
1152 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1153 irn_flags => [ "not_scheduled" ],
1154 reg_req => { out => [ "vfp_NOREG:I" ] },
1159 attr_type => "ia32_x87_attr_t",
1164 op_flags => [ "constlike", "dump_noblock", "dump_noinput" ],
1165 irn_flags => [ "not_scheduled" ],
1166 reg_req => { out => [ "xmm_NOREG:I" ] },
1175 op_flags => [ "constlike" ],
1176 irn_flags => [ "not_scheduled" ],
1177 reg_req => { out => [ "fpcw:I" ] },
1181 modified_flags => $fpcw_flags
1185 op_flags => [ "fragile", "labeled" ],
1187 reg_req => { in => [ "gp", "gp", "none" ], out => [ "fpcw:I" ] },
1188 ins => [ "base", "index", "mem" ],
1190 emit => ". fldcw %AM",
1193 modified_flags => $fpcw_flags
1197 op_flags => [ "fragile", "labeled" ],
1199 reg_req => { in => [ "gp", "gp", "none", "fp_cw" ], out => [ "none" ] },
1200 ins => [ "base", "index", "mem", "fpcw" ],
1202 emit => ". fnstcw %AM",
1208 op_flags => [ "fragile", "labeled" ],
1210 reg_req => { in => [ "fp_cw" ], out => [ "none" ] },
1218 # we should not rematrialize this node. It has very strict constraints.
1219 reg_req => { in => [ "eax", "edx" ], out => [ "edx" ] },
1220 ins => [ "val", "clobbered" ],
1229 # Note that we add additional latency values depending on address mode, so a
1230 # lateny of 0 for load is correct
1233 op_flags => [ "fragile", "labeled" ],
1234 state => "exc_pinned",
1235 reg_req => { in => [ "gp", "gp", "none" ],
1236 out => [ "gp", "none", "none", "none" ] },
1237 ins => [ "base", "index", "mem" ],
1238 outs => [ "res", "unused", "M", "X_exc" ],
1240 emit => ". mov%EX%.l %AM, %D0",
1245 op_flags => [ "fragile", "labeled" ],
1246 state => "exc_pinned",
1247 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "none", "none" ] },
1248 ins => [ "base", "index", "mem", "val" ],
1249 outs => [ "M", "X_exc" ],
1250 emit => '. mov%M %SI3, %AM',
1257 op_flags => [ "fragile", "labeled" ],
1258 state => "exc_pinned",
1259 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ], out => ["none", "none" ] },
1260 ins => [ "base", "index", "mem", "val" ],
1261 outs => [ "M", "X_exc" ],
1262 emit => '. mov%M %SB3, %AM',
1269 irn_flags => [ "rematerializable" ],
1270 reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
1271 ins => [ "base", "index" ],
1272 emit => '. leal %AM, %D0',
1276 # lea doesn't modify the flags, but setting this seems advantageous since it
1277 # increases chances that the Lea is transformed back to an Add
1278 modified_flags => 1,
1282 state => "exc_pinned",
1283 reg_req => { in => [ "gp", "gp", "none", "gp", "esp" ], out => [ "esp:I|S", "none" ] },
1284 ins => [ "base", "index", "mem", "val", "stack" ],
1285 emit => '. push%M %unop3',
1286 outs => [ "stack", "M" ],
1287 am => "source,unary",
1293 state => "exc_pinned",
1294 reg_req => { in => [ "esp" ], out => [ "esp:I|S" ] },
1296 outs => [ "stack" ],
1297 emit => '. pushl %%eax',
1304 state => "exc_pinned",
1305 reg_req => { in => [ "none", "esp" ], out => [ "gp", "none", "none", "esp:I|S" ] },
1306 ins => [ "mem", "stack" ],
1307 outs => [ "res", "M", "unused", "stack" ],
1308 emit => '. pop%M %D0',
1309 latency => 3, # Pop is more expensive than Push on Athlon
1314 state => "exc_pinned",
1315 reg_req => { in => [ "none", "esp" ], out => [ "ebp:I", "none", "none", "esp:I|S" ] },
1316 ins => [ "mem", "stack" ],
1317 outs => [ "res", "M", "unused", "stack" ],
1318 emit => '. pop%M %D0',
1319 latency => 3, # Pop is more expensive than Push on Athlon
1324 state => "exc_pinned",
1325 reg_req => { in => [ "gp", "gp", "none", "esp" ], out => [ "none", "none", "none", "esp:I|S" ] },
1326 ins => [ "base", "index", "mem", "stack" ],
1327 outs => [ "unused0", "M", "unused1", "stack" ],
1328 emit => '. pop%M %AM',
1329 latency => 3, # Pop is more expensive than Push on Athlon
1334 reg_req => { in => [ "esp" ], out => [ "ebp", "esp:I|S", "none" ] },
1336 outs => [ "frame", "stack", "M" ],
1342 reg_req => { in => [ "ebp" ], out => [ "ebp:I", "esp:I|S" ] },
1344 outs => [ "frame", "stack" ],
1347 state => "exc_pinned",
1352 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "none" ] },
1353 ins => [ "base", "index", "mem", "stack", "size" ],
1354 am => "source,binary",
1355 emit => '. addl %binop',
1357 outs => [ "stack", "M" ],
1359 modified_flags => $status_flags
1364 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "gp", "none" ] },
1365 ins => [ "base", "index", "mem", "stack", "size" ],
1366 am => "source,binary",
1367 emit => ". subl %binop\n".
1368 ". movl %%esp, %D1",
1370 outs => [ "stack", "addr", "M" ],
1372 modified_flags => $status_flags
1376 op_flags => [ "keep" ],
1384 irn_flags => [ "rematerializable" ],
1385 reg_req => { out => [ "gp" ] },
1387 emit => ". movl %%gs:0, %D0",
1393 # BT supports source address mode, but this is unused yet
1396 irn_flags => [ "rematerializable" ],
1397 state => "exc_pinned",
1398 reg_req => { in => [ "gp", "gp" ], out => [ "flags" ] },
1399 ins => [ "left", "right" ],
1400 emit => '. bt%M %S1, %S0',
1403 mode => $mode_flags,
1404 modified_flags => $status_flags # only CF is set, but the other flags are undefined
1408 irn_flags => [ "rematerializable" ],
1409 state => "exc_pinned",
1410 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1411 out => [ "gp", "flags", "none" ] },
1412 ins => [ "base", "index", "mem", "operand" ],
1413 outs => [ "res", "flags", "M" ],
1414 am => "source,binary",
1415 emit => '. bsf%M %unop3, %D0',
1419 modified_flags => $status_flags
1423 irn_flags => [ "rematerializable" ],
1424 state => "exc_pinned",
1425 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1426 out => [ "gp", "flags", "none" ] },
1427 ins => [ "base", "index", "mem", "operand" ],
1428 outs => [ "res", "flags", "M" ],
1429 am => "source,binary",
1430 emit => '. bsr%M %unop3, %D0',
1434 modified_flags => $status_flags
1438 # SSE4.2 or SSE4a popcnt instruction
1441 irn_flags => [ "rematerializable" ],
1442 state => "exc_pinned",
1443 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1444 out => [ "gp", "flags", "none" ] },
1445 ins => [ "base", "index", "mem", "operand" ],
1446 outs => [ "res", "flags", "M" ],
1447 am => "source,binary",
1448 emit => '. popcnt%M %unop3, %D0',
1452 modified_flags => $status_flags
1456 state => "exc_pinned",
1458 in => [ "gp", "gp", "none", "gp", "esp", "fpcw", "eax", "ecx", "edx" ],
1459 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" ]
1461 ins => [ "base", "index", "mem", "addr", "stack", "fpcw", "eax", "ecx", "edx" ],
1462 outs => [ "stack", "fpcw", "M", "eax", "ecx", "edx", "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" ],
1463 attr_type => "ia32_call_attr_t",
1464 attr => "unsigned pop, ir_type *call_tp",
1465 am => "source,unary",
1466 units => [ "BRANCH" ],
1467 latency => 4, # random number
1468 modified_flags => $status_flags
1472 # a Helper node for frame-climbing, needed for __builtin_(frame|return)_address
1474 # PS: try gcc __builtin_frame_address(100000) :-)
1477 reg_req => { in => [ "gp", "gp", "gp"], out => [ "in_r3" ] },
1478 ins => [ "frame", "cnt", "tmp" ],
1480 latency => 4, # random number
1481 attr_type => "ia32_climbframe_attr_t",
1482 attr => "unsigned count",
1491 irn_flags => [ "rematerializable" ],
1492 reg_req => { in => [ "gp" ],
1493 out => [ "in_r1" ] },
1494 emit => '. bswap%M %S0',
1502 # bswap16, use xchg here
1505 irn_flags => [ "rematerializable" ],
1506 reg_req => { in => [ "eax ebx ecx edx" ],
1507 out => [ "in_r1" ] },
1508 emit => '. xchg %SB0, %SH0',
1520 reg_req => { in => [ "none" ], out => [ "none" ] },
1529 # Undefined Instruction on ALL x86 CPU's
1533 reg_req => { in => [ "none" ], out => [ "none" ] },
1536 emit => ". .value 0x0b0f",
1545 irn_flags => [ "rematerializable" ],
1547 reg_req => { in => [ "edx", "eax", "none" ], out => [ "none" ] },
1548 ins => [ "port", "value", "mem" ],
1549 emit => '. out%M %SS0, %SI1',
1553 modified_flags => $status_flags
1560 irn_flags => [ "rematerializable" ],
1562 reg_req => { in => [ "edx", "none" ], out => [ "eax", "none" ] },
1563 ins => [ "port", "mem" ],
1564 outs => [ "res", "M" ],
1565 emit => '. in%M %DS0, %SS0',
1569 modified_flags => $status_flags
1573 # Intel style prefetching
1576 op_flags => [ "fragile", "labeled" ],
1577 state => "exc_pinned",
1578 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1579 ins => [ "base", "index", "mem" ],
1582 emit => ". prefetcht0 %AM",
1587 op_flags => [ "fragile", "labeled" ],
1588 state => "exc_pinned",
1589 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1590 ins => [ "base", "index", "mem" ],
1593 emit => ". prefetcht1 %AM",
1598 op_flags => [ "fragile", "labeled" ],
1599 state => "exc_pinned",
1600 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1601 ins => [ "base", "index", "mem" ],
1604 emit => ". prefetcht2 %AM",
1609 op_flags => [ "fragile", "labeled" ],
1610 state => "exc_pinned",
1611 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1612 ins => [ "base", "index", "mem" ],
1615 emit => ". prefetchnta %AM",
1620 # 3DNow! prefetch instructions
1623 op_flags => [ "fragile", "labeled" ],
1624 state => "exc_pinned",
1625 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1626 ins => [ "base", "index", "mem" ],
1629 emit => ". prefetch %AM",
1634 op_flags => [ "fragile", "labeled" ],
1635 state => "exc_pinned",
1636 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1637 ins => [ "base", "index", "mem" ],
1640 emit => ". prefetchw %AM",
1646 irn_flags => [ "rematerializable" ],
1647 reg_req => { out => [ "xmm" ] },
1648 emit => '. xorp%XSD %D0, %D0',
1655 op_flags => [ "constlike" ],
1656 irn_flags => [ "rematerializable" ],
1657 reg_req => { out => [ "xmm" ] },
1664 irn_flags => [ "rematerializable" ],
1665 reg_req => { out => [ "xmm" ] },
1666 emit => '. pxor %D0, %D0',
1672 # produces all 1 bits
1674 irn_flags => [ "rematerializable" ],
1675 reg_req => { out => [ "xmm" ] },
1676 emit => '. pcmpeqb %D0, %D0',
1682 # integer shift left, dword
1684 irn_flags => [ "rematerializable" ],
1685 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1686 emit => '. pslld %SI1, %D0',
1692 # integer shift left, qword
1694 irn_flags => [ "rematerializable" ],
1695 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1696 emit => '. psllq %SI1, %D0',
1702 # integer shift right, dword
1704 irn_flags => [ "rematerializable" ],
1705 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1706 emit => '. psrld %SI1, %D0',
1712 # mov from integer to SSE register
1714 irn_flags => [ "rematerializable" ],
1715 reg_req => { in => [ "gp" ], out => [ "xmm" ] },
1716 emit => '. movd %S0, %D0',
1723 irn_flags => [ "rematerializable" ],
1724 state => "exc_pinned",
1725 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1726 out => [ "in_r4 in_r5", "flags", "none" ] },
1727 ins => [ "base", "index", "mem", "left", "right" ],
1728 outs => [ "res", "flags", "M" ],
1729 am => "source,binary",
1730 emit => '. add%XXM %binop',
1737 irn_flags => [ "rematerializable" ],
1738 state => "exc_pinned",
1739 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1740 out => [ "in_r4 in_r5", "flags", "none" ] },
1741 ins => [ "base", "index", "mem", "left", "right" ],
1742 outs => [ "res", "flags", "M" ],
1743 am => "source,binary",
1744 emit => '. mul%XXM %binop',
1751 irn_flags => [ "rematerializable" ],
1752 state => "exc_pinned",
1753 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1754 out => [ "in_r4 in_r5", "flags", "none" ] },
1755 ins => [ "base", "index", "mem", "left", "right" ],
1756 outs => [ "res", "flags", "M" ],
1757 am => "source,binary",
1758 emit => '. max%XXM %binop',
1765 irn_flags => [ "rematerializable" ],
1766 state => "exc_pinned",
1767 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1768 out => [ "in_r4 in_r5", "flags", "none" ] },
1769 ins => [ "base", "index", "mem", "left", "right" ],
1770 outs => [ "res", "flags", "M" ],
1771 am => "source,binary",
1772 emit => '. min%XXM %binop',
1779 irn_flags => [ "rematerializable" ],
1780 state => "exc_pinned",
1781 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1782 out => [ "in_r4 in_r5", "flags", "none" ] },
1783 ins => [ "base", "index", "mem", "left", "right" ],
1784 outs => [ "res", "flags", "M" ],
1785 am => "source,binary",
1786 emit => '. andp%XSD %binop',
1793 irn_flags => [ "rematerializable" ],
1794 state => "exc_pinned",
1795 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1796 out => [ "in_r4 in_r5", "flags", "none" ] },
1797 ins => [ "base", "index", "mem", "left", "right" ],
1798 outs => [ "res", "flags", "M" ],
1799 am => "source,binary",
1800 emit => '. orp%XSD %binop',
1807 irn_flags => [ "rematerializable" ],
1808 state => "exc_pinned",
1809 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1810 out => [ "in_r4 in_r5", "flags", "none" ] },
1811 ins => [ "base", "index", "mem", "left", "right" ],
1812 outs => [ "res", "flags", "M" ],
1813 am => "source,binary",
1814 emit => '. xorp%XSD %binop',
1821 irn_flags => [ "rematerializable" ],
1822 state => "exc_pinned",
1823 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1824 out => [ "in_r4 !in_r5", "flags", "none" ] },
1825 ins => [ "base", "index", "mem", "left", "right" ],
1826 outs => [ "res", "flags", "M" ],
1827 am => "source,binary",
1828 emit => '. andnp%XSD %binop',
1835 irn_flags => [ "rematerializable" ],
1836 state => "exc_pinned",
1837 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1838 out => [ "in_r4", "flags", "none" ] },
1839 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
1840 outs => [ "res", "flags", "M" ],
1841 am => "source,binary",
1842 emit => '. sub%XXM %binop',
1849 irn_flags => [ "rematerializable" ],
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", "dividend", "divisor" ],
1854 outs => [ "res", "flags", "M" ],
1855 am => "source,binary",
1856 emit => '. div%XXM %binop',
1862 irn_flags => [ "rematerializable" ],
1863 state => "exc_pinned",
1864 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1865 out => [ "eflags" ] },
1866 ins => [ "base", "index", "mem", "left", "right" ],
1867 outs => [ "flags" ],
1868 am => "source,binary",
1869 attr => "bool ins_permuted",
1870 init_attr => "attr->data.ins_permuted = ins_permuted;",
1871 emit => ' .ucomi%XXM %binop',
1874 mode => $mode_flags,
1875 modified_flags => 1,
1879 op_flags => [ "fragile", "labeled" ],
1880 state => "exc_pinned",
1881 reg_req => { in => [ "gp", "gp", "none" ],
1882 out => [ "xmm", "none", "none", "none" ] },
1883 ins => [ "base", "index", "mem" ],
1884 outs => [ "res", "unused", "M", "X_exc" ],
1885 emit => '. mov%XXM %AM, %D0',
1886 attr => "ir_mode *load_mode",
1887 init_attr => "attr->ls_mode = load_mode;",
1893 op_flags => [ "fragile", "labeled" ],
1894 state => "exc_pinned",
1895 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none", "none" ] },
1896 ins => [ "base", "index", "mem", "val" ],
1897 outs => [ "M", "X_exc" ],
1898 emit => '. mov%XXM %S3, %AM',
1905 op_flags => [ "fragile", "labeled" ],
1906 state => "exc_pinned",
1907 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none" ] },
1908 ins => [ "base", "index", "mem", "val" ],
1910 emit => '. mov%XXM %S3, %AM',
1917 op_flags => [ "fragile", "labeled" ],
1918 state => "exc_pinned",
1919 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1920 ins => [ "base", "index", "mem", "val" ],
1921 am => "source,unary",
1922 emit => '. cvtsi2ss %unop3, %D0',
1929 op_flags => [ "fragile", "labeled" ],
1930 state => "exc_pinned",
1931 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1932 ins => [ "base", "index", "mem", "val" ],
1933 am => "source,unary",
1934 emit => '. cvtsi2sd %unop3, %D0',
1942 op_flags => [ "fragile", "labeled" ],
1943 cmp_attr => "return 1;",
1944 ins => [ "val_high", "val_low" ],
1945 reg_req => { in => [ "none", "none" ], out => [ "none" ] }
1949 op_flags => [ "fragile", "labeled" ],
1950 cmp_attr => "return 1;",
1952 outs => [ "res_high", "res_low" ],
1953 reg_req => { in => [ "none" ], out => [ "none", "none" ] }
1957 op_flags => [ "fragile" ],
1959 reg_req => { in => [ "edi", "esi", "ecx", "none" ], out => [ "edi", "esi", "ecx", "none" ] },
1960 outs => [ "DST", "SRC", "CNT", "M" ],
1961 attr_type => "ia32_copyb_attr_t",
1962 attr => "unsigned size",
1965 # we don't care about this flag, so no need to mark this node
1966 # modified_flags => [ "DF" ]
1970 op_flags => [ "fragile" ],
1972 reg_req => { in => [ "edi", "esi", "none" ], out => [ "edi", "esi", "none" ] },
1973 outs => [ "DST", "SRC", "M" ],
1974 attr_type => "ia32_copyb_attr_t",
1975 attr => "unsigned size",
1978 # we don't care about this flag, so no need to mark this node
1979 # modified_flags => [ "DF" ]
1983 state => "exc_pinned",
1984 reg_req => { in => [ "eax" ], out => [ "eax" ] },
1994 state => "exc_pinned",
1995 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1996 out => [ "gp", "none", "none" ] },
1997 ins => [ "base", "index", "mem", "val" ],
1998 outs => [ "res", "flags", "M" ],
1999 am => "source,unary",
2002 attr => "ir_mode *smaller_mode",
2003 init_attr => "attr->ls_mode = smaller_mode;",
2008 state => "exc_pinned",
2009 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ],
2010 out => [ "gp", "none", "none" ] },
2011 ins => [ "base", "index", "mem", "val" ],
2012 outs => [ "res", "flags", "M" ],
2013 am => "source,unary",
2016 attr => "ir_mode *smaller_mode",
2017 init_attr => "attr->ls_mode = smaller_mode;",
2022 state => "exc_pinned",
2023 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm", "none" ] },
2024 ins => [ "base", "index", "mem", "val" ],
2025 am => "source,unary",
2032 state => "exc_pinned",
2033 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "gp", "none" ] },
2034 ins => [ "base", "index", "mem", "val" ],
2035 am => "source,unary",
2042 state => "exc_pinned",
2043 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "xmm", "none" ] },
2044 ins => [ "base", "index", "mem", "val" ],
2045 am => "source,unary",
2051 # rematerialisation disabled for all float nodes for now, because the fpcw
2052 # handler runs before spilling and we might end up with wrong fpcw then
2055 # irn_flags => [ "rematerializable" ],
2056 state => "exc_pinned",
2057 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2058 out => [ "vfp", "none", "none" ] },
2059 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2060 outs => [ "res", "dummy", "M" ],
2061 am => "source,binary",
2065 attr_type => "ia32_x87_attr_t",
2069 # irn_flags => [ "rematerializable" ],
2070 state => "exc_pinned",
2071 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2072 out => [ "vfp", "none", "none" ] },
2073 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2074 outs => [ "res", "dummy", "M" ],
2075 am => "source,binary",
2079 attr_type => "ia32_x87_attr_t",
2083 # irn_flags => [ "rematerializable" ],
2084 state => "exc_pinned",
2085 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2086 out => [ "vfp", "none", "none" ] },
2087 ins => [ "base", "index", "mem", "minuend", "subtrahend", "fpcw" ],
2088 outs => [ "res", "dummy", "M" ],
2089 am => "source,binary",
2093 attr_type => "ia32_x87_attr_t",
2097 state => "exc_pinned",
2098 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2099 out => [ "vfp", "none", "none" ] },
2100 ins => [ "base", "index", "mem", "dividend", "divisor", "fpcw" ],
2101 outs => [ "res", "dummy", "M" ],
2102 am => "source,binary",
2105 attr_type => "ia32_x87_attr_t",
2109 reg_req => { in => [ "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2110 ins => [ "left", "right", "fpcw" ],
2114 attr_type => "ia32_x87_attr_t",
2118 irn_flags => [ "rematerializable" ],
2119 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2124 attr_type => "ia32_x87_attr_t",
2128 irn_flags => [ "rematerializable" ],
2129 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2134 attr_type => "ia32_x87_attr_t",
2138 irn_flags => [ "rematerializable" ],
2139 op_flags => [ "fragile", "labeled" ],
2140 state => "exc_pinned",
2141 reg_req => { in => [ "gp", "gp", "none" ],
2142 out => [ "vfp", "none", "none", "none" ] },
2143 ins => [ "base", "index", "mem" ],
2144 outs => [ "res", "unused", "M", "X_exc" ],
2145 attr => "ir_mode *load_mode",
2146 init_attr => "attr->attr.ls_mode = load_mode;",
2149 attr_type => "ia32_x87_attr_t",
2153 irn_flags => [ "rematerializable" ],
2154 op_flags => [ "fragile", "labeled" ],
2155 state => "exc_pinned",
2156 reg_req => { in => [ "gp", "gp", "none", "vfp" ],
2157 out => [ "none", "none" ] },
2158 ins => [ "base", "index", "mem", "val" ],
2159 outs => [ "M", "X_exc" ],
2160 attr => "ir_mode *store_mode",
2161 init_attr => "attr->attr.ls_mode = store_mode;",
2165 attr_type => "ia32_x87_attr_t",
2169 state => "exc_pinned",
2170 reg_req => { in => [ "gp", "gp", "none" ],
2171 out => [ "vfp", "none", "none" ] },
2172 outs => [ "res", "unused", "M" ],
2173 ins => [ "base", "index", "mem" ],
2176 attr_type => "ia32_x87_attr_t",
2180 state => "exc_pinned",
2181 reg_req => { in => [ "gp", "gp", "none", "vfp", "fpcw" ], out => [ "none" ] },
2182 ins => [ "base", "index", "mem", "val", "fpcw" ],
2187 attr_type => "ia32_x87_attr_t",
2190 # SSE3 fisttp instruction
2192 state => "exc_pinned",
2193 reg_req => { in => [ "gp", "gp", "none", "vfp" ], out => [ "in_r4", "none" ]},
2194 ins => [ "base", "index", "mem", "val" ],
2195 outs => [ "res", "M" ],
2198 attr_type => "ia32_x87_attr_t",
2202 irn_flags => [ "rematerializable" ],
2203 reg_req => { out => [ "vfp" ] },
2208 attr_type => "ia32_x87_attr_t",
2212 irn_flags => [ "rematerializable" ],
2213 reg_req => { out => [ "vfp" ] },
2218 attr_type => "ia32_x87_attr_t",
2222 irn_flags => [ "rematerializable" ],
2223 reg_req => { out => [ "vfp" ] },
2228 attr_type => "ia32_x87_attr_t",
2232 irn_flags => [ "rematerializable" ],
2233 reg_req => { out => [ "vfp" ] },
2238 attr_type => "ia32_x87_attr_t",
2242 irn_flags => [ "rematerializable" ],
2243 reg_req => { out => [ "vfp" ] },
2248 attr_type => "ia32_x87_attr_t",
2252 irn_flags => [ "rematerializable" ],
2253 reg_req => { out => [ "vfp" ] },
2258 attr_type => "ia32_x87_attr_t",
2262 irn_flags => [ "rematerializable" ],
2263 reg_req => { out => [ "vfp" ] },
2268 attr_type => "ia32_x87_attr_t",
2272 # we can't allow to rematerialize this node so we don't
2273 # accidently produce Phi(Fucom, Fucom(ins_permuted))
2274 # irn_flags => [ "rematerializable" ],
2275 reg_req => { in => [ "vfp", "vfp" ], out => [ "eax" ] },
2276 ins => [ "left", "right" ],
2277 outs => [ "flags" ],
2278 attr => "bool ins_permuted",
2279 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2282 attr_type => "ia32_x87_attr_t",
2287 irn_flags => [ "rematerializable" ],
2288 reg_req => { in => [ "vfp", "vfp" ], out => [ "eflags" ] },
2289 ins => [ "left", "right" ],
2290 outs => [ "flags" ],
2291 attr => "bool ins_permuted",
2292 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2295 attr_type => "ia32_x87_attr_t",
2300 # irn_flags => [ "rematerializable" ],
2301 reg_req => { in => [ "vfp" ], out => [ "eax" ] },
2303 outs => [ "flags" ],
2304 attr => "bool ins_permuted",
2305 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2308 attr_type => "ia32_x87_attr_t",
2313 irn_flags => [ "rematerializable" ],
2314 reg_req => { in => [ "eax" ], out => [ "eflags" ] },
2316 outs => [ "flags" ],
2320 mode => $mode_flags,
2324 state => "exc_pinned",
2325 emit => '. fadd%XM %x87_binop',
2327 attr_type => "ia32_x87_attr_t",
2332 state => "exc_pinned",
2333 emit => '. faddp%XM %x87_binop',
2335 attr_type => "ia32_x87_attr_t",
2340 state => "exc_pinned",
2341 emit => '. fmul%XM %x87_binop',
2343 attr_type => "ia32_x87_attr_t",
2348 state => "exc_pinned",
2349 emit => '. fmulp%XM %x87_binop',,
2351 attr_type => "ia32_x87_attr_t",
2356 state => "exc_pinned",
2357 emit => '. fsub%XM %x87_binop',
2359 attr_type => "ia32_x87_attr_t",
2363 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
2364 # are swapped, we work this around in the emitter...
2367 state => "exc_pinned",
2368 # see note about gas bugs
2369 emit => '. fsubrp%XM %x87_binop',
2371 attr_type => "ia32_x87_attr_t",
2376 state => "exc_pinned",
2377 irn_flags => [ "rematerializable" ],
2378 emit => '. fsubr%XM %x87_binop',
2380 attr_type => "ia32_x87_attr_t",
2385 state => "exc_pinned",
2386 irn_flags => [ "rematerializable" ],
2387 # see note about gas bugs before fsubp
2388 emit => '. fsubp%XM %x87_binop',
2390 attr_type => "ia32_x87_attr_t",
2397 attr_type => "ia32_x87_attr_t",
2401 # this node is just here, to keep the simulator running
2402 # we can omit this when a fprem simulation function exists
2404 emit => '. fprem1\n'.
2407 attr_type => "ia32_x87_attr_t",
2412 state => "exc_pinned",
2413 emit => '. fdiv%XM %x87_binop',
2415 attr_type => "ia32_x87_attr_t",
2420 state => "exc_pinned",
2421 # see note about gas bugs before fsubp
2422 emit => '. fdivrp%XM %x87_binop',
2424 attr_type => "ia32_x87_attr_t",
2429 state => "exc_pinned",
2430 emit => '. fdivr%XM %x87_binop',
2432 attr_type => "ia32_x87_attr_t",
2437 state => "exc_pinned",
2438 # see note about gas bugs before fsubp
2439 emit => '. fdivp%XM %x87_binop',
2441 attr_type => "ia32_x87_attr_t",
2448 attr_type => "ia32_x87_attr_t",
2453 op_flags => [ "keep" ],
2454 irn_flags => [ "rematerializable" ],
2457 attr_type => "ia32_x87_attr_t",
2462 irn_flags => [ "rematerializable" ],
2463 op_flags => [ "fragile", "labeled" ],
2464 state => "exc_pinned",
2465 emit => '. fld%XM %AM',
2466 attr_type => "ia32_x87_attr_t",
2472 irn_flags => [ "rematerializable" ],
2473 op_flags => [ "fragile", "labeled" ],
2474 state => "exc_pinned",
2475 emit => '. fst%XM %AM',
2477 attr_type => "ia32_x87_attr_t",
2483 irn_flags => [ "rematerializable" ],
2484 op_flags => [ "fragile", "labeled" ],
2485 state => "exc_pinned",
2486 emit => '. fstp%XM %AM',
2488 attr_type => "ia32_x87_attr_t",
2494 state => "exc_pinned",
2495 emit => '. fild%XM %AM',
2496 attr_type => "ia32_x87_attr_t",
2502 state => "exc_pinned",
2503 emit => '. fist%XM %AM',
2505 attr_type => "ia32_x87_attr_t",
2511 state => "exc_pinned",
2512 emit => '. fistp%XM %AM',
2514 attr_type => "ia32_x87_attr_t",
2519 # SSE3 fisttp instruction
2521 state => "exc_pinned",
2522 emit => '. fisttp%XM %AM',
2524 attr_type => "ia32_x87_attr_t",
2530 op_flags => [ "constlike", "keep" ],
2531 irn_flags => [ "rematerializable" ],
2532 reg_req => { out => [ "vfp" ] },
2534 attr_type => "ia32_x87_attr_t",
2539 op_flags => [ "constlike", "keep" ],
2540 irn_flags => [ "rematerializable" ],
2541 reg_req => { out => [ "vfp" ] },
2543 attr_type => "ia32_x87_attr_t",
2548 op_flags => [ "constlike", "keep" ],
2549 irn_flags => [ "rematerializable" ],
2550 reg_req => { out => [ "vfp" ] },
2552 attr_type => "ia32_x87_attr_t",
2557 op_flags => [ "constlike", "keep" ],
2558 irn_flags => [ "rematerializable" ],
2559 reg_req => { out => [ "vfp" ] },
2561 attr_type => "ia32_x87_attr_t",
2566 op_flags => [ "constlike", "keep" ],
2567 irn_flags => [ "rematerializable" ],
2568 reg_req => { out => [ "vfp" ] },
2570 attr_type => "ia32_x87_attr_t",
2575 op_flags => [ "constlike", "keep" ],
2576 irn_flags => [ "rematerializable" ],
2577 reg_req => { out => [ "vfp" ] },
2578 emit => '. fldll2t',
2579 attr_type => "ia32_x87_attr_t",
2584 op_flags => [ "constlike", "keep" ],
2585 irn_flags => [ "rematerializable" ],
2586 reg_req => { out => [ "vfp" ] },
2588 attr_type => "ia32_x87_attr_t",
2593 # Note that it is NEVER allowed to do CSE on these nodes
2594 # Moreover, note the virtual register requierements!
2597 op_flags => [ "keep" ],
2598 reg_req => { out => [ "none" ] },
2599 cmp_attr => "return 1;",
2600 emit => '. fxch %X0',
2601 attr_type => "ia32_x87_attr_t",
2607 op_flags => [ "keep" ],
2608 reg_req => { out => [ "none" ] },
2609 cmp_attr => "return 1;",
2610 emit => '. fld %X0',
2611 attr_type => "ia32_x87_attr_t",
2617 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2618 cmp_attr => "return 1;",
2619 emit => '. fld %X0',
2620 attr_type => "ia32_x87_attr_t",
2625 op_flags => [ "keep" ],
2626 reg_req => { out => [ "none" ] },
2627 cmp_attr => "return 1;",
2628 emit => '. fstp %X0',
2629 attr_type => "ia32_x87_attr_t",
2635 op_flags => [ "keep" ],
2636 reg_req => { out => [ "none" ] },
2637 cmp_attr => "return 1;",
2638 emit => '. ffreep %X0',
2639 attr_type => "ia32_x87_attr_t",
2645 op_flags => [ "keep" ],
2646 reg_req => { out => [ "none" ] },
2647 cmp_attr => "return 1;",
2649 attr_type => "ia32_x87_attr_t",
2655 op_flags => [ "keep" ],
2656 reg_req => { out => [ "none" ] },
2657 cmp_attr => "return 1;",
2659 attr_type => "ia32_x87_attr_t",
2666 emit => ". fucom %X1\n".
2668 attr_type => "ia32_x87_attr_t",
2674 emit => ". fucomp %X1\n".
2676 attr_type => "ia32_x87_attr_t",
2682 emit => ". fucompp\n".
2684 attr_type => "ia32_x87_attr_t",
2690 emit => '. fucomi %X1',
2691 attr_type => "ia32_x87_attr_t",
2697 emit => '. fucompi %X1',
2698 attr_type => "ia32_x87_attr_t",
2706 attr_type => "ia32_x87_attr_t",
2710 # Spilling and reloading of SSE registers, hardcoded, not generated #
2713 op_flags => [ "fragile", "labeled" ],
2714 state => "exc_pinned",
2715 reg_req => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2716 emit => '. movdqu %D0, %AM',
2717 outs => [ "res", "M" ],
2723 op_flags => [ "fragile", "labeled" ],
2724 state => "exc_pinned",
2725 reg_req => { in => [ "gp", "gp", "none", "xmm" ] },
2726 ins => [ "base", "index", "mem", "val" ],
2727 emit => '. movdqu %binop',
2735 # Transform some attributes
2736 foreach my $op (keys(%nodes)) {
2737 my $node = $nodes{$op};
2738 my $op_attr_init = $node->{op_attr_init};
2740 if(defined($op_attr_init)) {
2741 $op_attr_init .= "\n\t";
2746 if(!defined($node->{latency})) {
2748 $node->{latency} = 0;
2750 die("Latency missing for op $op");
2753 $op_attr_init .= "attr->latency = ".$node->{latency} . ";";
2755 $node->{op_attr_init} = $op_attr_init;