- Introduce nodemap
[libfirm] / ir / be / ia32 / ia32_spec.pl
1 # Creation: 2005/10/19
2 # $Id$
3 # This is the specification for the ia32 assembler Firm-operations
4
5 use File::Basename;
6
7 $new_emit_syntax = 1;
8 my $myname = $0;
9
10 # the cpu architecture (ia32, ia64, mips, sparc, ppc, ...)
11 $arch = "ia32";
12
13 # The node description is done as a perl hash initializer with the
14 # following structure:
15 #
16 # %nodes = (
17 #
18 # <op-name> => {
19 #   op_flags  => "N|L|C|X|I|F|Y|H|c|K",
20 #   irn_flags => "R|N|I|S"
21 #   arity     => "0|1|2|3 ... |variable|dynamic|any",
22 #   state     => "floats|pinned|mem_pinned|exc_pinned",
23 #   args      => [
24 #                    { type => "type 1", name => "name 1" },
25 #                    { type => "type 2", name => "name 2" },
26 #                    ...
27 #                  ],
28 #   comment   => "any comment for constructor",
29 #   reg_req   => { in => [ "reg_class|register" ], out => [ "reg_class|register|in_rX" ] },
30 #   cmp_attr  => "c source code for comparing node attributes",
31 #   emit      => "emit code with templates",
32 #   attr      => "attitional attribute arguments for constructor"
33 #   init_attr => "emit attribute initialization template"
34 #   rd_constructor => "c source code which constructs an ir_node"
35 #   latency   => "latency of this operation (can be float)"
36 #   attr_type => "name of the attribute struct",
37 # },
38 #
39 # ... # (all nodes you need to describe)
40 #
41 # ); # close the %nodes initializer
42
43 # op_flags: flags for the operation, OPTIONAL (default is "N")
44 # the op_flags correspond to the firm irop_flags:
45 #   N   irop_flag_none
46 #   L   irop_flag_labeled
47 #   C   irop_flag_commutative
48 #   X   irop_flag_cfopcode
49 #   I   irop_flag_ip_cfopcode
50 #   F   irop_flag_fragile
51 #   Y   irop_flag_forking
52 #   H   irop_flag_highlevel
53 #   c   irop_flag_constlike
54 #   K   irop_flag_keep
55 #
56 # irn_flags: special node flags, OPTIONAL (default is 0)
57 # following irn_flags are supported:
58 #   R   rematerializeable
59 #   N   not spillable
60 #   I   ignore for register allocation
61 #   S   modifies stack pointer
62 #
63 # state: state of the operation, OPTIONAL (default is "floats")
64 #
65 # arity: arity of the operation, MUST NOT BE OMITTED
66 #
67 # args:  the OPTIONAL arguments of the node constructor (debug, irg and block
68 #        are always the first 3 arguments and are always autmatically
69 #        created)
70 #        If this key is missing the following arguments will be created:
71 #        for i = 1 .. arity: ir_node *op_i
72 #        ir_mode *mode
73 #
74 # outs:  if a node defines more than one output, the names of the projections
75 #        nodes having outs having automatically the mode mode_T
76 #        One can also annotate some flags for each out, additional to irn_flags.
77 #        They are separated from name with a colon ':', and concatenated by pipe '|'
78 #        Only I and S are available at the moment (same meaning as in irn_flags).
79 #        example: [ "frame:I", "stack:I|S", "M" ]
80 #
81 # comment: OPTIONAL comment for the node constructor
82 #
83 # rd_constructor: for every operation there will be a
84 #      new_rd_<arch>_<op-name> function with the arguments from above
85 #      which creates the ir_node corresponding to the defined operation
86 #      you can either put the complete source code of this function here
87 #
88 #      This key is OPTIONAL. If omitted, the following constructor will
89 #      be created:
90 #      if (!op_<arch>_<op-name>) assert(0);
91 #      for i = 1 to arity
92 #         set in[i] = op_i
93 #      done
94 #      res = new_ir_node(db, irg, block, op_<arch>_<op-name>, mode, arity, in)
95 #      return res
96 #
97 # NOTE: rd_constructor and args are only optional if and only if arity is 0,1,2 or 3
98 #
99 # latency: the latency of the operation, default is 1
100 #
101
102 # register types:
103 #   0 - no special type
104 #   1 - caller save (register must be saved by the caller of a function)
105 #   2 - callee save (register must be saved by the called function)
106 #   4 - ignore (do not assign this register)
107 #   8 - emitter can choose an arbitrary register of this class
108 #  16 - the register is a virtual one
109 #  32 - register represents a state
110 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
111 %reg_classes = (
112         gp => [
113                 { name => "eax", type => 1 },
114                 { name => "edx", type => 1 },
115                 { name => "ebx", type => 2 },
116                 { name => "ecx", type => 1 },
117                 { name => "esi", type => 2 },
118                 { name => "edi", type => 2 },
119                 { name => "ebp", type => 2 },
120                 { name => "esp", type => 4 },
121                 { name => "gp_NOREG", type => 4 | 8 | 16 }, # we need a dummy register for NoReg nodes
122                 { name => "gp_UKNWN", type => 4 | 8 | 16 },  # we need a dummy register for Unknown nodes
123                 { mode => "mode_Iu" }
124         ],
125         mmx => [
126                 { name => "mm0", type => 4 },
127                 { name => "mm1", type => 4 },
128                 { name => "mm2", type => 4 },
129                 { name => "mm3", type => 4 },
130                 { name => "mm4", type => 4 },
131                 { name => "mm5", type => 4 },
132                 { name => "mm6", type => 4 },
133                 { name => "mm7", type => 4 },
134                 { mode => "mode_E" }
135         ],
136         xmm => [
137                 { name => "xmm0", type => 1 },
138                 { name => "xmm1", type => 1 },
139                 { name => "xmm2", type => 1 },
140                 { name => "xmm3", type => 1 },
141                 { name => "xmm4", type => 1 },
142                 { name => "xmm5", type => 1 },
143                 { name => "xmm6", type => 1 },
144                 { name => "xmm7", type => 1 },
145                 { name => "xmm_NOREG", type => 4 | 16 },     # we need a dummy register for NoReg nodes
146                 { name => "xmm_UKNWN", type => 4 | 8 | 16},  # we need a dummy register for Unknown nodes
147                 { mode => "mode_E" }
148         ],
149         vfp => [
150                 { name => "vf0", type => 1 | 16 },
151                 { name => "vf1", type => 1 | 16 },
152                 { name => "vf2", type => 1 | 16 },
153                 { name => "vf3", type => 1 | 16 },
154                 { name => "vf4", type => 1 | 16 },
155                 { name => "vf5", type => 1 | 16 },
156                 { name => "vf6", type => 1 | 16 },
157                 { name => "vf7", type => 1 | 16 },
158                 { name => "vfp_NOREG", type => 4 | 8 | 16 }, # we need a dummy register for NoReg nodes
159                 { name => "vfp_UKNWN", type => 4 | 8 | 16 },  # we need a dummy register for Unknown nodes
160                 { mode => "mode_E" }
161         ],
162         st => [
163                 { name => "st0", realname => "st",    type => 4 },
164                 { name => "st1", realname => "st(1)", type => 4 },
165                 { name => "st2", realname => "st(2)", type => 4 },
166                 { name => "st3", realname => "st(3)", type => 4 },
167                 { name => "st4", realname => "st(4)", type => 4 },
168                 { name => "st5", realname => "st(5)", type => 4 },
169                 { name => "st6", realname => "st(6)", type => 4 },
170                 { name => "st7", realname => "st(7)", type => 4 },
171                 { mode => "mode_E" }
172         ],
173         fp_cw => [      # the floating point control word
174                 { name => "fpcw", type => 4 | 32},
175                 { mode => "mode_fpcw" }
176         ],
177         flags => [
178                 { name => "eflags", type => 4 },
179                 { mode => "mode_Iu" }
180         ],
181         fp_sw => [
182                 { name => "fpsw", type => 4 },
183                 { mode => "mode_Hu" }
184         ],
185 ); # %reg_classes
186
187 %flags = (
188         CF  => { reg => "eflags", bit => 0 },
189         PF  => { reg => "eflags", bit => 2 },
190         AF  => { reg => "eflags", bit => 4 },
191         ZF  => { reg => "eflags", bit => 6 },
192         SF  => { reg => "eflags", bit => 7 },
193         TF  => { reg => "eflags", bit => 8 },
194         IF  => { reg => "eflags", bit => 9 },
195         DF  => { reg => "eflags", bit => 10 },
196         OF  => { reg => "eflags", bit => 11 },
197         IOPL0 => { reg => "eflags", bit => 12 },
198         IOPL1 => { reg => "eflags", bit => 13 },
199         NT  => { reg => "eflags", bit => 14 },
200         RF  => { reg => "eflags", bit => 16 },
201         VM  => { reg => "eflags", bit => 17 },
202         AC  => { reg => "eflags", bit => 18 },
203         VIF => { reg => "eflags", bit => 19 },
204         VIP => { reg => "eflags", bit => 20 },
205         ID  => { reg => "eflags", bit => 21 },
206
207         FP_IE => { reg => "fpsw", bit => 0 },
208         FP_DE => { reg => "fpsw", bit => 1 },
209         FP_ZE => { reg => "fpsw", bit => 2 },
210         FP_OE => { reg => "fpsw", bit => 3 },
211         FP_UE => { reg => "fpsw", bit => 4 },
212         FP_PE => { reg => "fpsw", bit => 5 },
213         FP_SF => { reg => "fpsw", bit => 6 },
214         FP_ES => { reg => "fpsw", bit => 7 },
215         FP_C0 => { reg => "fpsw", bit => 8 },
216         FP_C1 => { reg => "fpsw", bit => 9 },
217         FP_C2 => { reg => "fpsw", bit => 10 },
218         FP_TOP0 => { reg => "fpsw", bit => 11 },
219         FP_TOP1 => { reg => "fpsw", bit => 12 },
220         FP_TOP2 => { reg => "fpsw", bit => 13 },
221         FP_C3 => { reg => "fpsw", bit => 14 },
222         FP_B  => { reg => "fpsw", bit => 15 },
223
224         FP_IM => { reg => "fpcw", bit => 0 },
225         FP_DM => { reg => "fpcw", bit => 1 },
226         FP_ZM => { reg => "fpcw", bit => 2 },
227         FP_OM => { reg => "fpcw", bit => 3 },
228         FP_UM => { reg => "fpcw", bit => 4 },
229         FP_PM => { reg => "fpcw", bit => 5 },
230         FP_PC0 => { reg => "fpcw", bit => 8 },
231         FP_PC1 => { reg => "fpcw", bit => 9 },
232         FP_RC0 => { reg => "fpcw", bit => 10 },
233         FP_RC1 => { reg => "fpcw", bit => 11 },
234         FP_X  => { reg => "fpcw", bit => 12 }
235 ); # %flags
236
237 %cpu = (
238         GP     => [ 1, "GP_EAX", "GP_EBX", "GP_ECX", "GP_EDX", "GP_ESI", "GP_EDI", "GP_EBP" ],
239         SSE    => [ 1, "SSE_XMM0", "SSE_XMM1", "SSE_XMM2", "SSE_XMM3", "SSE_XMM4", "SSE_XMM5", "SSE_XMM6", "SSE_XMM7" ],
240         VFP    => [ 1, "VFP_VF0", "VFP_VF1", "VFP_VF2", "VFP_VF3", "VFP_VF4", "VFP_VF5", "VFP_VF6", "VFP_VF7" ],
241         BRANCH => [ 1, "BRANCH1", "BRANCH2" ],
242 ); # %cpu
243
244 %vliw = (
245         bundle_size       => 1,
246         bundels_per_cycle => 1
247 ); # vliw
248
249 %emit_templates = (
250         S0 => "${arch}_emit_source_register(env, node, 0);",
251         S1 => "${arch}_emit_source_register(env, node, 1);",
252         S2 => "${arch}_emit_source_register(env, node, 2);",
253         S3 => "${arch}_emit_source_register(env, node, 3);",
254         S4 => "${arch}_emit_source_register(env, node, 4);",
255         S5 => "${arch}_emit_source_register(env, node, 5);",
256         D0 => "${arch}_emit_dest_register(env, node, 0);",
257         D1 => "${arch}_emit_dest_register(env, node, 1);",
258         D2 => "${arch}_emit_dest_register(env, node, 2);",
259         D3 => "${arch}_emit_dest_register(env, node, 3);",
260         D4 => "${arch}_emit_dest_register(env, node, 4);",
261         D5 => "${arch}_emit_dest_register(env, node, 5);",
262         X0 => "${arch}_emit_x87_name(env, node, 0);",
263         X1 => "${arch}_emit_x87_name(env, node, 1);",
264         X2 => "${arch}_emit_x87_name(env, node, 2);",
265         C  => "${arch}_emit_immediate(env, node);",
266         SE => "${arch}_emit_extend_suffix(env, get_ia32_ls_mode(node));",
267         ME => "if(get_mode_size_bits(get_ia32_ls_mode(node)) != 32)\n
268                    ia32_emit_mode_suffix(env, node);",
269         M  => "${arch}_emit_mode_suffix(env, node);",
270         XM => "${arch}_emit_x87_mode_suffix(env, node);",
271         XXM => "${arch}_emit_xmm_mode_suffix(env, node);",
272         XSD => "${arch}_emit_xmm_mode_suffix_s(env, node);",
273         AM => "${arch}_emit_am(env, node);",
274         unop0 => "${arch}_emit_unop(env, node, 0);",
275         unop1 => "${arch}_emit_unop(env, node, 1);",
276         unop2 => "${arch}_emit_unop(env, node, 2);",
277         unop3 => "${arch}_emit_unop(env, node, 3);",
278         unop4 => "${arch}_emit_unop(env, node, 4);",
279         DAM0  => "${arch}_emit_am_or_dest_register(env, node, 0);",
280         DAM1  => "${arch}_emit_am_or_dest_register(env, node, 0);",
281         binop => "${arch}_emit_binop(env, node);",
282         x87_binop => "${arch}_emit_x87_binop(env, node);",
283 );
284
285 #--------------------------------------------------#
286 #                        _                         #
287 #                       (_)                        #
288 #  _ __   _____      __  _ _ __    ___  _ __  ___  #
289 # | '_ \ / _ \ \ /\ / / | | '__|  / _ \| '_ \/ __| #
290 # | | | |  __/\ V  V /  | | |    | (_) | |_) \__ \ #
291 # |_| |_|\___| \_/\_/   |_|_|     \___/| .__/|___/ #
292 #                                      | |         #
293 #                                      |_|         #
294 #--------------------------------------------------#
295
296 $default_attr_type = "ia32_attr_t";
297
298 %init_attr = (
299         ia32_attr_t     => "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);",
300         ia32_x87_attr_t =>
301                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
302                 "\tinit_ia32_x87_attributes(res);",
303         ia32_asm_attr_t =>
304                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
305                 "\tinit_ia32_x87_attributes(res);".
306                 "\tinit_ia32_asm_attributes(res);",
307         ia32_immediate_attr_t =>
308                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
309                 "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, offset);"
310 );
311
312 %compare_attr = (
313         ia32_attr_t           => "ia32_compare_nodes_attr",
314         ia32_x87_attr_t       => "ia32_compare_x87_attr",
315         ia32_asm_attr_t       => "ia32_compare_asm_attr",
316         ia32_immediate_attr_t => "ia32_compare_immediate_attr",
317 );
318
319 %operands = (
320 );
321
322 $mode_xmm     = "mode_E";
323 $mode_gp      = "mode_Iu";
324 $mode_fpcw    = "mode_fpcw";
325 $status_flags = [ "CF", "PF", "AF", "ZF", "SF", "OF" ];
326 $fpcw_flags   = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
327                   "FP_PC0", "FP_PC1", "FP_RC0", "FP_RC1", "FP_X" ];
328
329 %nodes = (
330
331 Immediate => {
332         state     => "pinned",
333         op_flags  => "c",
334         irn_flags => "I",
335         reg_req   => { out => [ "gp_NOREG" ] },
336         attr      => "ir_entity *symconst, int symconst_sign, long offset",
337         attr_type => "ia32_immediate_attr_t",
338         mode      => $mode_gp,
339 },
340
341 Asm => {
342         mode      => "mode_T",
343         arity     => "variable",
344         out_arity => "variable",
345         attr_type => "ia32_asm_attr_t",
346 },
347
348 #-----------------------------------------------------------------#
349 #  _       _                                         _            #
350 # (_)     | |                                       | |           #
351 #  _ _ __ | |_ ___  __ _  ___ _ __   _ __   ___   __| | ___  ___  #
352 # | | '_ \| __/ _ \/ _` |/ _ \ '__| | '_ \ / _ \ / _` |/ _ \/ __| #
353 # | | | | | ||  __/ (_| |  __/ |    | | | | (_) | (_| |  __/\__ \ #
354 # |_|_| |_|\__\___|\__, |\___|_|    |_| |_|\___/ \__,_|\___||___/ #
355 #                   __/ |                                         #
356 #                  |___/                                          #
357 #-----------------------------------------------------------------#
358
359 # commutative operations
360
361 # NOTE:
362 # All nodes supporting Addressmode have 5 INs:
363 # 1 - base    r1 == NoReg in case of no AM or no base
364 # 2 - index   r2 == NoReg in case of no AM or no index
365 # 3 - op1     r3 == always present
366 # 4 - op2     r4 == NoReg in case of immediate operation
367 # 5 - mem     NoMem in case of no AM otherwise it takes the mem from the Load
368
369 Add => {
370         irn_flags => "R",
371         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
372         ins       => [ "base", "index", "left", "right", "mem" ],
373         emit      => '. add%M %binop',
374         units     => [ "GP" ],
375         mode      => $mode_gp,
376         modified_flags => $status_flags
377 },
378
379 Adc => {
380         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
381         emit      => '. adc%M %binop',
382         units     => [ "GP" ],
383         mode      => $mode_gp,
384         modified_flags => $status_flags
385 },
386
387 Add64Bit => {
388         irn_flags => "R",
389         arity     => 4,
390         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
391         emit      => '
392 . movl %S0, %D0
393 . movl %S1, %D1
394 . addl %S2, %D0
395 . adcl %S3, %D1
396 ',
397         outs      => [ "low_res", "high_res" ],
398         units     => [ "GP" ],
399         modified_flags => $status_flags
400 },
401
402 l_Add => {
403         op_flags  => "C",
404         irn_flags => "R",
405         cmp_attr  => "return 1;",
406         arity     => 2,
407 },
408
409 l_Adc => {
410         op_flags  => "C",
411         cmp_attr  => "return 1;",
412         arity     => 2,
413 },
414
415 Mul => {
416         # we should not rematrialize this node. It produces 2 results and has
417         # very strict constrains
418         reg_req   => { in => [ "gp", "gp", "eax", "gp", "none" ], out => [ "eax", "edx", "none" ] },
419         emit      => '. mul%M %unop3',
420         outs      => [ "EAX", "EDX", "M" ],
421         ins       => [ "base", "index", "val_high", "val_low", "mem" ],
422         latency   => 10,
423         units     => [ "GP" ],
424         modified_flags => $status_flags
425 },
426
427 l_Mul => {
428         # we should not rematrialize this node. It produces 2 results and has
429         # very strict constrains
430         op_flags  => "C",
431         cmp_attr  => "return 1;",
432         outs      => [ "EAX", "EDX", "M" ],
433         arity     => 2
434 },
435
436 IMul => {
437         irn_flags => "R",
438         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
439         emit      => '. imul%M %binop',
440         latency   => 5,
441         units     => [ "GP" ],
442         mode      => $mode_gp,
443         modified_flags => $status_flags
444 },
445
446 IMul1OP => {
447         irn_flags => "R",
448         reg_req   => { in => [ "gp", "gp", "eax", "gp", "none" ], out => [ "eax", "edx", "none" ] },
449         emit      => '. imul%M %unop3',
450         outs      => [ "EAX", "EDX", "M" ],
451         ins       => [ "base", "index", "val_high", "val_low", "mem" ],
452         latency   => 5,
453         units     => [ "GP" ],
454         modified_flags => $status_flags
455 },
456
457 l_IMul => {
458         op_flags  => "C",
459         cmp_attr  => "return 1;",
460         arity     => 2
461 },
462
463 And => {
464         irn_flags => "R",
465         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
466         emit      => '. and%M %binop',
467         units     => [ "GP" ],
468         mode      => $mode_gp,
469         modified_flags => $status_flags
470 },
471
472 Or => {
473         irn_flags => "R",
474         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
475         emit      => '. or%M %binop',
476         units     => [ "GP" ],
477         mode      => $mode_gp,
478         modified_flags => $status_flags
479 },
480
481 Xor => {
482         irn_flags => "R",
483         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
484         emit      => '. xor%M %binop',
485         units     => [ "GP" ],
486         mode      => $mode_gp,
487         modified_flags => $status_flags
488 },
489
490 l_Xor => {
491         op_flags  => "C",
492         cmp_attr  => "return 1;",
493         arity     => 2,
494         modified_flags => $status_flags
495 },
496
497 # not commutative operations
498
499 Sub => {
500         irn_flags => "R",
501         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
502         emit      => '. sub%M %binop',
503         units     => [ "GP" ],
504         mode      => $mode_gp,
505         modified_flags => $status_flags
506 },
507
508 Sbb => {
509         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3 !in_r4" ] },
510         emit      => '. sbb%M %binop',
511         units     => [ "GP" ],
512         mode      => $mode_gp,
513         modified_flags => $status_flags
514 },
515
516 Sub64Bit => {
517         irn_flags => "R",
518         arity     => 4,
519         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
520         emit      => '
521 . movl %S0, %D0
522 . movl %S1, %D1
523 . subl %S2, %D0
524 . sbbl %S3, %D1
525 ',
526         outs      => [ "low_res", "high_res" ],
527         units     => [ "GP" ],
528         modified_flags => $status_flags
529 },
530
531 l_Sub => {
532         irn_flags => "R",
533         cmp_attr  => "return 1;",
534         arity     => 2,
535 },
536
537 l_Sbb => {
538         cmp_attr  => "return 1;",
539         arity     => 2,
540 },
541
542 IDiv => {
543         op_flags  => "F|L",
544         state     => "exc_pinned",
545         reg_req   => { in => [ "gp", "gp", "eax", "edx", "gp", "none" ], out => [ "eax", "edx", "none" ] },
546         attr      => "ia32_op_flavour_t dm_flav",
547         init_attr => "attr->data.op_flav = dm_flav;",
548         emit      => ". idiv%M %unop4",
549         outs      => [ "div_res", "mod_res", "M" ],
550         latency   => 25,
551         units     => [ "GP" ],
552         modified_flags => $status_flags
553 },
554
555 Div => {
556         op_flags  => "F|L",
557         state     => "exc_pinned",
558         reg_req   => { in => [ "gp", "gp", "eax", "edx", "gp", "none" ], out => [ "eax", "edx", "none" ] },
559         attr      => "ia32_op_flavour_t dm_flav",
560         init_attr => "attr->data.op_flav = dm_flav;",
561         emit      => ". div%M %unop4",
562         outs      => [ "div_res", "mod_res", "M" ],
563         latency   => 25,
564         units     => [ "GP" ],
565         modified_flags => $status_flags
566 },
567
568 Shl => {
569         irn_flags => "R",
570         # "in_r3" would be enough as out requirement, but the register allocator
571         # does strange things then and doesn't respect the constraint for in4
572         # if the same value is attached to in3 and in4 (if you have "i << i" in C)
573         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
574         ins       => [ "base", "index", "left", "right", "mem" ],
575         emit      => '. shl%M %binop',
576         units     => [ "GP" ],
577         mode      => $mode_gp,
578         modified_flags => $status_flags
579 },
580
581 l_Shl => {
582         cmp_attr  => "return 1;",
583         arity     => 2
584 },
585
586 ShlD => {
587         irn_flags => "R",
588         # Out requirements is: different from all in
589         # This is because, out must be different from LowPart and ShiftCount.
590         # We could say "!ecx !in_r4" but it can occur, that all values live through
591         # this Shift and the only value dying is the ShiftCount. Then there would be
592         # a register missing, as result must not be ecx and all other registers are
593         # occupied. What we should write is "!in_r4 !in_r5", but this is not
594         # supported (and probably never will). So we create artificial interferences
595         # of the result with all inputs, so the spiller can always assure a free
596         # register.
597         reg_req   => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
598         emit      =>
599 '
600 if (get_ia32_immop_type(node) == ia32_ImmNone) {
601         if (get_ia32_op_type(node) == ia32_AddrModeD) {
602                 . shld%M %%cl, %S3, %AM
603         } else {
604                 . shld%M %%cl, %S3, %S2
605         }
606 } else {
607         if (get_ia32_op_type(node) == ia32_AddrModeD) {
608                 . shld%M %C, %S3, %AM
609         } else {
610                 . shld%M %C, %S3, %S2
611         }
612 }
613 ',
614         latency   => 6,
615         units     => [ "GP" ],
616         mode      => $mode_gp,
617         modified_flags => $status_flags
618 },
619
620 l_ShlD => {
621         cmp_attr  => "return 1;",
622         arity     => 3,
623 },
624
625 Shr => {
626         irn_flags => "R",
627         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
628         emit      => '. shr%M %binop',
629         units     => [ "GP" ],
630         mode      => $mode_gp,
631         modified_flags => $status_flags
632 },
633
634 l_Shr => {
635         cmp_attr  => "return 1;",
636         arity     => 2
637 },
638
639 ShrD => {
640         irn_flags => "R",
641         # Out requirements is: different from all in
642         # This is because, out must be different from LowPart and ShiftCount.
643         # We could say "!ecx !in_r4" but it can occur, that all values live through
644         # this Shift and the only value dying is the ShiftCount. Then there would be a
645         # register missing, as result must not be ecx and all other registers are
646         # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
647         # (and probably never will). So we create artificial interferences of the result
648         # with all inputs, so the spiller can always assure a free register.
649         reg_req   => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
650         emit      => '
651 if (get_ia32_immop_type(node) == ia32_ImmNone) {
652         if (get_ia32_op_type(node) == ia32_AddrModeD) {
653                 . shrd%M %%cl, %S3, %AM
654         } else {
655                 . shrd%M %%cl, %S3, %S2
656         }
657 } else {
658         if (get_ia32_op_type(node) == ia32_AddrModeD) {
659                 . shrd%M %C, %S3, %AM
660         } else {
661                 . shrd%M %C, %S3, %S2
662         }
663 }
664 ',
665         latency   => 6,
666         units     => [ "GP" ],
667         mode      => $mode_gp,
668         modified_flags => $status_flags
669 },
670
671 l_ShrD => {
672         cmp_attr  => "return 1;",
673         arity     => 3
674 },
675
676 Sar => {
677         irn_flags => "R",
678         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
679         emit      => '. sar%M %binop',
680         units     => [ "GP" ],
681         mode      => $mode_gp,
682         modified_flags => $status_flags
683 },
684
685 l_Sar => {
686         cmp_attr  => "return 1;",
687         arity     => 2
688 },
689
690 Ror => {
691         irn_flags => "R",
692         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
693         emit      => '. ror%M %binop',
694         units     => [ "GP" ],
695         mode      => $mode_gp,
696         modified_flags => $status_flags
697 },
698
699 Rol => {
700         irn_flags => "R",
701         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
702         emit      => '. rol%M %binop',
703         units     => [ "GP" ],
704         mode      => $mode_gp,
705         modified_flags => $status_flags
706 },
707
708 # unary operations
709
710 Neg => {
711         irn_flags => "R",
712         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
713         emit      => '. neg%M %unop2',
714         ins       => [ "base", "index", "val", "mem" ],
715         units     => [ "GP" ],
716         mode      => $mode_gp,
717         modified_flags => $status_flags
718 },
719
720 Minus64Bit => {
721         irn_flags => "R",
722         reg_req   => { in => [ "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
723         emit      => '
724 . movl %S0, %D0
725 . movl %S0, %D1
726 . subl %S1, %D0
727 . sbbl %S2, %D1
728 ',
729         outs      => [ "low_res", "high_res" ],
730         units     => [ "GP" ],
731         modified_flags => $status_flags
732 },
733
734
735 l_Neg => {
736         cmp_attr  => "return 1;",
737         arity     => 1,
738 },
739
740 Inc => {
741         irn_flags => "R",
742         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
743         emit      => '. inc%M %unop2',
744         units     => [ "GP" ],
745         mode      => $mode_gp,
746         modified_flags => [ "OF", "SF", "ZF", "AF", "PF" ]
747 },
748
749 Dec => {
750         irn_flags => "R",
751         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
752         emit      => '. dec%M %unop2',
753         units     => [ "GP" ],
754         mode      => $mode_gp,
755         modified_flags => [ "OF", "SF", "ZF", "AF", "PF" ]
756 },
757
758 Not => {
759         irn_flags => "R",
760         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
761         ins       => [ "base", "index", "val", "mem" ],
762         emit      => '. not%M %unop2',
763         units     => [ "GP" ],
764         mode      => $mode_gp,
765         modified_flags => []
766 },
767
768 # other operations
769
770 CondJmp => {
771         state     => "pinned",
772         op_flags  => "L|X|Y",
773         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "none", "none"] },
774         outs      => [ "false", "true" ],
775         latency   => 3,
776         units     => [ "BRANCH" ],
777 },
778
779 TestJmp => {
780         state     => "pinned",
781         op_flags  => "L|X|Y",
782         reg_req  => { in => [ "gp", "gp" ], out => [ "none", "none" ] },
783         outs      => [ "false", "true" ],
784         latency   => 3,
785         units     => [ "BRANCH" ],
786 },
787
788 CJmpAM => {
789         state     => "pinned",
790         op_flags  => "L|X|Y",
791         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "none", "none" ] },
792         outs      => [ "false", "true" ],
793         units     => [ "BRANCH" ],
794 },
795
796 CJmp => {
797         state     => "pinned",
798         op_flags  => "L|X|Y",
799         reg_req   => { in => [ "gp", "gp" ] },
800         units     => [ "BRANCH" ],
801 },
802
803 SwitchJmp => {
804         state     => "pinned",
805         op_flags  => "L|X|Y",
806         reg_req   => { in => [ "gp" ], out => [ "none" ] },
807         latency   => 3,
808         units     => [ "BRANCH" ],
809 },
810
811 Const => {
812         op_flags  => "c",
813         irn_flags => "R",
814         reg_req   => { out => [ "gp" ] },
815         units     => [ "GP" ],
816         mode      => $mode_gp,
817 },
818
819 Unknown_GP => {
820         state     => "pinned",
821         op_flags  => "c",
822         irn_flags => "I",
823         reg_req   => { out => [ "gp_UKNWN" ] },
824         units     => [],
825         emit      => "",
826         mode      => $mode_gp
827 },
828
829 Unknown_VFP => {
830         state     => "pinned",
831         op_flags  => "c",
832         irn_flags => "I",
833         reg_req   => { out => [ "vfp_UKNWN" ] },
834         units     => [],
835         emit      => "",
836         mode      => "mode_E",
837         attr_type => "ia32_x87_attr_t",
838 },
839
840 Unknown_XMM => {
841         state     => "pinned",
842         op_flags  => "c",
843         irn_flags => "I",
844         reg_req   => { out => [ "xmm_UKNWN" ] },
845         units     => [],
846         emit      => "",
847         mode      => "mode_E"
848 },
849
850 NoReg_GP => {
851         state     => "pinned",
852         op_flags  => "c",
853         irn_flags => "I",
854         reg_req   => { out => [ "gp_NOREG" ] },
855         units     => [],
856         emit      => "",
857         mode      => $mode_gp
858 },
859
860 NoReg_VFP => {
861         state     => "pinned",
862         op_flags  => "c",
863         irn_flags => "I",
864         reg_req   => { out => [ "vfp_NOREG" ] },
865         units     => [],
866         emit      => "",
867         mode      => "mode_E",
868         attr_type => "ia32_x87_attr_t",
869 },
870
871 NoReg_XMM => {
872         state     => "pinned",
873         op_flags  => "c",
874         irn_flags => "I",
875         reg_req   => { out => [ "xmm_NOREG" ] },
876         units     => [],
877         emit      => "",
878         mode      => "mode_E"
879 },
880
881 ChangeCW => {
882         state     => "pinned",
883         op_flags  => "c",
884         irn_flags => "I",
885         reg_req   => { out => [ "fp_cw" ] },
886         mode      => $mode_fpcw,
887         latency   => 3,
888         units     => [ "GP" ],
889         modified_flags => $fpcw_flags
890 },
891
892 FldCW => {
893         op_flags  => "L|F",
894         state     => "pinned",
895         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "fp_cw" ] },
896         latency   => 5,
897         emit      => ". fldcw %AM",
898         mode      => $mode_fpcw,
899         units     => [ "GP" ],
900         modified_flags => $fpcw_flags
901 },
902
903 FnstCW => {
904         op_flags  => "L|F",
905         state     => "pinned",
906         reg_req   => { in => [ "gp", "gp", "fp_cw", "none" ], out => [ "none" ] },
907         latency   => 5,
908         emit      => ". fnstcw %AM",
909         mode      => "mode_M",
910         units     => [ "GP" ],
911 },
912
913 Cltd => {
914         # we should not rematrialize this node. It produces 2 results and has
915         # very strict constrains
916         reg_req   => { in => [ "eax" ], out => [ "edx" ] },
917         ins       => [ "val" ],
918         emit      => '. cltd',
919         mode      => $mode_gp,
920         units     => [ "GP" ],
921 },
922
923 # Load / Store
924 #
925 # Note that we add additional latency values depending on address mode, so a
926 # lateny of 0 for load is correct
927
928 Load => {
929         op_flags  => "L|F",
930         state     => "exc_pinned",
931         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "gp", "none" ] },
932         latency   => 0,
933         emit      => ". mov%SE%ME%.l %AM, %D0",
934         outs      => [ "res", "M" ],
935         units     => [ "GP" ],
936 },
937
938 l_Load => {
939         op_flags  => "L|F",
940         cmp_attr  => "return 1;",
941         outs      => [ "res", "M" ],
942         arity     => 2,
943 },
944
945 l_Store => {
946         op_flags  => "L|F",
947         cmp_attr  => "return 1;",
948         state     => "exc_pinned",
949         arity     => 3,
950         mode      => "mode_M",
951 },
952
953 Store => {
954         op_flags  => "L|F",
955         state     => "exc_pinned",
956         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "none" ] },
957         emit      => '. mov%M %binop',
958         latency   => 2,
959         units     => [ "GP" ],
960         mode      => "mode_M",
961 },
962
963 Store8Bit => {
964         op_flags  => "L|F",
965         state     => "exc_pinned",
966         reg_req   => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => ["none" ] },
967         emit      => '. mov%M %binop',
968         latency   => 2,
969         units     => [ "GP" ],
970         mode      => "mode_M",
971 },
972
973 Lea => {
974         irn_flags => "R",
975         reg_req   => { in => [ "gp", "gp" ], out => [ "in_r1" ] },
976         emit      => '. leal %AM, %D0',
977         latency   => 2,
978         units     => [ "GP" ],
979         mode      => $mode_gp,
980         modified_flags => [],
981 },
982
983 Push => {
984         reg_req   => { in => [ "gp", "gp", "gp", "esp", "none" ], out => [ "esp", "none" ] },
985         emit      => '. push%M %unop2',
986         ins       => [ "base", "index", "val", "stack", "mem" ],
987         outs      => [ "stack:I|S", "M" ],
988         latency   => 2,
989         units     => [ "GP" ],
990         modified_flags => [],
991 },
992
993 Pop => {
994         reg_req   => { in => [ "gp", "gp", "esp", "none" ], out => [ "esp", "gp", "none" ] },
995         emit      => '. pop%M %DAM1',
996         outs      => [ "stack:I|S", "res", "M" ],
997         ins       => [ "base", "index", "stack", "mem" ],
998         latency   => 3, # Pop is more expensive than Push on Athlon
999         units     => [ "GP" ],
1000         modified_flags => [],
1001 },
1002
1003 Enter => {
1004         reg_req   => { in => [ "esp" ], out => [ "ebp", "esp", "none" ] },
1005         emit      => '. enter',
1006         outs      => [ "frame:I", "stack:I|S", "M" ],
1007         latency   => 15,
1008         units     => [ "GP" ],
1009 },
1010
1011 Leave => {
1012         reg_req   => { in => [ "esp", "ebp" ], out => [ "ebp", "esp" ] },
1013         emit      => '. leave',
1014         outs      => [ "frame:I", "stack:I|S" ],
1015         latency   => 3,
1016         units     => [ "GP" ],
1017 },
1018
1019 AddSP => {
1020         irn_flags => "I",
1021         reg_req   => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "none" ] },
1022         emit      => '. addl %binop',
1023         outs      => [ "stack:S", "M" ],
1024         units     => [ "GP" ],
1025         modified_flags => $status_flags
1026 },
1027
1028 SubSP => {
1029         irn_flags => "I",
1030         reg_req   => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "none" ] },
1031         emit      => '. subl %binop',
1032         outs      => [ "stack:S", "M" ],
1033         units     => [ "GP" ],
1034         modified_flags => $status_flags
1035 },
1036
1037 LdTls => {
1038         irn_flags => "R",
1039         reg_req   => { out => [ "gp" ] },
1040         units     => [ "GP" ],
1041 },
1042
1043 # the int instruction
1044 int => {
1045         reg_req   => { in => [ "none" ], out => [ "none" ] },
1046         mode      => "mode_M",
1047         attr      => "tarval *tv",
1048         init_attr => "\tset_ia32_Immop_tarval(res, tv);",
1049         emit      => '. int %C',
1050         units     => [ "GP" ],
1051         cmp_attr  => "return 1;",
1052 },
1053
1054
1055 #-----------------------------------------------------------------------------#
1056 #   _____ _____ ______    __ _             _                     _            #
1057 #  / ____/ ____|  ____|  / _| |           | |                   | |           #
1058 # | (___| (___ | |__    | |_| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
1059 #  \___ \\___ \|  __|   |  _| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1060 #  ____) |___) | |____  | | | | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
1061 # |_____/_____/|______| |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1062 #-----------------------------------------------------------------------------#
1063
1064 # commutative operations
1065
1066 xAdd => {
1067         irn_flags => "R",
1068         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1069         emit      => '. add%XXM %binop',
1070         latency   => 4,
1071         units     => [ "SSE" ],
1072         mode      => "mode_E",
1073 },
1074
1075 xMul => {
1076         irn_flags => "R",
1077         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1078         emit      => '. mul%XXM %binop',
1079         latency   => 4,
1080         units     => [ "SSE" ],
1081         mode      => "mode_E",
1082 },
1083
1084 xMax => {
1085         irn_flags => "R",
1086         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1087         emit      => '. max%XXM %binop',
1088         latency   => 2,
1089         units     => [ "SSE" ],
1090         mode      => "mode_E",
1091 },
1092
1093 xMin => {
1094         irn_flags => "R",
1095         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1096         emit      => '. min%XXM %binop',
1097         latency   => 2,
1098         units     => [ "SSE" ],
1099         mode      => "mode_E",
1100 },
1101
1102 xAnd => {
1103         irn_flags => "R",
1104         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1105         emit      => '. andp%XSD %binop',
1106         latency   => 3,
1107         units     => [ "SSE" ],
1108         mode      => "mode_E",
1109 },
1110
1111 xOr => {
1112         irn_flags => "R",
1113         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1114         emit      => '. orp%XSD %binop',
1115         units     => [ "SSE" ],
1116         mode      => "mode_E",
1117 },
1118
1119 xXor => {
1120         irn_flags => "R",
1121         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1122         emit      => '. xorp%XSD %binop',
1123         latency   => 3,
1124         units     => [ "SSE" ],
1125         mode      => "mode_E",
1126 },
1127
1128 # not commutative operations
1129
1130 xAndNot => {
1131         irn_flags => "R",
1132         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4" ] },
1133         emit      => '. andnp%XSD %binop',
1134         latency   => 3,
1135         units     => [ "SSE" ],
1136         mode      => "mode_E",
1137 },
1138
1139 xSub => {
1140         irn_flags => "R",
1141         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1142         emit      => '. sub%XXM %binop',
1143         latency   => 4,
1144         units     => [ "SSE" ],
1145         mode      => "mode_E",
1146 },
1147
1148 xDiv => {
1149         irn_flags => "R",
1150         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4", "none" ] },
1151         outs      => [ "res", "M" ],
1152         emit      => '. div%XXM %binop',
1153         latency   => 16,
1154         units     => [ "SSE" ],
1155 },
1156
1157 # other operations
1158
1159 xCmp => {
1160         irn_flags => "R",
1161         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4" ] },
1162         latency   => 3,
1163         units     => [ "SSE" ],
1164         mode      => "mode_E",
1165 },
1166
1167 xCondJmp => {
1168         state     => "pinned",
1169         op_flags  => "L|X|Y",
1170         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "none", "none" ] },
1171         outs      => [ "false", "true" ],
1172         latency   => 5,
1173         units     => [ "SSE" ],
1174 },
1175
1176 xConst => {
1177         op_flags  => "c",
1178         irn_flags => "R",
1179         reg_req   => { out => [ "xmm" ] },
1180         emit      => '. mov%XXM %C, %D0',
1181         latency   => 2,
1182         units     => [ "SSE" ],
1183         mode      => "mode_E",
1184 },
1185
1186 # Load / Store
1187
1188 xLoad => {
1189         op_flags  => "L|F",
1190         state     => "exc_pinned",
1191         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
1192         emit      => '. mov%XXM %AM, %D0',
1193         outs      => [ "res", "M" ],
1194         latency   => 2,
1195         units     => [ "SSE" ],
1196 },
1197
1198 xStore => {
1199         op_flags => "L|F",
1200         state    => "exc_pinned",
1201         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
1202         emit     => '. mov%XXM %binop',
1203         latency  => 2,
1204         units    => [ "SSE" ],
1205         mode     => "mode_M",
1206 },
1207
1208 xStoreSimple => {
1209         op_flags => "L|F",
1210         state    => "exc_pinned",
1211         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
1212         ins      => [ "base", "index", "val", "mem" ],
1213         emit     => '. mov%XXM %S2, %AM',
1214         latency  => 2,
1215         units    => [ "SSE" ],
1216         mode     => "mode_M",
1217 },
1218
1219 CvtSI2SS => {
1220         op_flags => "L|F",
1221         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm" ] },
1222         emit     => '. cvtsi2ss %D0, %AM',
1223         latency  => 2,
1224         units    => [ "SSE" ],
1225         mode     => $mode_xmm
1226 },
1227
1228 CvtSI2SD => {
1229         op_flags => "L|F",
1230         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm" ] },
1231         emit     => '. cvtsi2sd %unop2',
1232         latency  => 2,
1233         units    => [ "SSE" ],
1234         mode     => $mode_xmm
1235 },
1236
1237
1238 l_X87toSSE => {
1239         op_flags => "L|F",
1240         cmp_attr => "return 1;",
1241         arity    => 3,
1242 },
1243
1244 l_SSEtoX87 => {
1245         op_flags => "L|F",
1246         cmp_attr => "return 1;",
1247         arity    => 3,
1248 },
1249
1250 GetST0 => {
1251         op_flags => "L|F",
1252         irn_flags => "I",
1253         state    => "pinned",
1254         reg_req  => { in => [ "gp", "gp", "none" ] },
1255         emit     => '. fstp%XM %AM',
1256         latency  => 4,
1257         units    => [ "SSE" ],
1258         mode     => "mode_M",
1259 },
1260
1261 SetST0 => {
1262         op_flags => "L|F",
1263         irn_flags => "I",
1264         state    => "pinned",
1265         reg_req  => { in => [ "gp", "gp", "none" ], out => [ "vf0", "none" ] },
1266         ins      => [ "base", "index", "mem" ],
1267         emit     => '. fld%XM %AM',
1268         outs     => [ "res", "M" ],
1269         latency  => 2,
1270         units     => [ "SSE" ],
1271 },
1272
1273 # CopyB
1274
1275 CopyB => {
1276         op_flags => "F|H",
1277         state    => "pinned",
1278         reg_req  => { in => [ "edi", "esi", "ecx", "none" ], out => [ "edi", "esi", "ecx", "none" ] },
1279         outs     => [ "DST", "SRC", "CNT", "M" ],
1280         units    => [ "GP" ],
1281         modified_flags => [ "DF" ]
1282 },
1283
1284 CopyB_i => {
1285         op_flags => "F|H",
1286         state    => "pinned",
1287         reg_req  => { in => [ "edi", "esi", "none" ], out => [  "edi", "esi", "none" ] },
1288         outs     => [ "DST", "SRC", "M" ],
1289         units    => [ "GP" ],
1290         modified_flags => [ "DF" ]
1291 },
1292
1293 # Conversions
1294
1295 Conv_I2I => {
1296         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3", "none" ] },
1297         units    => [ "GP" ],
1298         ins      => [ "base", "index", "val", "mem" ],
1299         mode     => $mode_gp,
1300         modified_flags => $status_flags
1301 },
1302
1303 Conv_I2I8Bit => {
1304         reg_req  => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => [ "in_r3", "none" ] },
1305         ins      => [ "base", "index", "val", "mem" ],
1306         units    => [ "GP" ],
1307         mode     => $mode_gp,
1308         modified_flags => $status_flags
1309 },
1310
1311 Conv_I2FP => {
1312         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm", "none" ] },
1313         latency  => 10,
1314         units    => [ "SSE" ],
1315         mode     => "mode_E",
1316 },
1317
1318 Conv_FP2I => {
1319         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "gp", "none" ] },
1320         latency  => 10,
1321         units    => [ "SSE" ],
1322         mode     => $mode_gp,
1323 },
1324
1325 Conv_FP2FP => {
1326         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "xmm", "none" ] },
1327         latency  => 8,
1328         units    => [ "SSE" ],
1329         mode     => "mode_E",
1330 },
1331
1332 CmpCMov => {
1333         irn_flags => "R",
1334         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "in_r4" ] },
1335         ins       => [ "cmp_left", "cmp_right", "val_true", "val_false" ],
1336         attr      => "pn_Cmp pn_code",
1337         init_attr => "attr->pn_code = pn_code;",
1338         latency   => 2,
1339         units     => [ "GP" ],
1340         mode      => $mode_gp,
1341 },
1342
1343 xCmpCMov => {
1344         irn_flags => "R",
1345         reg_req   => { in => [ "xmm", "xmm", "gp", "gp" ], out => [ "in_r4" ] },
1346         latency   => 5,
1347         units     => [ "SSE" ],
1348         mode      => $mode_gp,
1349 },
1350
1351 vfCmpCMov => {
1352         irn_flags => "R",
1353         reg_req   => { in => [ "vfp", "vfp", "gp", "gp" ], out => [ "in_r4" ] },
1354         latency   => 10,
1355         units     => [ "VFP" ],
1356         mode      => $mode_gp,
1357         attr_type => "ia32_x87_attr_t",
1358 },
1359
1360 CmpSet => {
1361         irn_flags => "R",
1362         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "eax ebx ecx edx" ] },
1363         ins       => [ "base", "index", "cmp_left", "cmp_right", "mem" ],
1364         attr      => "pn_Cmp pn_code",
1365         init_attr => "attr->pn_code = pn_code;",
1366         latency   => 2,
1367         units     => [ "GP" ],
1368         mode      => $mode_gp,
1369 },
1370
1371 xCmpSet => {
1372         irn_flags => "R",
1373         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "eax ebx ecx edx" ] },
1374         latency   => 5,
1375         units     => [ "SSE" ],
1376         mode      => $mode_gp,
1377 },
1378
1379 vfCmpSet => {
1380         irn_flags => "R",
1381         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "eax ebx ecx edx" ] },
1382         latency   => 10,
1383         units     => [ "VFP" ],
1384         mode      => $mode_gp,
1385         attr_type => "ia32_x87_attr_t",
1386 },
1387
1388 vfCMov => {
1389         irn_flags => "R",
1390         reg_req   => { in => [ "vfp", "vfp", "vfp", "vfp" ], out => [ "vfp" ] },
1391         latency   => 10,
1392         units     => [ "VFP" ],
1393         mode      => "mode_E",
1394         attr_type => "ia32_x87_attr_t",
1395 },
1396
1397 #----------------------------------------------------------#
1398 #        _      _               _    __ _             _    #
1399 #       (_)    | |             | |  / _| |           | |   #
1400 # __   ___ _ __| |_ _   _  __ _| | | |_| | ___   __ _| |_  #
1401 # \ \ / / | '__| __| | | |/ _` | | |  _| |/ _ \ / _` | __| #
1402 #  \ V /| | |  | |_| |_| | (_| | | | | | | (_) | (_| | |_  #
1403 #   \_/ |_|_|   \__|\__,_|\__,_|_| |_| |_|\___/ \__,_|\__| #
1404 #                 | |                                      #
1405 #  _ __   ___   __| | ___  ___                             #
1406 # | '_ \ / _ \ / _` |/ _ \/ __|                            #
1407 # | | | | (_) | (_| |  __/\__ \                            #
1408 # |_| |_|\___/ \__,_|\___||___/                            #
1409 #----------------------------------------------------------#
1410
1411 vfadd => {
1412         irn_flags => "R",
1413         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1414         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1415         latency   => 4,
1416         units     => [ "VFP" ],
1417         mode      => "mode_E",
1418         attr_type => "ia32_x87_attr_t",
1419 },
1420
1421 vfmul => {
1422         irn_flags => "R",
1423         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1424         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1425         latency   => 4,
1426         units     => [ "VFP" ],
1427         mode      => "mode_E",
1428         attr_type => "ia32_x87_attr_t",
1429 },
1430
1431 l_vfmul => {
1432         op_flags  => "C",
1433         cmp_attr  => "return 1;",
1434         arity     => 2,
1435 },
1436
1437 vfsub => {
1438         irn_flags => "R",
1439         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1440         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1441         latency   => 4,
1442         units     => [ "VFP" ],
1443         mode      => "mode_E",
1444         attr_type => "ia32_x87_attr_t",
1445 },
1446
1447 l_vfsub => {
1448         cmp_attr  => "return 1;",
1449         arity     => 2,
1450 },
1451
1452 vfdiv => {
1453         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp", "none" ] },
1454         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1455         outs      => [ "res", "M" ],
1456         latency   => 20,
1457         units     => [ "VFP" ],
1458         attr_type => "ia32_x87_attr_t",
1459 },
1460
1461 l_vfdiv => {
1462         cmp_attr  => "return 1;",
1463         outs      => [ "res", "M" ],
1464         arity     => 2,
1465 },
1466
1467 vfprem => {
1468         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1469         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1470         latency   => 20,
1471         units     => [ "VFP" ],
1472         mode      => "mode_E",
1473         attr_type => "ia32_x87_attr_t",
1474 },
1475
1476 l_vfprem => {
1477         cmp_attr  => "return 1;",
1478         arity     => 2,
1479 },
1480
1481 vfabs => {
1482         irn_flags => "R",
1483         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1484         ins       => [ "value" ],
1485         latency   => 2,
1486         units     => [ "VFP" ],
1487         mode      => "mode_E",
1488         attr_type => "ia32_x87_attr_t",
1489 },
1490
1491 vfchs => {
1492         irn_flags => "R",
1493         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1494         ins       => [ "value" ],
1495         latency   => 2,
1496         units     => [ "VFP" ],
1497         mode      => "mode_E",
1498         attr_type => "ia32_x87_attr_t",
1499 },
1500
1501 # virtual Load and Store
1502
1503 vfld => {
1504         op_flags  => "L|F",
1505         state     => "exc_pinned",
1506         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1507         ins       => [ "base", "index", "mem" ],
1508         outs      => [ "res", "M" ],
1509         attr      => "ir_mode *store_mode",
1510         init_attr => "attr->attr.ls_mode = store_mode;",
1511         latency   => 2,
1512         units     => [ "VFP" ],
1513         attr_type => "ia32_x87_attr_t",
1514 },
1515
1516 vfst => {
1517         op_flags  => "L|F",
1518         state     => "exc_pinned",
1519         reg_req   => { in => [ "gp", "gp", "vfp", "none" ] },
1520         ins       => [ "base", "index", "val", "mem" ],
1521         attr      => "ir_mode *store_mode",
1522         init_attr => "attr->attr.ls_mode = store_mode;",
1523         latency   => 2,
1524         units     => [ "VFP" ],
1525         mode      => "mode_M",
1526         attr_type => "ia32_x87_attr_t",
1527 },
1528
1529 # Conversions
1530
1531 vfild => {
1532         state     => "exc_pinned",
1533         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1534         outs      => [ "res", "M" ],
1535         ins       => [ "base", "index", "mem" ],
1536         latency   => 4,
1537         units     => [ "VFP" ],
1538         attr_type => "ia32_x87_attr_t",
1539 },
1540
1541 l_vfild => {
1542         cmp_attr  => "return 1;",
1543         outs      => [ "res", "M" ],
1544         arity     => 2,
1545 },
1546
1547 vfist => {
1548         state     => "exc_pinned",
1549         reg_req   => { in => [ "gp", "gp", "vfp", "fpcw", "none" ] },
1550         ins       => [ "base", "index", "val", "fpcw", "mem" ],
1551         latency   => 4,
1552         units     => [ "VFP" ],
1553         mode      => "mode_M",
1554         attr_type => "ia32_x87_attr_t",
1555 },
1556
1557 l_vfist => {
1558         cmp_attr  => "return 1;",
1559         state     => "exc_pinned",
1560         arity     => 3,
1561         mode      => "mode_M",
1562 },
1563
1564
1565 # constants
1566
1567 vfldz => {
1568         irn_flags => "R",
1569         reg_req   => { out => [ "vfp" ] },
1570         latency   => 4,
1571         units     => [ "VFP" ],
1572         mode      => "mode_E",
1573         attr_type => "ia32_x87_attr_t",
1574 },
1575
1576 vfld1 => {
1577         irn_flags => "R",
1578         reg_req   => { out => [ "vfp" ] },
1579         latency   => 4,
1580         units     => [ "VFP" ],
1581         mode      => "mode_E",
1582         attr_type => "ia32_x87_attr_t",
1583 },
1584
1585 vfldpi => {
1586         irn_flags => "R",
1587         reg_req   => { out => [ "vfp" ] },
1588         latency   => 4,
1589         units     => [ "VFP" ],
1590         mode      => "mode_E",
1591         attr_type => "ia32_x87_attr_t",
1592 },
1593
1594 vfldln2 => {
1595         irn_flags => "R",
1596         reg_req   => { out => [ "vfp" ] },
1597         latency   => 4,
1598         units     => [ "VFP" ],
1599         mode      => "mode_E",
1600         attr_type => "ia32_x87_attr_t",
1601 },
1602
1603 vfldlg2 => {
1604         irn_flags => "R",
1605         reg_req   => { out => [ "vfp" ] },
1606         latency   => 4,
1607         units     => [ "VFP" ],
1608         mode      => "mode_E",
1609         attr_type => "ia32_x87_attr_t",
1610 },
1611
1612 vfldl2t => {
1613         irn_flags => "R",
1614         reg_req   => { out => [ "vfp" ] },
1615         latency   => 4,
1616         units     => [ "VFP" ],
1617         mode      => "mode_E",
1618         attr_type => "ia32_x87_attr_t",
1619 },
1620
1621 vfldl2e => {
1622         irn_flags => "R",
1623         reg_req   => { out => [ "vfp" ] },
1624         latency   => 4,
1625         units     => [ "VFP" ],
1626         mode      => "mode_E",
1627         attr_type => "ia32_x87_attr_t",
1628 },
1629
1630 vfConst => {
1631         op_flags  => "c",
1632         irn_flags => "R",
1633         reg_req   => { out => [ "vfp" ] },
1634         latency   => 3,
1635         units     => [ "VFP" ],
1636         mode      => "mode_E",
1637         attr_type => "ia32_x87_attr_t",
1638 },
1639
1640 # other
1641
1642 vfCondJmp => {
1643         state     => "pinned",
1644         op_flags  => "L|X|Y",
1645         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "none", "none", "eax" ] },
1646         outs      => [ "false", "true", "temp_reg_eax" ],
1647         latency   => 10,
1648         units     => [ "VFP" ],
1649         attr_type => "ia32_x87_attr_t",
1650 },
1651
1652 #------------------------------------------------------------------------#
1653 #       ___ _____    __ _             _                     _            #
1654 # __  _( _ )___  |  / _| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
1655 # \ \/ / _ \  / /  | |_| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1656 #  >  < (_) |/ /   |  _| | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
1657 # /_/\_\___//_/    |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1658 #------------------------------------------------------------------------#
1659
1660 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
1661 #       are swapped, we work this around in the emitter...
1662
1663 fadd => {
1664         op_flags  => "R",
1665         rd_constructor => "NONE",
1666         reg_req   => { },
1667         emit      => '. fadd%XM %x87_binop',
1668         attr_type => "ia32_x87_attr_t",
1669 },
1670
1671 faddp => {
1672         op_flags  => "R",
1673         rd_constructor => "NONE",
1674         reg_req   => { },
1675         emit      => '. faddp %x87_binop',
1676         attr_type => "ia32_x87_attr_t",
1677 },
1678
1679 fmul => {
1680         op_flags  => "R",
1681         rd_constructor => "NONE",
1682         reg_req   => { },
1683         emit      => '. fmul%XM %x87_binop',
1684         attr_type => "ia32_x87_attr_t",
1685 },
1686
1687 fmulp => {
1688         op_flags  => "R",
1689         rd_constructor => "NONE",
1690         reg_req   => { },
1691         emit      => '. fmulp %x87_binop',,
1692         attr_type => "ia32_x87_attr_t",
1693 },
1694
1695 fsub => {
1696         op_flags  => "R",
1697         rd_constructor => "NONE",
1698         reg_req   => { },
1699         emit      => '. fsub%XM %x87_binop',
1700         attr_type => "ia32_x87_attr_t",
1701 },
1702
1703 fsubp => {
1704         op_flags  => "R",
1705         rd_constructor => "NONE",
1706         reg_req   => { },
1707 # see note about gas bugs
1708         emit      => '. fsubrp %x87_binop',
1709         attr_type => "ia32_x87_attr_t",
1710 },
1711
1712 fsubr => {
1713         op_flags  => "R",
1714         rd_constructor => "NONE",
1715         irn_flags => "R",
1716         reg_req   => { },
1717         emit      => '. fsubr%XM %x87_binop',
1718         attr_type => "ia32_x87_attr_t",
1719 },
1720
1721 fsubrp => {
1722         op_flags  => "R",
1723         rd_constructor => "NONE",
1724         irn_flags => "R",
1725         reg_req   => { },
1726 # see note about gas bugs
1727         emit      => '. fsubp %x87_binop',
1728         attr_type => "ia32_x87_attr_t",
1729 },
1730
1731 fprem => {
1732         op_flags  => "R",
1733         rd_constructor => "NONE",
1734         reg_req   => { },
1735         emit      => '. fprem1',
1736         attr_type => "ia32_x87_attr_t",
1737 },
1738
1739 # this node is just here, to keep the simulator running
1740 # we can omit this when a fprem simulation function exists
1741 fpremp => {
1742         op_flags  => "R",
1743         rd_constructor => "NONE",
1744         reg_req   => { },
1745         emit      => '. fprem1',
1746         attr_type => "ia32_x87_attr_t",
1747 },
1748
1749 fdiv => {
1750         op_flags  => "R",
1751         rd_constructor => "NONE",
1752         reg_req   => { },
1753         emit      => '. fdiv%XM %x87_binop',
1754         attr_type => "ia32_x87_attr_t",
1755 },
1756
1757 fdivp => {
1758         op_flags  => "R",
1759         rd_constructor => "NONE",
1760         reg_req   => { },
1761 # see note about gas bugs
1762         emit      => '. fdivrp %x87_binop',
1763         attr_type => "ia32_x87_attr_t",
1764 },
1765
1766 fdivr => {
1767         op_flags  => "R",
1768         rd_constructor => "NONE",
1769         reg_req   => { },
1770         emit      => '. fdivr%XM %x87_binop',
1771         attr_type => "ia32_x87_attr_t",
1772 },
1773
1774 fdivrp => {
1775         op_flags  => "R",
1776         rd_constructor => "NONE",
1777         reg_req   => { },
1778 # see note about gas bugs
1779         emit      => '. fdivp %x87_binop',
1780         attr_type => "ia32_x87_attr_t",
1781 },
1782
1783 fabs => {
1784         op_flags  => "R",
1785         rd_constructor => "NONE",
1786         reg_req   => { },
1787         emit      => '. fabs',
1788         attr_type => "ia32_x87_attr_t",
1789 },
1790
1791 fchs => {
1792         op_flags  => "R|K",
1793         rd_constructor => "NONE",
1794         reg_req   => { },
1795         emit      => '. fchs',
1796         attr_type => "ia32_x87_attr_t",
1797 },
1798
1799 # x87 Load and Store
1800
1801 fld => {
1802         rd_constructor => "NONE",
1803         op_flags  => "R|L|F",
1804         state     => "exc_pinned",
1805         reg_req   => { },
1806         emit      => '. fld%XM %AM',
1807         attr_type => "ia32_x87_attr_t",
1808 },
1809
1810 fst => {
1811         rd_constructor => "NONE",
1812         op_flags  => "R|L|F",
1813         state     => "exc_pinned",
1814         reg_req   => { },
1815         emit      => '. fst%XM %AM',
1816         mode      => "mode_M",
1817         attr_type => "ia32_x87_attr_t",
1818 },
1819
1820 fstp => {
1821         rd_constructor => "NONE",
1822         op_flags  => "R|L|F",
1823         state     => "exc_pinned",
1824         reg_req   => { },
1825         emit      => '. fstp%XM %AM',
1826         mode      => "mode_M",
1827         attr_type => "ia32_x87_attr_t",
1828 },
1829
1830 # Conversions
1831
1832 fild => {
1833         op_flags  => "R",
1834         rd_constructor => "NONE",
1835         reg_req   => { },
1836         emit      => '. fild%XM %AM',
1837         attr_type => "ia32_x87_attr_t",
1838 },
1839
1840 fist => {
1841         op_flags  => "R",
1842         state     => "exc_pinned",
1843         rd_constructor => "NONE",
1844         reg_req   => { },
1845         emit      => '. fist%XM %AM',
1846         mode      => "mode_M",
1847         attr_type => "ia32_x87_attr_t",
1848 },
1849
1850 fistp => {
1851         op_flags  => "R",
1852         state     => "exc_pinned",
1853         rd_constructor => "NONE",
1854         reg_req   => { },
1855         emit      => '. fistp%XM %AM',
1856         mode      => "mode_M",
1857         attr_type => "ia32_x87_attr_t",
1858 },
1859
1860 # constants
1861
1862 fldz => {
1863         op_flags  => "R|c|K",
1864         irn_flags  => "R",
1865         reg_req   => { },
1866         emit      => '. fldz',
1867         attr_type => "ia32_x87_attr_t",
1868 },
1869
1870 fld1 => {
1871         op_flags  => "R|c|K",
1872         irn_flags  => "R",
1873         reg_req   => { },
1874         emit      => '. fld1',
1875         attr_type => "ia32_x87_attr_t",
1876 },
1877
1878 fldpi => {
1879         op_flags  => "R|c|K",
1880         irn_flags  => "R",
1881         reg_req   => { },
1882         emit      => '. fldpi',
1883         attr_type => "ia32_x87_attr_t",
1884 },
1885
1886 fldln2 => {
1887         op_flags  => "R|c|K",
1888         irn_flags  => "R",
1889         reg_req   => { },
1890         emit      => '. fldln2',
1891         attr_type => "ia32_x87_attr_t",
1892 },
1893
1894 fldlg2 => {
1895         op_flags  => "R|c|K",
1896         irn_flags  => "R",
1897         reg_req   => { },
1898         emit      => '. fldlg2',
1899         attr_type => "ia32_x87_attr_t",
1900 },
1901
1902 fldl2t => {
1903         op_flags  => "R|c|K",
1904         irn_flags  => "R",
1905         reg_req   => { },
1906         emit      => '. fldll2t',
1907         attr_type => "ia32_x87_attr_t",
1908 },
1909
1910 fldl2e => {
1911         op_flags  => "R|c|K",
1912         irn_flags  => "R",
1913         reg_req   => { },
1914         emit      => '. fldl2e',
1915         attr_type => "ia32_x87_attr_t",
1916 },
1917
1918 # fxch, fpush, fpop
1919 # Note that it is NEVER allowed to do CSE on these nodes
1920 # Moreover, note the virtual register requierements!
1921
1922 fxch => {
1923         op_flags  => "R|K",
1924         reg_req   => { },
1925         cmp_attr  => "return 1;",
1926         emit      => '. fxch %X0',
1927         attr_type => "ia32_x87_attr_t",
1928 },
1929
1930 fpush => {
1931         op_flags  => "R|K",
1932         reg_req   => {},
1933         cmp_attr  => "return 1;",
1934         emit      => '. fld %X0',
1935         attr_type => "ia32_x87_attr_t",
1936 },
1937
1938 fpushCopy => {
1939         op_flags  => "R",
1940         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1941         cmp_attr  => "return 1;",
1942         emit      => '. fld %X0',
1943         attr_type => "ia32_x87_attr_t",
1944 },
1945
1946 fpop => {
1947         op_flags  => "R|K",
1948         reg_req   => { },
1949         cmp_attr  => "return 1;",
1950         emit      => '. fstp %X0',
1951         attr_type => "ia32_x87_attr_t",
1952 },
1953
1954 # compare
1955
1956 fcomJmp => {
1957         op_flags  => "L|X|Y",
1958         reg_req   => { },
1959         attr_type => "ia32_x87_attr_t",
1960 },
1961
1962 fcompJmp => {
1963         op_flags  => "L|X|Y",
1964         reg_req   => { },
1965         attr_type => "ia32_x87_attr_t",
1966 },
1967
1968 fcomppJmp => {
1969         op_flags  => "L|X|Y",
1970         reg_req   => { },
1971         attr_type => "ia32_x87_attr_t",
1972 },
1973
1974 fcomrJmp => {
1975         op_flags  => "L|X|Y",
1976         reg_req   => { },
1977         attr_type => "ia32_x87_attr_t",
1978 },
1979
1980 fcomrpJmp => {
1981         op_flags  => "L|X|Y",
1982         reg_req   => { },
1983         attr_type => "ia32_x87_attr_t",
1984 },
1985
1986 fcomrppJmp => {
1987         op_flags  => "L|X|Y",
1988         reg_req   => { },
1989         attr_type => "ia32_x87_attr_t",
1990 },
1991
1992
1993 # -------------------------------------------------------------------------------- #
1994 #  ____ ____  _____                  _                               _             #
1995 # / ___/ ___|| ____| __   _____  ___| |_ ___  _ __   _ __   ___   __| | ___  ___   #
1996 # \___ \___ \|  _|   \ \ / / _ \/ __| __/ _ \| '__| | '_ \ / _ \ / _` |/ _ \/ __|  #
1997 #  ___) |__) | |___   \ V /  __/ (__| || (_) | |    | | | | (_) | (_| |  __/\__ \  #
1998 # |____/____/|_____|   \_/ \___|\___|\__\___/|_|    |_| |_|\___/ \__,_|\___||___/  #
1999 #                                                                                  #
2000 # -------------------------------------------------------------------------------- #
2001
2002
2003 # Spilling and reloading of SSE registers, hardcoded, not generated #
2004
2005 xxLoad => {
2006         op_flags  => "L|F",
2007         state     => "exc_pinned",
2008         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2009         emit      => '. movdqu %D0, %AM',
2010         outs      => [ "res", "M" ],
2011         units     => [ "SSE" ],
2012 },
2013
2014 xxStore => {
2015         op_flags => "L|F",
2016         state    => "exc_pinned",
2017         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
2018         emit     => '. movdqu %binop',
2019         units    => [ "SSE" ],
2020         mode     => "mode_M",
2021 },
2022
2023 ); # end of %nodes
2024
2025 # Include the generated SIMD node specification written by the SIMD optimization
2026 $my_script_name = dirname($myname) . "/../ia32/ia32_simd_spec.pl";
2027 unless ($return = do $my_script_name) {
2028         warn "couldn't parse $my_script_name: $@" if $@;
2029         warn "couldn't do $my_script_name: $!"    unless defined $return;
2030         warn "couldn't run $my_script_name"       unless $return;
2031 }