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", "unknown_jump" ],
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 => [ "ebp" ], out => [ "esp:I|S" ] },
1328 emit => '. movl %S0, %D0',
1335 state => "exc_pinned",
1336 reg_req => { in => [ "gp", "gp", "none", "esp" ], out => [ "none", "none", "none", "esp:I|S" ] },
1337 ins => [ "base", "index", "mem", "stack" ],
1338 outs => [ "unused0", "M", "unused1", "stack" ],
1339 emit => '. pop%M %AM',
1340 latency => 3, # Pop is more expensive than Push on Athlon
1345 reg_req => { in => [ "esp" ], out => [ "ebp", "esp:I|S", "none" ] },
1347 outs => [ "frame", "stack", "M" ],
1353 reg_req => { in => [ "ebp" ], out => [ "ebp:I", "esp:I|S" ] },
1355 outs => [ "frame", "stack" ],
1358 state => "exc_pinned",
1363 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "none" ] },
1364 ins => [ "base", "index", "mem", "stack", "size" ],
1365 am => "source,binary",
1366 emit => '. addl %binop',
1368 outs => [ "stack", "M" ],
1370 modified_flags => $status_flags
1375 reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp:I|S", "gp", "none" ] },
1376 ins => [ "base", "index", "mem", "stack", "size" ],
1377 am => "source,binary",
1378 emit => ". subl %binop\n".
1379 ". movl %%esp, %D1",
1381 outs => [ "stack", "addr", "M" ],
1383 modified_flags => $status_flags
1387 op_flags => [ "keep" ],
1395 irn_flags => [ "rematerializable" ],
1396 reg_req => { out => [ "gp" ] },
1398 emit => ". movl %%gs:0, %D0",
1404 # BT supports source address mode, but this is unused yet
1407 irn_flags => [ "rematerializable" ],
1408 state => "exc_pinned",
1409 reg_req => { in => [ "gp", "gp" ], out => [ "flags" ] },
1410 ins => [ "left", "right" ],
1411 emit => '. bt%M %S1, %S0',
1414 mode => $mode_flags,
1415 modified_flags => $status_flags # only CF is set, but the other flags are undefined
1419 irn_flags => [ "rematerializable" ],
1420 state => "exc_pinned",
1421 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1422 out => [ "gp", "flags", "none" ] },
1423 ins => [ "base", "index", "mem", "operand" ],
1424 outs => [ "res", "flags", "M" ],
1425 am => "source,binary",
1426 emit => '. bsf%M %unop3, %D0',
1430 modified_flags => $status_flags
1434 irn_flags => [ "rematerializable" ],
1435 state => "exc_pinned",
1436 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1437 out => [ "gp", "flags", "none" ] },
1438 ins => [ "base", "index", "mem", "operand" ],
1439 outs => [ "res", "flags", "M" ],
1440 am => "source,binary",
1441 emit => '. bsr%M %unop3, %D0',
1445 modified_flags => $status_flags
1449 # SSE4.2 or SSE4a popcnt instruction
1452 irn_flags => [ "rematerializable" ],
1453 state => "exc_pinned",
1454 reg_req => { in => [ "gp", "gp", "none", "gp" ],
1455 out => [ "gp", "flags", "none" ] },
1456 ins => [ "base", "index", "mem", "operand" ],
1457 outs => [ "res", "flags", "M" ],
1458 am => "source,binary",
1459 emit => '. popcnt%M %unop3, %D0',
1463 modified_flags => $status_flags
1467 state => "exc_pinned",
1469 in => [ "gp", "gp", "none", "gp", "esp", "fpcw", "eax", "ecx", "edx" ],
1470 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" ]
1472 ins => [ "base", "index", "mem", "addr", "stack", "fpcw", "eax", "ecx", "edx" ],
1473 outs => [ "stack", "fpcw", "M", "eax", "ecx", "edx", "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" ],
1474 attr_type => "ia32_call_attr_t",
1475 attr => "unsigned pop, ir_type *call_tp",
1476 am => "source,unary",
1477 units => [ "BRANCH" ],
1478 latency => 4, # random number
1479 modified_flags => $status_flags
1483 # a Helper node for frame-climbing, needed for __builtin_(frame|return)_address
1485 # PS: try gcc __builtin_frame_address(100000) :-)
1488 reg_req => { in => [ "gp", "gp", "gp"], out => [ "in_r3" ] },
1489 ins => [ "frame", "cnt", "tmp" ],
1491 latency => 4, # random number
1492 attr_type => "ia32_climbframe_attr_t",
1493 attr => "unsigned count",
1502 irn_flags => [ "rematerializable" ],
1503 reg_req => { in => [ "gp" ],
1504 out => [ "in_r1" ] },
1505 emit => '. bswap%M %S0',
1513 # bswap16, use xchg here
1516 irn_flags => [ "rematerializable" ],
1517 reg_req => { in => [ "eax ebx ecx edx" ],
1518 out => [ "in_r1" ] },
1519 emit => '. xchg %SB0, %SH0',
1531 reg_req => { in => [ "none" ], out => [ "none" ] },
1540 # Undefined Instruction on ALL x86 CPU's
1544 reg_req => { in => [ "none" ], out => [ "none" ] },
1547 emit => ". .value 0x0b0f",
1556 irn_flags => [ "rematerializable" ],
1558 reg_req => { in => [ "edx", "eax", "none" ], out => [ "none" ] },
1559 ins => [ "port", "value", "mem" ],
1560 emit => '. out%M %SS0, %SI1',
1564 modified_flags => $status_flags
1571 irn_flags => [ "rematerializable" ],
1573 reg_req => { in => [ "edx", "none" ], out => [ "eax", "none" ] },
1574 ins => [ "port", "mem" ],
1575 outs => [ "res", "M" ],
1576 emit => '. in%M %DS0, %SS0',
1580 modified_flags => $status_flags
1584 # Intel style prefetching
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 => ". prefetcht0 %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 => ". prefetcht1 %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 => ". prefetcht2 %AM",
1620 op_flags => [ "fragile", "labeled" ],
1621 state => "exc_pinned",
1622 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1623 ins => [ "base", "index", "mem" ],
1626 emit => ". prefetchnta %AM",
1631 # 3DNow! prefetch instructions
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 => ". prefetch %AM",
1645 op_flags => [ "fragile", "labeled" ],
1646 state => "exc_pinned",
1647 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
1648 ins => [ "base", "index", "mem" ],
1651 emit => ". prefetchw %AM",
1657 irn_flags => [ "rematerializable" ],
1658 reg_req => { out => [ "xmm" ] },
1659 emit => '. xorp%XSD %D0, %D0',
1666 op_flags => [ "constlike" ],
1667 irn_flags => [ "rematerializable" ],
1668 reg_req => { out => [ "xmm" ] },
1675 irn_flags => [ "rematerializable" ],
1676 reg_req => { out => [ "xmm" ] },
1677 emit => '. pxor %D0, %D0',
1683 # produces all 1 bits
1685 irn_flags => [ "rematerializable" ],
1686 reg_req => { out => [ "xmm" ] },
1687 emit => '. pcmpeqb %D0, %D0',
1693 # integer shift left, dword
1695 irn_flags => [ "rematerializable" ],
1696 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1697 emit => '. pslld %SI1, %D0',
1703 # integer shift left, qword
1705 irn_flags => [ "rematerializable" ],
1706 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1707 emit => '. psllq %SI1, %D0',
1713 # integer shift right, dword
1715 irn_flags => [ "rematerializable" ],
1716 reg_req => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
1717 emit => '. psrld %SI1, %D0',
1723 # mov from integer to SSE register
1725 irn_flags => [ "rematerializable" ],
1726 reg_req => { in => [ "gp" ], out => [ "xmm" ] },
1727 emit => '. movd %S0, %D0',
1734 irn_flags => [ "rematerializable" ],
1735 state => "exc_pinned",
1736 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1737 out => [ "in_r4 in_r5", "flags", "none" ] },
1738 ins => [ "base", "index", "mem", "left", "right" ],
1739 outs => [ "res", "flags", "M" ],
1740 am => "source,binary",
1741 emit => '. add%XXM %binop',
1748 irn_flags => [ "rematerializable" ],
1749 state => "exc_pinned",
1750 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1751 out => [ "in_r4 in_r5", "flags", "none" ] },
1752 ins => [ "base", "index", "mem", "left", "right" ],
1753 outs => [ "res", "flags", "M" ],
1754 am => "source,binary",
1755 emit => '. mul%XXM %binop',
1762 irn_flags => [ "rematerializable" ],
1763 state => "exc_pinned",
1764 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1765 out => [ "in_r4 in_r5", "flags", "none" ] },
1766 ins => [ "base", "index", "mem", "left", "right" ],
1767 outs => [ "res", "flags", "M" ],
1768 am => "source,binary",
1769 emit => '. max%XXM %binop',
1776 irn_flags => [ "rematerializable" ],
1777 state => "exc_pinned",
1778 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1779 out => [ "in_r4 in_r5", "flags", "none" ] },
1780 ins => [ "base", "index", "mem", "left", "right" ],
1781 outs => [ "res", "flags", "M" ],
1782 am => "source,binary",
1783 emit => '. min%XXM %binop',
1790 irn_flags => [ "rematerializable" ],
1791 state => "exc_pinned",
1792 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1793 out => [ "in_r4 in_r5", "flags", "none" ] },
1794 ins => [ "base", "index", "mem", "left", "right" ],
1795 outs => [ "res", "flags", "M" ],
1796 am => "source,binary",
1797 emit => '. andp%XSD %binop',
1804 irn_flags => [ "rematerializable" ],
1805 state => "exc_pinned",
1806 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1807 out => [ "in_r4 in_r5", "flags", "none" ] },
1808 ins => [ "base", "index", "mem", "left", "right" ],
1809 outs => [ "res", "flags", "M" ],
1810 am => "source,binary",
1811 emit => '. orp%XSD %binop',
1818 irn_flags => [ "rematerializable" ],
1819 state => "exc_pinned",
1820 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1821 out => [ "in_r4 in_r5", "flags", "none" ] },
1822 ins => [ "base", "index", "mem", "left", "right" ],
1823 outs => [ "res", "flags", "M" ],
1824 am => "source,binary",
1825 emit => '. xorp%XSD %binop',
1832 irn_flags => [ "rematerializable" ],
1833 state => "exc_pinned",
1834 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1835 out => [ "in_r4 !in_r5", "flags", "none" ] },
1836 ins => [ "base", "index", "mem", "left", "right" ],
1837 outs => [ "res", "flags", "M" ],
1838 am => "source,binary",
1839 emit => '. andnp%XSD %binop',
1846 irn_flags => [ "rematerializable" ],
1847 state => "exc_pinned",
1848 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1849 out => [ "in_r4", "flags", "none" ] },
1850 ins => [ "base", "index", "mem", "minuend", "subtrahend" ],
1851 outs => [ "res", "flags", "M" ],
1852 am => "source,binary",
1853 emit => '. sub%XXM %binop',
1860 irn_flags => [ "rematerializable" ],
1861 state => "exc_pinned",
1862 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1863 out => [ "in_r4 !in_r5", "flags", "none" ] },
1864 ins => [ "base", "index", "mem", "dividend", "divisor" ],
1865 outs => [ "res", "flags", "M" ],
1866 am => "source,binary",
1867 emit => '. div%XXM %binop',
1873 irn_flags => [ "rematerializable" ],
1874 state => "exc_pinned",
1875 reg_req => { in => [ "gp", "gp", "none", "xmm", "xmm" ],
1876 out => [ "eflags" ] },
1877 ins => [ "base", "index", "mem", "left", "right" ],
1878 outs => [ "flags" ],
1879 am => "source,binary",
1880 attr => "bool ins_permuted",
1881 init_attr => "attr->data.ins_permuted = ins_permuted;",
1882 emit => ' .ucomi%XXM %binop',
1885 mode => $mode_flags,
1886 modified_flags => 1,
1890 op_flags => [ "fragile", "labeled" ],
1891 state => "exc_pinned",
1892 reg_req => { in => [ "gp", "gp", "none" ],
1893 out => [ "xmm", "none", "none", "none" ] },
1894 ins => [ "base", "index", "mem" ],
1895 outs => [ "res", "unused", "M", "X_exc" ],
1896 emit => '. mov%XXM %AM, %D0',
1897 attr => "ir_mode *load_mode",
1898 init_attr => "attr->ls_mode = load_mode;",
1904 op_flags => [ "fragile", "labeled" ],
1905 state => "exc_pinned",
1906 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none", "none" ] },
1907 ins => [ "base", "index", "mem", "val" ],
1908 outs => [ "M", "X_exc" ],
1909 emit => '. mov%XXM %S3, %AM',
1916 op_flags => [ "fragile", "labeled" ],
1917 state => "exc_pinned",
1918 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "none" ] },
1919 ins => [ "base", "index", "mem", "val" ],
1921 emit => '. mov%XXM %S3, %AM',
1928 op_flags => [ "fragile", "labeled" ],
1929 state => "exc_pinned",
1930 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1931 ins => [ "base", "index", "mem", "val" ],
1932 am => "source,unary",
1933 emit => '. cvtsi2ss %unop3, %D0',
1940 op_flags => [ "fragile", "labeled" ],
1941 state => "exc_pinned",
1942 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm" ] },
1943 ins => [ "base", "index", "mem", "val" ],
1944 am => "source,unary",
1945 emit => '. cvtsi2sd %unop3, %D0',
1953 op_flags => [ "fragile", "labeled" ],
1954 cmp_attr => "return 1;",
1955 ins => [ "val_high", "val_low" ],
1956 reg_req => { in => [ "none", "none" ], out => [ "none" ] }
1960 op_flags => [ "fragile", "labeled" ],
1961 cmp_attr => "return 1;",
1963 outs => [ "res_high", "res_low" ],
1964 reg_req => { in => [ "none" ], out => [ "none", "none" ] }
1968 op_flags => [ "fragile" ],
1970 reg_req => { in => [ "edi", "esi", "ecx", "none" ], out => [ "edi", "esi", "ecx", "none" ] },
1971 outs => [ "DST", "SRC", "CNT", "M" ],
1972 attr_type => "ia32_copyb_attr_t",
1973 attr => "unsigned size",
1976 # we don't care about this flag, so no need to mark this node
1977 # modified_flags => [ "DF" ]
1981 op_flags => [ "fragile" ],
1983 reg_req => { in => [ "edi", "esi", "none" ], out => [ "edi", "esi", "none" ] },
1984 outs => [ "DST", "SRC", "M" ],
1985 attr_type => "ia32_copyb_attr_t",
1986 attr => "unsigned size",
1989 # we don't care about this flag, so no need to mark this node
1990 # modified_flags => [ "DF" ]
1994 state => "exc_pinned",
1995 reg_req => { in => [ "eax" ], out => [ "eax" ] },
2005 state => "exc_pinned",
2006 reg_req => { in => [ "gp", "gp", "none", "gp" ],
2007 out => [ "gp", "none", "none" ] },
2008 ins => [ "base", "index", "mem", "val" ],
2009 outs => [ "res", "flags", "M" ],
2010 am => "source,unary",
2013 attr => "ir_mode *smaller_mode",
2014 init_attr => "attr->ls_mode = smaller_mode;",
2019 state => "exc_pinned",
2020 reg_req => { in => [ "gp", "gp", "none", "eax ebx ecx edx" ],
2021 out => [ "gp", "none", "none" ] },
2022 ins => [ "base", "index", "mem", "val" ],
2023 outs => [ "res", "flags", "M" ],
2024 am => "source,unary",
2027 attr => "ir_mode *smaller_mode",
2028 init_attr => "attr->ls_mode = smaller_mode;",
2033 state => "exc_pinned",
2034 reg_req => { in => [ "gp", "gp", "none", "gp" ], out => [ "xmm", "none" ] },
2035 ins => [ "base", "index", "mem", "val" ],
2036 am => "source,unary",
2043 state => "exc_pinned",
2044 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "gp", "none" ] },
2045 ins => [ "base", "index", "mem", "val" ],
2046 am => "source,unary",
2053 state => "exc_pinned",
2054 reg_req => { in => [ "gp", "gp", "none", "xmm" ], out => [ "xmm", "none" ] },
2055 ins => [ "base", "index", "mem", "val" ],
2056 am => "source,unary",
2062 # rematerialisation disabled for all float nodes for now, because the fpcw
2063 # handler runs before spilling and we might end up with wrong fpcw then
2066 # irn_flags => [ "rematerializable" ],
2067 state => "exc_pinned",
2068 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2069 out => [ "vfp", "none", "none" ] },
2070 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2071 outs => [ "res", "dummy", "M" ],
2072 am => "source,binary",
2076 attr_type => "ia32_x87_attr_t",
2080 # irn_flags => [ "rematerializable" ],
2081 state => "exc_pinned",
2082 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2083 out => [ "vfp", "none", "none" ] },
2084 ins => [ "base", "index", "mem", "left", "right", "fpcw" ],
2085 outs => [ "res", "dummy", "M" ],
2086 am => "source,binary",
2090 attr_type => "ia32_x87_attr_t",
2094 # irn_flags => [ "rematerializable" ],
2095 state => "exc_pinned",
2096 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2097 out => [ "vfp", "none", "none" ] },
2098 ins => [ "base", "index", "mem", "minuend", "subtrahend", "fpcw" ],
2099 outs => [ "res", "dummy", "M" ],
2100 am => "source,binary",
2104 attr_type => "ia32_x87_attr_t",
2108 state => "exc_pinned",
2109 reg_req => { in => [ "gp", "gp", "none", "vfp", "vfp", "fpcw" ],
2110 out => [ "vfp", "none", "none" ] },
2111 ins => [ "base", "index", "mem", "dividend", "divisor", "fpcw" ],
2112 outs => [ "res", "dummy", "M" ],
2113 am => "source,binary",
2116 attr_type => "ia32_x87_attr_t",
2120 reg_req => { in => [ "vfp", "vfp", "fpcw" ], out => [ "vfp" ] },
2121 ins => [ "left", "right", "fpcw" ],
2125 attr_type => "ia32_x87_attr_t",
2129 irn_flags => [ "rematerializable" ],
2130 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2135 attr_type => "ia32_x87_attr_t",
2139 irn_flags => [ "rematerializable" ],
2140 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2145 attr_type => "ia32_x87_attr_t",
2149 irn_flags => [ "rematerializable" ],
2150 op_flags => [ "fragile", "labeled" ],
2151 state => "exc_pinned",
2152 reg_req => { in => [ "gp", "gp", "none" ],
2153 out => [ "vfp", "none", "none", "none" ] },
2154 ins => [ "base", "index", "mem" ],
2155 outs => [ "res", "unused", "M", "X_exc" ],
2156 attr => "ir_mode *load_mode",
2157 init_attr => "attr->attr.ls_mode = load_mode;",
2160 attr_type => "ia32_x87_attr_t",
2164 irn_flags => [ "rematerializable" ],
2165 op_flags => [ "fragile", "labeled" ],
2166 state => "exc_pinned",
2167 reg_req => { in => [ "gp", "gp", "none", "vfp" ],
2168 out => [ "none", "none" ] },
2169 ins => [ "base", "index", "mem", "val" ],
2170 outs => [ "M", "X_exc" ],
2171 attr => "ir_mode *store_mode",
2172 init_attr => "attr->attr.ls_mode = store_mode;",
2176 attr_type => "ia32_x87_attr_t",
2180 state => "exc_pinned",
2181 reg_req => { in => [ "gp", "gp", "none" ],
2182 out => [ "vfp", "none", "none" ] },
2183 outs => [ "res", "unused", "M" ],
2184 ins => [ "base", "index", "mem" ],
2187 attr_type => "ia32_x87_attr_t",
2191 state => "exc_pinned",
2192 reg_req => { in => [ "gp", "gp", "none", "vfp", "fpcw" ], out => [ "none" ] },
2193 ins => [ "base", "index", "mem", "val", "fpcw" ],
2198 attr_type => "ia32_x87_attr_t",
2201 # SSE3 fisttp instruction
2203 state => "exc_pinned",
2204 reg_req => { in => [ "gp", "gp", "none", "vfp" ], out => [ "in_r4", "none" ]},
2205 ins => [ "base", "index", "mem", "val" ],
2206 outs => [ "res", "M" ],
2209 attr_type => "ia32_x87_attr_t",
2213 irn_flags => [ "rematerializable" ],
2214 reg_req => { out => [ "vfp" ] },
2219 attr_type => "ia32_x87_attr_t",
2223 irn_flags => [ "rematerializable" ],
2224 reg_req => { out => [ "vfp" ] },
2229 attr_type => "ia32_x87_attr_t",
2233 irn_flags => [ "rematerializable" ],
2234 reg_req => { out => [ "vfp" ] },
2239 attr_type => "ia32_x87_attr_t",
2243 irn_flags => [ "rematerializable" ],
2244 reg_req => { out => [ "vfp" ] },
2249 attr_type => "ia32_x87_attr_t",
2253 irn_flags => [ "rematerializable" ],
2254 reg_req => { out => [ "vfp" ] },
2259 attr_type => "ia32_x87_attr_t",
2263 irn_flags => [ "rematerializable" ],
2264 reg_req => { out => [ "vfp" ] },
2269 attr_type => "ia32_x87_attr_t",
2273 irn_flags => [ "rematerializable" ],
2274 reg_req => { out => [ "vfp" ] },
2279 attr_type => "ia32_x87_attr_t",
2283 # we can't allow to rematerialize this node so we don't
2284 # accidently produce Phi(Fucom, Fucom(ins_permuted))
2285 # irn_flags => [ "rematerializable" ],
2286 reg_req => { in => [ "vfp", "vfp" ], out => [ "eax" ] },
2287 ins => [ "left", "right" ],
2288 outs => [ "flags" ],
2289 attr => "bool ins_permuted",
2290 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2293 attr_type => "ia32_x87_attr_t",
2298 irn_flags => [ "rematerializable" ],
2299 reg_req => { in => [ "vfp", "vfp" ], out => [ "eflags" ] },
2300 ins => [ "left", "right" ],
2301 outs => [ "flags" ],
2302 attr => "bool ins_permuted",
2303 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2306 attr_type => "ia32_x87_attr_t",
2311 # irn_flags => [ "rematerializable" ],
2312 reg_req => { in => [ "vfp" ], out => [ "eax" ] },
2314 outs => [ "flags" ],
2315 attr => "bool ins_permuted",
2316 init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
2319 attr_type => "ia32_x87_attr_t",
2324 irn_flags => [ "rematerializable" ],
2325 reg_req => { in => [ "eax" ], out => [ "eflags" ] },
2327 outs => [ "flags" ],
2331 mode => $mode_flags,
2335 state => "exc_pinned",
2336 emit => '. fadd%XM %x87_binop',
2338 attr_type => "ia32_x87_attr_t",
2343 state => "exc_pinned",
2344 emit => '. faddp%XM %x87_binop',
2346 attr_type => "ia32_x87_attr_t",
2351 state => "exc_pinned",
2352 emit => '. fmul%XM %x87_binop',
2354 attr_type => "ia32_x87_attr_t",
2359 state => "exc_pinned",
2360 emit => '. fmulp%XM %x87_binop',,
2362 attr_type => "ia32_x87_attr_t",
2367 state => "exc_pinned",
2368 emit => '. fsub%XM %x87_binop',
2370 attr_type => "ia32_x87_attr_t",
2374 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
2375 # are swapped, we work this around in the emitter...
2378 state => "exc_pinned",
2379 # see note about gas bugs
2380 emit => '. fsubrp%XM %x87_binop',
2382 attr_type => "ia32_x87_attr_t",
2387 state => "exc_pinned",
2388 irn_flags => [ "rematerializable" ],
2389 emit => '. fsubr%XM %x87_binop',
2391 attr_type => "ia32_x87_attr_t",
2396 state => "exc_pinned",
2397 irn_flags => [ "rematerializable" ],
2398 # see note about gas bugs before fsubp
2399 emit => '. fsubp%XM %x87_binop',
2401 attr_type => "ia32_x87_attr_t",
2408 attr_type => "ia32_x87_attr_t",
2412 # this node is just here, to keep the simulator running
2413 # we can omit this when a fprem simulation function exists
2415 emit => '. fprem1\n'.
2418 attr_type => "ia32_x87_attr_t",
2423 state => "exc_pinned",
2424 emit => '. fdiv%XM %x87_binop',
2426 attr_type => "ia32_x87_attr_t",
2431 state => "exc_pinned",
2432 # see note about gas bugs before fsubp
2433 emit => '. fdivrp%XM %x87_binop',
2435 attr_type => "ia32_x87_attr_t",
2440 state => "exc_pinned",
2441 emit => '. fdivr%XM %x87_binop',
2443 attr_type => "ia32_x87_attr_t",
2448 state => "exc_pinned",
2449 # see note about gas bugs before fsubp
2450 emit => '. fdivp%XM %x87_binop',
2452 attr_type => "ia32_x87_attr_t",
2459 attr_type => "ia32_x87_attr_t",
2464 op_flags => [ "keep" ],
2465 irn_flags => [ "rematerializable" ],
2468 attr_type => "ia32_x87_attr_t",
2473 irn_flags => [ "rematerializable" ],
2474 op_flags => [ "fragile", "labeled" ],
2475 state => "exc_pinned",
2476 emit => '. fld%XM %AM',
2477 attr_type => "ia32_x87_attr_t",
2483 irn_flags => [ "rematerializable" ],
2484 op_flags => [ "fragile", "labeled" ],
2485 state => "exc_pinned",
2486 emit => '. fst%XM %AM',
2488 attr_type => "ia32_x87_attr_t",
2494 irn_flags => [ "rematerializable" ],
2495 op_flags => [ "fragile", "labeled" ],
2496 state => "exc_pinned",
2497 emit => '. fstp%XM %AM',
2499 attr_type => "ia32_x87_attr_t",
2505 state => "exc_pinned",
2506 emit => '. fild%XM %AM',
2507 attr_type => "ia32_x87_attr_t",
2513 state => "exc_pinned",
2514 emit => '. fist%XM %AM',
2516 attr_type => "ia32_x87_attr_t",
2522 state => "exc_pinned",
2523 emit => '. fistp%XM %AM',
2525 attr_type => "ia32_x87_attr_t",
2530 # SSE3 fisttp instruction
2532 state => "exc_pinned",
2533 emit => '. fisttp%XM %AM',
2535 attr_type => "ia32_x87_attr_t",
2541 op_flags => [ "constlike", "keep" ],
2542 irn_flags => [ "rematerializable" ],
2543 reg_req => { out => [ "vfp" ] },
2545 attr_type => "ia32_x87_attr_t",
2550 op_flags => [ "constlike", "keep" ],
2551 irn_flags => [ "rematerializable" ],
2552 reg_req => { out => [ "vfp" ] },
2554 attr_type => "ia32_x87_attr_t",
2559 op_flags => [ "constlike", "keep" ],
2560 irn_flags => [ "rematerializable" ],
2561 reg_req => { out => [ "vfp" ] },
2563 attr_type => "ia32_x87_attr_t",
2568 op_flags => [ "constlike", "keep" ],
2569 irn_flags => [ "rematerializable" ],
2570 reg_req => { out => [ "vfp" ] },
2572 attr_type => "ia32_x87_attr_t",
2577 op_flags => [ "constlike", "keep" ],
2578 irn_flags => [ "rematerializable" ],
2579 reg_req => { out => [ "vfp" ] },
2581 attr_type => "ia32_x87_attr_t",
2586 op_flags => [ "constlike", "keep" ],
2587 irn_flags => [ "rematerializable" ],
2588 reg_req => { out => [ "vfp" ] },
2589 emit => '. fldll2t',
2590 attr_type => "ia32_x87_attr_t",
2595 op_flags => [ "constlike", "keep" ],
2596 irn_flags => [ "rematerializable" ],
2597 reg_req => { out => [ "vfp" ] },
2599 attr_type => "ia32_x87_attr_t",
2604 # Note that it is NEVER allowed to do CSE on these nodes
2605 # Moreover, note the virtual register requierements!
2608 op_flags => [ "keep" ],
2609 reg_req => { out => [ "none" ] },
2610 cmp_attr => "return 1;",
2611 emit => '. fxch %X0',
2612 attr_type => "ia32_x87_attr_t",
2618 op_flags => [ "keep" ],
2619 reg_req => { out => [ "none" ] },
2620 cmp_attr => "return 1;",
2621 emit => '. fld %X0',
2622 attr_type => "ia32_x87_attr_t",
2628 reg_req => { in => [ "vfp"], out => [ "vfp" ] },
2629 cmp_attr => "return 1;",
2630 emit => '. fld %X0',
2631 attr_type => "ia32_x87_attr_t",
2636 op_flags => [ "keep" ],
2637 reg_req => { out => [ "none" ] },
2638 cmp_attr => "return 1;",
2639 emit => '. fstp %X0',
2640 attr_type => "ia32_x87_attr_t",
2646 op_flags => [ "keep" ],
2647 reg_req => { out => [ "none" ] },
2648 cmp_attr => "return 1;",
2649 emit => '. ffreep %X0',
2650 attr_type => "ia32_x87_attr_t",
2656 op_flags => [ "keep" ],
2657 reg_req => { out => [ "none" ] },
2658 cmp_attr => "return 1;",
2660 attr_type => "ia32_x87_attr_t",
2666 op_flags => [ "keep" ],
2667 reg_req => { out => [ "none" ] },
2668 cmp_attr => "return 1;",
2670 attr_type => "ia32_x87_attr_t",
2677 emit => ". fucom %X1\n".
2679 attr_type => "ia32_x87_attr_t",
2685 emit => ". fucomp %X1\n".
2687 attr_type => "ia32_x87_attr_t",
2693 emit => ". fucompp\n".
2695 attr_type => "ia32_x87_attr_t",
2701 emit => '. fucomi %X1',
2702 attr_type => "ia32_x87_attr_t",
2708 emit => '. fucompi %X1',
2709 attr_type => "ia32_x87_attr_t",
2717 attr_type => "ia32_x87_attr_t",
2721 # Spilling and reloading of SSE registers, hardcoded, not generated #
2724 op_flags => [ "fragile", "labeled" ],
2725 state => "exc_pinned",
2726 reg_req => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2727 emit => '. movdqu %D0, %AM',
2728 outs => [ "res", "M" ],
2734 op_flags => [ "fragile", "labeled" ],
2735 state => "exc_pinned",
2736 reg_req => { in => [ "gp", "gp", "none", "xmm" ] },
2737 ins => [ "base", "index", "mem", "val" ],
2738 emit => '. movdqu %binop',
2746 # Transform some attributes
2747 foreach my $op (keys(%nodes)) {
2748 my $node = $nodes{$op};
2749 my $op_attr_init = $node->{op_attr_init};
2751 if(defined($op_attr_init)) {
2752 $op_attr_init .= "\n\t";
2757 if(!defined($node->{latency})) {
2759 $node->{latency} = 0;
2761 die("Latency missing for op $op");
2764 $op_attr_init .= "attr->latency = ".$node->{latency} . ";";
2766 $node->{op_attr_init} = $op_attr_init;