6f7caacb6a6e71301f92500cb0b24c47b7347495
[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 $default_copy_attr = "ia32_copy_attr";
298
299 %init_attr = (
300         ia32_attr_t     => "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);",
301         ia32_x87_attr_t =>
302                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
303                 "\tinit_ia32_x87_attributes(res);",
304         ia32_asm_attr_t =>
305                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
306                 "\tinit_ia32_x87_attributes(res);".
307                 "\tinit_ia32_asm_attributes(res);",
308         ia32_immediate_attr_t =>
309                 "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
310                 "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, offset);"
311 );
312
313 %compare_attr = (
314         ia32_attr_t           => "ia32_compare_nodes_attr",
315         ia32_x87_attr_t       => "ia32_compare_x87_attr",
316         ia32_asm_attr_t       => "ia32_compare_asm_attr",
317         ia32_immediate_attr_t => "ia32_compare_immediate_attr",
318 );
319
320 %operands = (
321 );
322
323 $mode_xmm     = "mode_E";
324 $mode_gp      = "mode_Iu";
325 $mode_fpcw    = "mode_fpcw";
326 $status_flags = [ "CF", "PF", "AF", "ZF", "SF", "OF" ];
327 $fpcw_flags   = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
328                   "FP_PC0", "FP_PC1", "FP_RC0", "FP_RC1", "FP_X" ];
329
330 %nodes = (
331
332 Immediate => {
333         state     => "pinned",
334         op_flags  => "c",
335         irn_flags => "I",
336         reg_req   => { out => [ "gp_NOREG" ] },
337         attr      => "ir_entity *symconst, int symconst_sign, long offset",
338         attr_type => "ia32_immediate_attr_t",
339         latency   => 0,
340         mode      => $mode_gp,
341 },
342
343 Asm => {
344         mode      => "mode_T",
345         arity     => "variable",
346         out_arity => "variable",
347         attr_type => "ia32_asm_attr_t",
348         latency   => 100,
349 },
350
351 ProduceVal => {
352         op_flags  => "c",
353         irn_flags => "R",
354         reg_req   => { out => [ "gp" ] },
355         emit      => "",
356         units     => [ ],
357         latency   => 0,
358         mode      => $mode_gp,
359 },
360
361 #-----------------------------------------------------------------#
362 #  _       _                                         _            #
363 # (_)     | |                                       | |           #
364 #  _ _ __ | |_ ___  __ _  ___ _ __   _ __   ___   __| | ___  ___  #
365 # | | '_ \| __/ _ \/ _` |/ _ \ '__| | '_ \ / _ \ / _` |/ _ \/ __| #
366 # | | | | | ||  __/ (_| |  __/ |    | | | | (_) | (_| |  __/\__ \ #
367 # |_|_| |_|\__\___|\__, |\___|_|    |_| |_|\___/ \__,_|\___||___/ #
368 #                   __/ |                                         #
369 #                  |___/                                          #
370 #-----------------------------------------------------------------#
371
372 # commutative operations
373
374 # NOTE:
375 # All nodes supporting Addressmode have 5 INs:
376 # 1 - base    r1 == NoReg in case of no AM or no base
377 # 2 - index   r2 == NoReg in case of no AM or no index
378 # 3 - op1     r3 == always present
379 # 4 - op2     r4 == NoReg in case of immediate operation
380 # 5 - mem     NoMem in case of no AM otherwise it takes the mem from the Load
381
382 Add => {
383         irn_flags => "R",
384         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
385         ins       => [ "base", "index", "left", "right", "mem" ],
386         emit      => '. add%M %binop',
387         units     => [ "GP" ],
388         mode      => $mode_gp,
389         modified_flags => $status_flags
390 },
391
392 Adc => {
393         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
394         emit      => '. adc%M %binop',
395         units     => [ "GP" ],
396         mode      => $mode_gp,
397         modified_flags => $status_flags
398 },
399
400 Add64Bit => {
401         irn_flags => "R",
402         arity     => 4,
403         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
404         emit      => '
405 . movl %S0, %D0
406 . movl %S1, %D1
407 . addl %S2, %D0
408 . adcl %S3, %D1
409 ',
410         outs      => [ "low_res", "high_res" ],
411         units     => [ "GP" ],
412         modified_flags => $status_flags
413 },
414
415 l_Add => {
416         op_flags  => "C",
417         irn_flags => "R",
418         cmp_attr  => "return 1;",
419         arity     => 2,
420 },
421
422 l_Adc => {
423         op_flags  => "C",
424         cmp_attr  => "return 1;",
425         arity     => 2,
426 },
427
428 Mul => {
429         # we should not rematrialize this node. It produces 2 results and has
430         # very strict constrains
431         reg_req   => { in => [ "gp", "gp", "eax", "gp", "none" ], out => [ "eax", "edx", "none" ] },
432         emit      => '. mul%M %unop3',
433         outs      => [ "EAX", "EDX", "M" ],
434         ins       => [ "base", "index", "val_high", "val_low", "mem" ],
435         latency   => 10,
436         units     => [ "GP" ],
437         modified_flags => $status_flags
438 },
439
440 l_Mul => {
441         # we should not rematrialize this node. It produces 2 results and has
442         # very strict constrains
443         op_flags  => "C",
444         cmp_attr  => "return 1;",
445         outs      => [ "EAX", "EDX", "M" ],
446         arity     => 2
447 },
448
449 IMul => {
450         irn_flags => "R",
451         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
452         emit      => '. imul%M %binop',
453         latency   => 5,
454         units     => [ "GP" ],
455         mode      => $mode_gp,
456         modified_flags => $status_flags
457 },
458
459 IMul1OP => {
460         irn_flags => "R",
461         reg_req   => { in => [ "gp", "gp", "eax", "gp", "none" ], out => [ "eax", "edx", "none" ] },
462         emit      => '. imul%M %unop3',
463         outs      => [ "EAX", "EDX", "M" ],
464         ins       => [ "base", "index", "val_high", "val_low", "mem" ],
465         latency   => 5,
466         units     => [ "GP" ],
467         modified_flags => $status_flags
468 },
469
470 l_IMul => {
471         op_flags  => "C",
472         cmp_attr  => "return 1;",
473         arity     => 2
474 },
475
476 And => {
477         irn_flags => "R",
478         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
479         emit      => '. and%M %binop',
480         units     => [ "GP" ],
481         mode      => $mode_gp,
482         modified_flags => $status_flags
483 },
484
485 Or => {
486         irn_flags => "R",
487         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
488         emit      => '. or%M %binop',
489         units     => [ "GP" ],
490         mode      => $mode_gp,
491         modified_flags => $status_flags
492 },
493
494 Xor => {
495         irn_flags => "R",
496         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
497         emit      => '. xor%M %binop',
498         units     => [ "GP" ],
499         mode      => $mode_gp,
500         modified_flags => $status_flags
501 },
502
503 l_Xor => {
504         op_flags  => "C",
505         cmp_attr  => "return 1;",
506         arity     => 2,
507         modified_flags => $status_flags
508 },
509
510 # not commutative operations
511
512 Sub => {
513         irn_flags => "R",
514         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
515         emit      => '. sub%M %binop',
516         units     => [ "GP" ],
517         mode      => $mode_gp,
518         modified_flags => $status_flags
519 },
520
521 Sbb => {
522         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3 !in_r4" ] },
523         emit      => '. sbb%M %binop',
524         units     => [ "GP" ],
525         mode      => $mode_gp,
526         modified_flags => $status_flags
527 },
528
529 Sub64Bit => {
530         irn_flags => "R",
531         arity     => 4,
532         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
533         emit      => '
534 . movl %S0, %D0
535 . movl %S1, %D1
536 . subl %S2, %D0
537 . sbbl %S3, %D1
538 ',
539         outs      => [ "low_res", "high_res" ],
540         units     => [ "GP" ],
541         modified_flags => $status_flags
542 },
543
544 l_Sub => {
545         irn_flags => "R",
546         cmp_attr  => "return 1;",
547         arity     => 2,
548 },
549
550 l_Sbb => {
551         cmp_attr  => "return 1;",
552         arity     => 2,
553 },
554
555 IDiv => {
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      => ". idiv%M %unop4",
562         outs      => [ "div_res", "mod_res", "M" ],
563         latency   => 25,
564         units     => [ "GP" ],
565         modified_flags => $status_flags
566 },
567
568 Div => {
569         op_flags  => "F|L",
570         state     => "exc_pinned",
571         reg_req   => { in => [ "gp", "gp", "eax", "edx", "gp", "none" ], out => [ "eax", "edx", "none" ] },
572         attr      => "ia32_op_flavour_t dm_flav",
573         init_attr => "attr->data.op_flav = dm_flav;",
574         emit      => ". div%M %unop4",
575         outs      => [ "div_res", "mod_res", "M" ],
576         latency   => 25,
577         units     => [ "GP" ],
578         modified_flags => $status_flags
579 },
580
581 Shl => {
582         irn_flags => "R",
583         # "in_r3" would be enough as out requirement, but the register allocator
584         # does strange things then and doesn't respect the constraint for in4
585         # if the same value is attached to in3 and in4 (if you have "i << i" in C)
586         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
587         ins       => [ "base", "index", "left", "right", "mem" ],
588         emit      => '. shl%M %binop',
589         units     => [ "GP" ],
590         mode      => $mode_gp,
591         modified_flags => $status_flags
592 },
593
594 l_Shl => {
595         cmp_attr  => "return 1;",
596         arity     => 2
597 },
598
599 ShlD => {
600         irn_flags => "R",
601         # Out requirements is: different from all in
602         # This is because, out must be different from LowPart and ShiftCount.
603         # We could say "!ecx !in_r4" but it can occur, that all values live through
604         # this Shift and the only value dying is the ShiftCount. Then there would be
605         # a register missing, as result must not be ecx and all other registers are
606         # occupied. What we should write is "!in_r4 !in_r5", but this is not
607         # supported (and probably never will). So we create artificial interferences
608         # of the result with all inputs, so the spiller can always assure a free
609         # register.
610         reg_req   => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
611         emit      =>
612 '
613 if (get_ia32_immop_type(node) == ia32_ImmNone) {
614         if (get_ia32_op_type(node) == ia32_AddrModeD) {
615                 . shld%M %%cl, %S3, %AM
616         } else {
617                 . shld%M %%cl, %S3, %S2
618         }
619 } else {
620         if (get_ia32_op_type(node) == ia32_AddrModeD) {
621                 . shld%M %C, %S3, %AM
622         } else {
623                 . shld%M %C, %S3, %S2
624         }
625 }
626 ',
627         latency   => 6,
628         units     => [ "GP" ],
629         mode      => $mode_gp,
630         modified_flags => $status_flags
631 },
632
633 l_ShlD => {
634         cmp_attr  => "return 1;",
635         arity     => 3,
636 },
637
638 Shr => {
639         irn_flags => "R",
640         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
641         emit      => '. shr%M %binop',
642         units     => [ "GP" ],
643         mode      => $mode_gp,
644         modified_flags => $status_flags
645 },
646
647 l_Shr => {
648         cmp_attr  => "return 1;",
649         arity     => 2
650 },
651
652 ShrD => {
653         irn_flags => "R",
654         # Out requirements is: different from all in
655         # This is because, out must be different from LowPart and ShiftCount.
656         # We could say "!ecx !in_r4" but it can occur, that all values live through
657         # this Shift and the only value dying is the ShiftCount. Then there would be a
658         # register missing, as result must not be ecx and all other registers are
659         # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
660         # (and probably never will). So we create artificial interferences of the result
661         # with all inputs, so the spiller can always assure a free register.
662         reg_req   => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
663         emit      => '
664 if (get_ia32_immop_type(node) == ia32_ImmNone) {
665         if (get_ia32_op_type(node) == ia32_AddrModeD) {
666                 . shrd%M %%cl, %S3, %AM
667         } else {
668                 . shrd%M %%cl, %S3, %S2
669         }
670 } else {
671         if (get_ia32_op_type(node) == ia32_AddrModeD) {
672                 . shrd%M %C, %S3, %AM
673         } else {
674                 . shrd%M %C, %S3, %S2
675         }
676 }
677 ',
678         latency   => 6,
679         units     => [ "GP" ],
680         mode      => $mode_gp,
681         modified_flags => $status_flags
682 },
683
684 l_ShrD => {
685         cmp_attr  => "return 1;",
686         arity     => 3
687 },
688
689 Sar => {
690         irn_flags => "R",
691         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
692         emit      => '. sar%M %binop',
693         units     => [ "GP" ],
694         mode      => $mode_gp,
695         modified_flags => $status_flags
696 },
697
698 l_Sar => {
699         cmp_attr  => "return 1;",
700         arity     => 2
701 },
702
703 Ror => {
704         irn_flags => "R",
705         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
706         emit      => '. ror%M %binop',
707         units     => [ "GP" ],
708         mode      => $mode_gp,
709         modified_flags => $status_flags
710 },
711
712 Rol => {
713         irn_flags => "R",
714         reg_req   => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
715         emit      => '. rol%M %binop',
716         units     => [ "GP" ],
717         mode      => $mode_gp,
718         modified_flags => $status_flags
719 },
720
721 # unary operations
722
723 Neg => {
724         irn_flags => "R",
725         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
726         emit      => '. neg%M %unop2',
727         ins       => [ "base", "index", "val", "mem" ],
728         units     => [ "GP" ],
729         mode      => $mode_gp,
730         modified_flags => $status_flags
731 },
732
733 Minus64Bit => {
734         irn_flags => "R",
735         reg_req   => { in => [ "gp", "gp", "gp" ], out => [ "!in", "!in" ] },
736         emit      => '
737 . movl %S0, %D0
738 . movl %S0, %D1
739 . subl %S1, %D0
740 . sbbl %S2, %D1
741 ',
742         outs      => [ "low_res", "high_res" ],
743         units     => [ "GP" ],
744         modified_flags => $status_flags
745 },
746
747
748 l_Neg => {
749         cmp_attr  => "return 1;",
750         arity     => 1,
751 },
752
753 Inc => {
754         irn_flags => "R",
755         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
756         emit      => '. inc%M %unop2',
757         units     => [ "GP" ],
758         mode      => $mode_gp,
759         modified_flags => [ "OF", "SF", "ZF", "AF", "PF" ]
760 },
761
762 Dec => {
763         irn_flags => "R",
764         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
765         emit      => '. dec%M %unop2',
766         units     => [ "GP" ],
767         mode      => $mode_gp,
768         modified_flags => [ "OF", "SF", "ZF", "AF", "PF" ]
769 },
770
771 Not => {
772         irn_flags => "R",
773         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
774         ins       => [ "base", "index", "val", "mem" ],
775         emit      => '. not%M %unop2',
776         units     => [ "GP" ],
777         mode      => $mode_gp,
778         modified_flags => []
779 },
780
781 # other operations
782
783 CondJmp => {
784         state     => "pinned",
785         op_flags  => "L|X|Y",
786         reg_req   => { in  => [ "gp", "gp", "gp", "gp", "none" ],
787                        out => [ "none", "none"] },
788         ins       => [ "base", "index", "left", "right", "mem" ],
789         outs      => [ "false", "true" ],
790         attr      => "long pnc",
791         init_attr => "attr->pn_code = pnc;",
792         latency   => 3,
793         units     => [ "BRANCH" ],
794 },
795
796 TestJmp => {
797         state     => "pinned",
798         op_flags  => "L|X|Y",
799         reg_req   => { in  => [ "gp", "gp", "gp", "gp", "none" ],
800                        out => [ "none", "none" ] },
801         ins       => [ "base", "index", "left", "right", "mem" ],
802         outs      => [ "false", "true" ],
803         attr      => "long pnc",
804         init_attr => "attr->pn_code = pnc;",
805         latency   => 3,
806         units     => [ "BRANCH" ],
807 },
808
809 SwitchJmp => {
810         state     => "pinned",
811         op_flags  => "L|X|Y",
812         reg_req   => { in => [ "gp" ], out => [ "none" ] },
813         latency   => 3,
814         units     => [ "BRANCH" ],
815         mode      => "mode_T",
816 },
817
818 Const => {
819         op_flags  => "c",
820         irn_flags => "R",
821         reg_req   => { out => [ "gp" ] },
822         units     => [ "GP" ],
823         mode      => $mode_gp,
824 },
825
826 Unknown_GP => {
827         state     => "pinned",
828         op_flags  => "c",
829         irn_flags => "I",
830         reg_req   => { out => [ "gp_UKNWN" ] },
831         units     => [],
832         emit      => "",
833         mode      => $mode_gp
834 },
835
836 Unknown_VFP => {
837         state     => "pinned",
838         op_flags  => "c",
839         irn_flags => "I",
840         reg_req   => { out => [ "vfp_UKNWN" ] },
841         units     => [],
842         emit      => "",
843         mode      => "mode_E",
844         attr_type => "ia32_x87_attr_t",
845 },
846
847 Unknown_XMM => {
848         state     => "pinned",
849         op_flags  => "c",
850         irn_flags => "I",
851         reg_req   => { out => [ "xmm_UKNWN" ] },
852         units     => [],
853         emit      => "",
854         mode      => "mode_E"
855 },
856
857 NoReg_GP => {
858         state     => "pinned",
859         op_flags  => "c",
860         irn_flags => "I",
861         reg_req   => { out => [ "gp_NOREG" ] },
862         units     => [],
863         emit      => "",
864         mode      => $mode_gp
865 },
866
867 NoReg_VFP => {
868         state     => "pinned",
869         op_flags  => "c",
870         irn_flags => "I",
871         reg_req   => { out => [ "vfp_NOREG" ] },
872         units     => [],
873         emit      => "",
874         mode      => "mode_E",
875         attr_type => "ia32_x87_attr_t",
876 },
877
878 NoReg_XMM => {
879         state     => "pinned",
880         op_flags  => "c",
881         irn_flags => "I",
882         reg_req   => { out => [ "xmm_NOREG" ] },
883         units     => [],
884         emit      => "",
885         mode      => "mode_E"
886 },
887
888 ChangeCW => {
889         state     => "pinned",
890         op_flags  => "c",
891         irn_flags => "I",
892         reg_req   => { out => [ "fp_cw" ] },
893         mode      => $mode_fpcw,
894         latency   => 3,
895         units     => [ "GP" ],
896         modified_flags => $fpcw_flags
897 },
898
899 FldCW => {
900         op_flags  => "L|F",
901         state     => "pinned",
902         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "fp_cw" ] },
903         latency   => 5,
904         emit      => ". fldcw %AM",
905         mode      => $mode_fpcw,
906         units     => [ "GP" ],
907         modified_flags => $fpcw_flags
908 },
909
910 FnstCW => {
911         op_flags  => "L|F",
912         state     => "pinned",
913         reg_req   => { in => [ "gp", "gp", "fp_cw", "none" ], out => [ "none" ] },
914         latency   => 5,
915         emit      => ". fnstcw %AM",
916         mode      => "mode_M",
917         units     => [ "GP" ],
918 },
919
920 Cltd => {
921         # we should not rematrialize this node. It produces 2 results and has
922         # very strict constrains
923         reg_req   => { in => [ "eax", "edx" ], out => [ "edx" ] },
924         ins       => [ "val", "globbered" ],
925         emit      => '. cltd',
926         mode      => $mode_gp,
927         units     => [ "GP" ],
928 },
929
930 # Load / Store
931 #
932 # Note that we add additional latency values depending on address mode, so a
933 # lateny of 0 for load is correct
934
935 Load => {
936         op_flags  => "L|F",
937         state     => "exc_pinned",
938         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "gp", "none" ] },
939         ins       => [ "base", "index", "mem" ],
940         outs      => [ "res", "M" ],
941         latency   => 0,
942         emit      => ". mov%SE%ME%.l %AM, %D0",
943         units     => [ "GP" ],
944 },
945
946 l_Load => {
947         op_flags  => "L|F",
948         cmp_attr  => "return 1;",
949         outs      => [ "res", "M" ],
950         arity     => 2,
951 },
952
953 l_Store => {
954         op_flags  => "L|F",
955         cmp_attr  => "return 1;",
956         state     => "exc_pinned",
957         arity     => 3,
958         mode      => "mode_M",
959 },
960
961 Store => {
962         op_flags  => "L|F",
963         state     => "exc_pinned",
964         reg_req   => { in => [ "gp", "gp", "gp", "none" ], out => [ "none" ] },
965         ins       => [ "base", "index", "val", "mem" ],
966         emit      => '. mov%M %binop',
967         latency   => 2,
968         units     => [ "GP" ],
969         mode      => "mode_M",
970 },
971
972 Store8Bit => {
973         op_flags  => "L|F",
974         state     => "exc_pinned",
975         reg_req   => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => ["none" ] },
976         emit      => '. mov%M %binop',
977         latency   => 2,
978         units     => [ "GP" ],
979         mode      => "mode_M",
980 },
981
982 Lea => {
983         irn_flags => "R",
984         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
985         emit      => '. leal %AM, %D0',
986         latency   => 2,
987         units     => [ "GP" ],
988         mode      => $mode_gp,
989         modified_flags => [],
990 },
991
992 Push => {
993         reg_req   => { in => [ "gp", "gp", "gp", "esp", "none" ], out => [ "esp", "none" ] },
994         emit      => '. push%M %unop2',
995         ins       => [ "base", "index", "val", "stack", "mem" ],
996         outs      => [ "stack:I|S", "M" ],
997         latency   => 2,
998         units     => [ "GP" ],
999         modified_flags => [],
1000 },
1001
1002 Pop => {
1003         reg_req   => { in => [ "gp", "gp", "esp", "none" ], out => [ "esp", "gp", "none" ] },
1004         emit      => '. pop%M %DAM1',
1005         outs      => [ "stack:I|S", "res", "M" ],
1006         ins       => [ "base", "index", "stack", "mem" ],
1007         latency   => 3, # Pop is more expensive than Push on Athlon
1008         units     => [ "GP" ],
1009         modified_flags => [],
1010 },
1011
1012 Enter => {
1013         reg_req   => { in => [ "esp" ], out => [ "ebp", "esp", "none" ] },
1014         emit      => '. enter',
1015         outs      => [ "frame:I", "stack:I|S", "M" ],
1016         latency   => 15,
1017         units     => [ "GP" ],
1018 },
1019
1020 Leave => {
1021         reg_req   => { in => [ "esp", "ebp" ], out => [ "ebp", "esp" ] },
1022         emit      => '. leave',
1023         outs      => [ "frame:I", "stack:I|S" ],
1024         latency   => 3,
1025         units     => [ "GP" ],
1026 },
1027
1028 AddSP => {
1029         irn_flags => "I",
1030         reg_req   => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "none" ] },
1031         emit      => '. addl %binop',
1032         outs      => [ "stack:S", "M" ],
1033         units     => [ "GP" ],
1034         modified_flags => $status_flags
1035 },
1036
1037 SubSP => {
1038 #irn_flags => "I",
1039         reg_req   => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "gp", "none" ] },
1040         emit      => ". subl %binop\n".
1041                      ". movl %%esp, %D1",
1042         outs      => [ "stack:I|S", "addr", "M" ],
1043         units     => [ "GP" ],
1044         modified_flags => $status_flags
1045 },
1046
1047 LdTls => {
1048         irn_flags => "R",
1049         reg_req   => { out => [ "gp" ] },
1050         units     => [ "GP" ],
1051 },
1052
1053 # the int instruction
1054 int => {
1055         reg_req   => { in => [ "none" ], out => [ "none" ] },
1056         mode      => "mode_M",
1057         attr      => "tarval *tv",
1058         init_attr => "\tset_ia32_Immop_tarval(res, tv);",
1059         emit      => '. int %C',
1060         units     => [ "GP" ],
1061         cmp_attr  => "return 1;",
1062 },
1063
1064
1065 #-----------------------------------------------------------------------------#
1066 #   _____ _____ ______    __ _             _                     _            #
1067 #  / ____/ ____|  ____|  / _| |           | |                   | |           #
1068 # | (___| (___ | |__    | |_| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
1069 #  \___ \\___ \|  __|   |  _| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1070 #  ____) |___) | |____  | | | | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
1071 # |_____/_____/|______| |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1072 #-----------------------------------------------------------------------------#
1073
1074 # commutative operations
1075
1076 xAdd => {
1077         irn_flags => "R",
1078         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1079         emit      => '. add%XXM %binop',
1080         latency   => 4,
1081         units     => [ "SSE" ],
1082         mode      => "mode_E",
1083 },
1084
1085 xMul => {
1086         irn_flags => "R",
1087         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1088         emit      => '. mul%XXM %binop',
1089         latency   => 4,
1090         units     => [ "SSE" ],
1091         mode      => "mode_E",
1092 },
1093
1094 xMax => {
1095         irn_flags => "R",
1096         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1097         emit      => '. max%XXM %binop',
1098         latency   => 2,
1099         units     => [ "SSE" ],
1100         mode      => "mode_E",
1101 },
1102
1103 xMin => {
1104         irn_flags => "R",
1105         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1106         emit      => '. min%XXM %binop',
1107         latency   => 2,
1108         units     => [ "SSE" ],
1109         mode      => "mode_E",
1110 },
1111
1112 xAnd => {
1113         irn_flags => "R",
1114         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1115         emit      => '. andp%XSD %binop',
1116         latency   => 3,
1117         units     => [ "SSE" ],
1118         mode      => "mode_E",
1119 },
1120
1121 xOr => {
1122         irn_flags => "R",
1123         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1124         emit      => '. orp%XSD %binop',
1125         units     => [ "SSE" ],
1126         mode      => "mode_E",
1127 },
1128
1129 xXor => {
1130         irn_flags => "R",
1131         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1132         emit      => '. xorp%XSD %binop',
1133         latency   => 3,
1134         units     => [ "SSE" ],
1135         mode      => "mode_E",
1136 },
1137
1138 # not commutative operations
1139
1140 xAndNot => {
1141         irn_flags => "R",
1142         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4" ] },
1143         emit      => '. andnp%XSD %binop',
1144         latency   => 3,
1145         units     => [ "SSE" ],
1146         mode      => "mode_E",
1147 },
1148
1149 xSub => {
1150         irn_flags => "R",
1151         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3" ] },
1152         emit      => '. sub%XXM %binop',
1153         latency   => 4,
1154         units     => [ "SSE" ],
1155         mode      => "mode_E",
1156 },
1157
1158 xDiv => {
1159         irn_flags => "R",
1160         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4", "none" ] },
1161         outs      => [ "res", "M" ],
1162         emit      => '. div%XXM %binop',
1163         latency   => 16,
1164         units     => [ "SSE" ],
1165 },
1166
1167 # other operations
1168
1169 xCmp => {
1170         irn_flags => "R",
1171         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "in_r3 !in_r4" ] },
1172         latency   => 3,
1173         units     => [ "SSE" ],
1174         mode      => "mode_E",
1175 },
1176
1177 xCondJmp => {
1178         state     => "pinned",
1179         op_flags  => "L|X|Y",
1180         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "none", "none" ] },
1181         ins       => [ "base", "index", "left", "right", "mem" ],
1182         outs      => [ "false", "true" ],
1183         attr      => "long pnc",
1184         init_attr => "attr->pn_code = pnc;",
1185         latency   => 5,
1186         units     => [ "SSE" ],
1187 },
1188
1189 xConst => {
1190         op_flags  => "c",
1191         irn_flags => "R",
1192         reg_req   => { out => [ "xmm" ] },
1193         emit      => '. mov%XXM %C, %D0',
1194         latency   => 2,
1195         units     => [ "SSE" ],
1196         mode      => "mode_E",
1197 },
1198
1199 # Load / Store
1200
1201 xLoad => {
1202         op_flags  => "L|F",
1203         state     => "exc_pinned",
1204         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
1205         emit      => '. mov%XXM %AM, %D0',
1206         outs      => [ "res", "M" ],
1207         latency   => 2,
1208         units     => [ "SSE" ],
1209 },
1210
1211 xStore => {
1212         op_flags => "L|F",
1213         state    => "exc_pinned",
1214         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
1215         emit     => '. mov%XXM %binop',
1216         latency  => 2,
1217         units    => [ "SSE" ],
1218         mode     => "mode_M",
1219 },
1220
1221 xStoreSimple => {
1222         op_flags => "L|F",
1223         state    => "exc_pinned",
1224         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
1225         ins      => [ "base", "index", "val", "mem" ],
1226         emit     => '. mov%XXM %S2, %AM',
1227         latency  => 2,
1228         units    => [ "SSE" ],
1229         mode     => "mode_M",
1230 },
1231
1232 CvtSI2SS => {
1233         op_flags => "L|F",
1234         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm" ] },
1235         emit     => '. cvtsi2ss %D0, %AM',
1236         latency  => 2,
1237         units    => [ "SSE" ],
1238         mode     => $mode_xmm
1239 },
1240
1241 CvtSI2SD => {
1242         op_flags => "L|F",
1243         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm" ] },
1244         emit     => '. cvtsi2sd %unop2',
1245         latency  => 2,
1246         units    => [ "SSE" ],
1247         mode     => $mode_xmm
1248 },
1249
1250
1251 l_X87toSSE => {
1252         op_flags => "L|F",
1253         cmp_attr => "return 1;",
1254         arity    => 3,
1255 },
1256
1257 l_SSEtoX87 => {
1258         op_flags => "L|F",
1259         cmp_attr => "return 1;",
1260         arity    => 3,
1261 },
1262
1263 # CopyB
1264
1265 CopyB => {
1266         op_flags => "F|H",
1267         state    => "pinned",
1268         reg_req  => { in => [ "edi", "esi", "ecx", "none" ], out => [ "edi", "esi", "ecx", "none" ] },
1269         outs     => [ "DST", "SRC", "CNT", "M" ],
1270         units    => [ "GP" ],
1271         modified_flags => [ "DF" ]
1272 },
1273
1274 CopyB_i => {
1275         op_flags => "F|H",
1276         state    => "pinned",
1277         reg_req  => { in => [ "edi", "esi", "none" ], out => [  "edi", "esi", "none" ] },
1278         outs     => [ "DST", "SRC", "M" ],
1279         units    => [ "GP" ],
1280         modified_flags => [ "DF" ]
1281 },
1282
1283 # Conversions
1284
1285 Conv_I2I => {
1286         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3", "none" ] },
1287         units    => [ "GP" ],
1288         ins      => [ "base", "index", "val", "mem" ],
1289         mode     => $mode_gp,
1290         modified_flags => $status_flags
1291 },
1292
1293 Conv_I2I8Bit => {
1294         reg_req  => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => [ "in_r3", "none" ] },
1295         ins      => [ "base", "index", "val", "mem" ],
1296         units    => [ "GP" ],
1297         mode     => $mode_gp,
1298         modified_flags => $status_flags
1299 },
1300
1301 Conv_I2FP => {
1302         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm", "none" ] },
1303         latency  => 10,
1304         units    => [ "SSE" ],
1305         mode     => "mode_E",
1306 },
1307
1308 Conv_FP2I => {
1309         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "gp", "none" ] },
1310         latency  => 10,
1311         units    => [ "SSE" ],
1312         mode     => $mode_gp,
1313 },
1314
1315 Conv_FP2FP => {
1316         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "xmm", "none" ] },
1317         latency  => 8,
1318         units    => [ "SSE" ],
1319         mode     => "mode_E",
1320 },
1321
1322 CmpCMov => {
1323         irn_flags => "R",
1324         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none", "gp", "gp" ], out => [ "in_r7" ] },
1325         ins       => [ "base", "index", "cmp_left", "cmp_right", "mem", "val_true", "val_false" ],
1326         attr      => "pn_Cmp pn_code",
1327         init_attr => "attr->pn_code = pn_code;",
1328         latency   => 2,
1329         units     => [ "GP" ],
1330         mode      => $mode_gp,
1331 },
1332
1333 TestCMov => {
1334         irn_flags => "R",
1335         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none", "gp", "gp" ], out => [ "in_r7" ] },
1336         ins       => [ "base", "index", "cmp_left", "cmp_right", "mem", "val_true", "val_false" ],
1337         attr      => "pn_Cmp pn_code",
1338         init_attr => "attr->pn_code = pn_code;",
1339         latency   => 2,
1340         units     => [ "GP" ],
1341         mode      => $mode_gp,
1342 },
1343
1344 xCmpCMov => {
1345         irn_flags => "R",
1346         reg_req   => { in => [ "xmm", "xmm", "gp", "gp" ], out => [ "in_r4" ] },
1347         latency   => 5,
1348         units     => [ "SSE" ],
1349         mode      => $mode_gp,
1350 },
1351
1352 vfCmpCMov => {
1353         irn_flags => "R",
1354         reg_req   => { in => [ "vfp", "vfp", "gp", "gp" ], out => [ "in_r4" ] },
1355         latency   => 10,
1356         units     => [ "VFP" ],
1357         mode      => $mode_gp,
1358         attr_type => "ia32_x87_attr_t",
1359 },
1360
1361 CmpSet => {
1362         irn_flags => "R",
1363         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "eax ebx ecx edx" ] },
1364         ins       => [ "base", "index", "cmp_left", "cmp_right", "mem" ],
1365         attr      => "pn_Cmp pn_code",
1366         init_attr => "attr->pn_code = pn_code;",
1367         latency   => 2,
1368         units     => [ "GP" ],
1369         mode      => $mode_gp,
1370 },
1371
1372 TestSet => {
1373         irn_flags => "R",
1374         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "eax ebx ecx edx" ] },
1375         ins       => [ "base", "index", "cmp_left", "cmp_right", "mem" ],
1376         attr      => "pn_Cmp pn_code",
1377         init_attr => "attr->pn_code = pn_code;",
1378         latency   => 2,
1379         units     => [ "GP" ],
1380         mode      => $mode_gp,
1381 },
1382
1383 xCmpSet => {
1384         irn_flags => "R",
1385         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "eax ebx ecx edx" ] },
1386         latency   => 5,
1387         units     => [ "SSE" ],
1388         mode      => $mode_gp,
1389 },
1390
1391 vfCmpSet => {
1392         irn_flags => "R",
1393         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "eax ebx ecx edx" ] },
1394         latency   => 10,
1395         units     => [ "VFP" ],
1396         mode      => $mode_gp,
1397         attr_type => "ia32_x87_attr_t",
1398 },
1399
1400 vfCMov => {
1401         irn_flags => "R",
1402         reg_req   => { in => [ "vfp", "vfp", "vfp", "vfp" ], out => [ "vfp" ] },
1403         latency   => 10,
1404         units     => [ "VFP" ],
1405         mode      => "mode_E",
1406         attr_type => "ia32_x87_attr_t",
1407 },
1408
1409 #----------------------------------------------------------#
1410 #        _      _               _    __ _             _    #
1411 #       (_)    | |             | |  / _| |           | |   #
1412 # __   ___ _ __| |_ _   _  __ _| | | |_| | ___   __ _| |_  #
1413 # \ \ / / | '__| __| | | |/ _` | | |  _| |/ _ \ / _` | __| #
1414 #  \ V /| | |  | |_| |_| | (_| | | | | | | (_) | (_| | |_  #
1415 #   \_/ |_|_|   \__|\__,_|\__,_|_| |_| |_|\___/ \__,_|\__| #
1416 #                 | |                                      #
1417 #  _ __   ___   __| | ___  ___                             #
1418 # | '_ \ / _ \ / _` |/ _ \/ __|                            #
1419 # | | | | (_) | (_| |  __/\__ \                            #
1420 # |_| |_|\___/ \__,_|\___||___/                            #
1421 #----------------------------------------------------------#
1422
1423 vfadd => {
1424         irn_flags => "R",
1425         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1426         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1427         latency   => 4,
1428         units     => [ "VFP" ],
1429         mode      => "mode_E",
1430         attr_type => "ia32_x87_attr_t",
1431 },
1432
1433 vfmul => {
1434         irn_flags => "R",
1435         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1436         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1437         latency   => 4,
1438         units     => [ "VFP" ],
1439         mode      => "mode_E",
1440         attr_type => "ia32_x87_attr_t",
1441 },
1442
1443 l_vfmul => {
1444         op_flags  => "C",
1445         cmp_attr  => "return 1;",
1446         arity     => 2,
1447 },
1448
1449 vfsub => {
1450         irn_flags => "R",
1451         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1452         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1453         latency   => 4,
1454         units     => [ "VFP" ],
1455         mode      => "mode_E",
1456         attr_type => "ia32_x87_attr_t",
1457 },
1458
1459 l_vfsub => {
1460         cmp_attr  => "return 1;",
1461         arity     => 2,
1462 },
1463
1464 vfdiv => {
1465         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp", "none" ] },
1466         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1467         outs      => [ "res", "M" ],
1468         latency   => 20,
1469         units     => [ "VFP" ],
1470         attr_type => "ia32_x87_attr_t",
1471 },
1472
1473 l_vfdiv => {
1474         cmp_attr  => "return 1;",
1475         outs      => [ "res", "M" ],
1476         arity     => 2,
1477 },
1478
1479 vfprem => {
1480         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none", "fpcw" ], out => [ "vfp" ] },
1481         ins       => [ "base", "index", "left", "right", "mem", "fpcw" ],
1482         latency   => 20,
1483         units     => [ "VFP" ],
1484         mode      => "mode_E",
1485         attr_type => "ia32_x87_attr_t",
1486 },
1487
1488 l_vfprem => {
1489         cmp_attr  => "return 1;",
1490         arity     => 2,
1491 },
1492
1493 vfabs => {
1494         irn_flags => "R",
1495         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1496         ins       => [ "value" ],
1497         latency   => 2,
1498         units     => [ "VFP" ],
1499         mode      => "mode_E",
1500         attr_type => "ia32_x87_attr_t",
1501 },
1502
1503 vfchs => {
1504         irn_flags => "R",
1505         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1506         ins       => [ "value" ],
1507         latency   => 2,
1508         units     => [ "VFP" ],
1509         mode      => "mode_E",
1510         attr_type => "ia32_x87_attr_t",
1511 },
1512
1513 # virtual Load and Store
1514
1515 vfld => {
1516         op_flags  => "L|F",
1517         state     => "exc_pinned",
1518         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1519         ins       => [ "base", "index", "mem" ],
1520         outs      => [ "res", "M" ],
1521         attr      => "ir_mode *store_mode",
1522         init_attr => "attr->attr.ls_mode = store_mode;",
1523         latency   => 2,
1524         units     => [ "VFP" ],
1525         attr_type => "ia32_x87_attr_t",
1526 },
1527
1528 vfst => {
1529         op_flags  => "L|F",
1530         state     => "exc_pinned",
1531         reg_req   => { in => [ "gp", "gp", "vfp", "none" ] },
1532         ins       => [ "base", "index", "val", "mem" ],
1533         attr      => "ir_mode *store_mode",
1534         init_attr => "attr->attr.ls_mode = store_mode;",
1535         latency   => 2,
1536         units     => [ "VFP" ],
1537         mode      => "mode_M",
1538         attr_type => "ia32_x87_attr_t",
1539 },
1540
1541 # Conversions
1542
1543 vfild => {
1544         state     => "exc_pinned",
1545         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1546         outs      => [ "res", "M" ],
1547         ins       => [ "base", "index", "mem" ],
1548         latency   => 4,
1549         units     => [ "VFP" ],
1550         attr_type => "ia32_x87_attr_t",
1551 },
1552
1553 l_vfild => {
1554         cmp_attr  => "return 1;",
1555         outs      => [ "res", "M" ],
1556         arity     => 2,
1557 },
1558
1559 vfist => {
1560         state     => "exc_pinned",
1561         reg_req   => { in => [ "gp", "gp", "vfp", "fpcw", "none" ] },
1562         ins       => [ "base", "index", "val", "fpcw", "mem" ],
1563         latency   => 4,
1564         units     => [ "VFP" ],
1565         mode      => "mode_M",
1566         attr_type => "ia32_x87_attr_t",
1567 },
1568
1569 l_vfist => {
1570         cmp_attr  => "return 1;",
1571         state     => "exc_pinned",
1572         arity     => 3,
1573         mode      => "mode_M",
1574 },
1575
1576
1577 # constants
1578
1579 vfldz => {
1580         irn_flags => "R",
1581         reg_req   => { out => [ "vfp" ] },
1582         latency   => 4,
1583         units     => [ "VFP" ],
1584         mode      => "mode_E",
1585         attr_type => "ia32_x87_attr_t",
1586 },
1587
1588 vfld1 => {
1589         irn_flags => "R",
1590         reg_req   => { out => [ "vfp" ] },
1591         latency   => 4,
1592         units     => [ "VFP" ],
1593         mode      => "mode_E",
1594         attr_type => "ia32_x87_attr_t",
1595 },
1596
1597 vfldpi => {
1598         irn_flags => "R",
1599         reg_req   => { out => [ "vfp" ] },
1600         latency   => 4,
1601         units     => [ "VFP" ],
1602         mode      => "mode_E",
1603         attr_type => "ia32_x87_attr_t",
1604 },
1605
1606 vfldln2 => {
1607         irn_flags => "R",
1608         reg_req   => { out => [ "vfp" ] },
1609         latency   => 4,
1610         units     => [ "VFP" ],
1611         mode      => "mode_E",
1612         attr_type => "ia32_x87_attr_t",
1613 },
1614
1615 vfldlg2 => {
1616         irn_flags => "R",
1617         reg_req   => { out => [ "vfp" ] },
1618         latency   => 4,
1619         units     => [ "VFP" ],
1620         mode      => "mode_E",
1621         attr_type => "ia32_x87_attr_t",
1622 },
1623
1624 vfldl2t => {
1625         irn_flags => "R",
1626         reg_req   => { out => [ "vfp" ] },
1627         latency   => 4,
1628         units     => [ "VFP" ],
1629         mode      => "mode_E",
1630         attr_type => "ia32_x87_attr_t",
1631 },
1632
1633 vfldl2e => {
1634         irn_flags => "R",
1635         reg_req   => { out => [ "vfp" ] },
1636         latency   => 4,
1637         units     => [ "VFP" ],
1638         mode      => "mode_E",
1639         attr_type => "ia32_x87_attr_t",
1640 },
1641
1642 vfConst => {
1643         op_flags  => "c",
1644         irn_flags => "R",
1645         reg_req   => { out => [ "vfp" ] },
1646         latency   => 3,
1647         units     => [ "VFP" ],
1648         mode      => "mode_E",
1649         attr_type => "ia32_x87_attr_t",
1650 },
1651
1652 # other
1653
1654 vfCondJmp => {
1655         state     => "pinned",
1656         op_flags  => "L|X|Y",
1657         reg_req   => { in => [ "vfp", "vfp" ], out => [ "none", "none", "eax" ] },
1658         ins       => [ "left", "right" ],
1659         outs      => [ "false", "true", "temp_reg_eax" ],
1660         attr      => "long pnc",
1661         init_attr => "attr->attr.pn_code = pnc;",
1662         latency   => 10,
1663         units     => [ "VFP" ],
1664         attr_type => "ia32_x87_attr_t",
1665 },
1666
1667 #------------------------------------------------------------------------#
1668 #       ___ _____    __ _             _                     _            #
1669 # __  _( _ )___  |  / _| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
1670 # \ \/ / _ \  / /  | |_| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1671 #  >  < (_) |/ /   |  _| | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
1672 # /_/\_\___//_/    |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1673 #------------------------------------------------------------------------#
1674
1675 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
1676 #       are swapped, we work this around in the emitter...
1677
1678 fadd => {
1679         op_flags  => "R",
1680         rd_constructor => "NONE",
1681         reg_req   => { },
1682         emit      => '. fadd%XM %x87_binop',
1683         attr_type => "ia32_x87_attr_t",
1684 },
1685
1686 faddp => {
1687         op_flags  => "R",
1688         rd_constructor => "NONE",
1689         reg_req   => { },
1690         emit      => '. faddp%XM %x87_binop',
1691         attr_type => "ia32_x87_attr_t",
1692 },
1693
1694 fmul => {
1695         op_flags  => "R",
1696         rd_constructor => "NONE",
1697         reg_req   => { },
1698         emit      => '. fmul%XM %x87_binop',
1699         attr_type => "ia32_x87_attr_t",
1700 },
1701
1702 fmulp => {
1703         op_flags  => "R",
1704         rd_constructor => "NONE",
1705         reg_req   => { },
1706         emit      => '. fmulp%XM %x87_binop',,
1707         attr_type => "ia32_x87_attr_t",
1708 },
1709
1710 fsub => {
1711         op_flags  => "R",
1712         rd_constructor => "NONE",
1713         reg_req   => { },
1714         emit      => '. fsub%XM %x87_binop',
1715         attr_type => "ia32_x87_attr_t",
1716 },
1717
1718 fsubp => {
1719         op_flags  => "R",
1720         rd_constructor => "NONE",
1721         reg_req   => { },
1722 # see note about gas bugs
1723         emit      => '. fsubrp%XM %x87_binop',
1724         attr_type => "ia32_x87_attr_t",
1725 },
1726
1727 fsubr => {
1728         op_flags  => "R",
1729         rd_constructor => "NONE",
1730         irn_flags => "R",
1731         reg_req   => { },
1732         emit      => '. fsubr%XM %x87_binop',
1733         attr_type => "ia32_x87_attr_t",
1734 },
1735
1736 fsubrp => {
1737         op_flags  => "R",
1738         rd_constructor => "NONE",
1739         irn_flags => "R",
1740         reg_req   => { },
1741 # see note about gas bugs
1742         emit      => '. fsubp%XM %x87_binop',
1743         attr_type => "ia32_x87_attr_t",
1744 },
1745
1746 fprem => {
1747         op_flags  => "R",
1748         rd_constructor => "NONE",
1749         reg_req   => { },
1750         emit      => '. fprem1',
1751         attr_type => "ia32_x87_attr_t",
1752 },
1753
1754 # this node is just here, to keep the simulator running
1755 # we can omit this when a fprem simulation function exists
1756 fpremp => {
1757         op_flags  => "R",
1758         rd_constructor => "NONE",
1759         reg_req   => { },
1760         emit      => '. fprem1',
1761         attr_type => "ia32_x87_attr_t",
1762 },
1763
1764 fdiv => {
1765         op_flags  => "R",
1766         rd_constructor => "NONE",
1767         reg_req   => { },
1768         emit      => '. fdiv%XM %x87_binop',
1769         attr_type => "ia32_x87_attr_t",
1770 },
1771
1772 fdivp => {
1773         op_flags  => "R",
1774         rd_constructor => "NONE",
1775         reg_req   => { },
1776 # see note about gas bugs
1777         emit      => '. fdivrp%XM %x87_binop',
1778         attr_type => "ia32_x87_attr_t",
1779 },
1780
1781 fdivr => {
1782         op_flags  => "R",
1783         rd_constructor => "NONE",
1784         reg_req   => { },
1785         emit      => '. fdivr%XM %x87_binop',
1786         attr_type => "ia32_x87_attr_t",
1787 },
1788
1789 fdivrp => {
1790         op_flags  => "R",
1791         rd_constructor => "NONE",
1792         reg_req   => { },
1793 # see note about gas bugs
1794         emit      => '. fdivp%XM %x87_binop',
1795         attr_type => "ia32_x87_attr_t",
1796 },
1797
1798 fabs => {
1799         op_flags  => "R",
1800         rd_constructor => "NONE",
1801         reg_req   => { },
1802         emit      => '. fabs',
1803         attr_type => "ia32_x87_attr_t",
1804 },
1805
1806 fchs => {
1807         op_flags  => "R|K",
1808         rd_constructor => "NONE",
1809         reg_req   => { },
1810         emit      => '. fchs',
1811         attr_type => "ia32_x87_attr_t",
1812 },
1813
1814 # x87 Load and Store
1815
1816 fld => {
1817         rd_constructor => "NONE",
1818         op_flags  => "R|L|F",
1819         state     => "exc_pinned",
1820         reg_req   => { },
1821         emit      => '. fld%XM %AM',
1822         attr_type => "ia32_x87_attr_t",
1823 },
1824
1825 fst => {
1826         rd_constructor => "NONE",
1827         op_flags  => "R|L|F",
1828         state     => "exc_pinned",
1829         reg_req   => { },
1830         emit      => '. fst%XM %AM',
1831         mode      => "mode_M",
1832         attr_type => "ia32_x87_attr_t",
1833 },
1834
1835 fstp => {
1836         rd_constructor => "NONE",
1837         op_flags  => "R|L|F",
1838         state     => "exc_pinned",
1839         reg_req   => { },
1840         emit      => '. fstp%XM %AM',
1841         mode      => "mode_M",
1842         attr_type => "ia32_x87_attr_t",
1843 },
1844
1845 # Conversions
1846
1847 fild => {
1848         op_flags  => "R",
1849         rd_constructor => "NONE",
1850         reg_req   => { },
1851         emit      => '. fild%XM %AM',
1852         attr_type => "ia32_x87_attr_t",
1853 },
1854
1855 fist => {
1856         op_flags  => "R",
1857         state     => "exc_pinned",
1858         rd_constructor => "NONE",
1859         reg_req   => { },
1860         emit      => '. fist%XM %AM',
1861         mode      => "mode_M",
1862         attr_type => "ia32_x87_attr_t",
1863 },
1864
1865 fistp => {
1866         op_flags  => "R",
1867         state     => "exc_pinned",
1868         rd_constructor => "NONE",
1869         reg_req   => { },
1870         emit      => '. fistp%XM %AM',
1871         mode      => "mode_M",
1872         attr_type => "ia32_x87_attr_t",
1873 },
1874
1875 # constants
1876
1877 fldz => {
1878         op_flags  => "R|c|K",
1879         irn_flags  => "R",
1880         reg_req   => { },
1881         emit      => '. fldz',
1882         attr_type => "ia32_x87_attr_t",
1883 },
1884
1885 fld1 => {
1886         op_flags  => "R|c|K",
1887         irn_flags  => "R",
1888         reg_req   => { },
1889         emit      => '. fld1',
1890         attr_type => "ia32_x87_attr_t",
1891 },
1892
1893 fldpi => {
1894         op_flags  => "R|c|K",
1895         irn_flags  => "R",
1896         reg_req   => { },
1897         emit      => '. fldpi',
1898         attr_type => "ia32_x87_attr_t",
1899 },
1900
1901 fldln2 => {
1902         op_flags  => "R|c|K",
1903         irn_flags  => "R",
1904         reg_req   => { },
1905         emit      => '. fldln2',
1906         attr_type => "ia32_x87_attr_t",
1907 },
1908
1909 fldlg2 => {
1910         op_flags  => "R|c|K",
1911         irn_flags  => "R",
1912         reg_req   => { },
1913         emit      => '. fldlg2',
1914         attr_type => "ia32_x87_attr_t",
1915 },
1916
1917 fldl2t => {
1918         op_flags  => "R|c|K",
1919         irn_flags  => "R",
1920         reg_req   => { },
1921         emit      => '. fldll2t',
1922         attr_type => "ia32_x87_attr_t",
1923 },
1924
1925 fldl2e => {
1926         op_flags  => "R|c|K",
1927         irn_flags  => "R",
1928         reg_req   => { },
1929         emit      => '. fldl2e',
1930         attr_type => "ia32_x87_attr_t",
1931 },
1932
1933 # fxch, fpush, fpop
1934 # Note that it is NEVER allowed to do CSE on these nodes
1935 # Moreover, note the virtual register requierements!
1936
1937 fxch => {
1938         op_flags  => "R|K",
1939         reg_req   => { },
1940         cmp_attr  => "return 1;",
1941         emit      => '. fxch %X0',
1942         attr_type => "ia32_x87_attr_t",
1943 },
1944
1945 fpush => {
1946         op_flags  => "R|K",
1947         reg_req   => {},
1948         cmp_attr  => "return 1;",
1949         emit      => '. fld %X0',
1950         attr_type => "ia32_x87_attr_t",
1951 },
1952
1953 fpushCopy => {
1954         op_flags  => "R",
1955         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1956         cmp_attr  => "return 1;",
1957         emit      => '. fld %X0',
1958         attr_type => "ia32_x87_attr_t",
1959 },
1960
1961 fpop => {
1962         op_flags  => "R|K",
1963         reg_req   => { },
1964         cmp_attr  => "return 1;",
1965         emit      => '. fstp %X0',
1966         attr_type => "ia32_x87_attr_t",
1967 },
1968
1969 # compare
1970
1971 fcomJmp => {
1972         op_flags  => "L|X|Y",
1973         reg_req   => { },
1974         attr_type => "ia32_x87_attr_t",
1975 },
1976
1977 fcompJmp => {
1978         op_flags  => "L|X|Y",
1979         reg_req   => { },
1980         attr_type => "ia32_x87_attr_t",
1981 },
1982
1983 fcomppJmp => {
1984         op_flags  => "L|X|Y",
1985         reg_req   => { },
1986         attr_type => "ia32_x87_attr_t",
1987 },
1988
1989 fcomrJmp => {
1990         op_flags  => "L|X|Y",
1991         reg_req   => { },
1992         attr_type => "ia32_x87_attr_t",
1993 },
1994
1995 fcomrpJmp => {
1996         op_flags  => "L|X|Y",
1997         reg_req   => { },
1998         attr_type => "ia32_x87_attr_t",
1999 },
2000
2001 fcomrppJmp => {
2002         op_flags  => "L|X|Y",
2003         reg_req   => { },
2004         attr_type => "ia32_x87_attr_t",
2005 },
2006
2007
2008 # -------------------------------------------------------------------------------- #
2009 #  ____ ____  _____                  _                               _             #
2010 # / ___/ ___|| ____| __   _____  ___| |_ ___  _ __   _ __   ___   __| | ___  ___   #
2011 # \___ \___ \|  _|   \ \ / / _ \/ __| __/ _ \| '__| | '_ \ / _ \ / _` |/ _ \/ __|  #
2012 #  ___) |__) | |___   \ V /  __/ (__| || (_) | |    | | | | (_) | (_| |  __/\__ \  #
2013 # |____/____/|_____|   \_/ \___|\___|\__\___/|_|    |_| |_|\___/ \__,_|\___||___/  #
2014 #                                                                                  #
2015 # -------------------------------------------------------------------------------- #
2016
2017
2018 # Spilling and reloading of SSE registers, hardcoded, not generated #
2019
2020 xxLoad => {
2021         op_flags  => "L|F",
2022         state     => "exc_pinned",
2023         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2024         emit      => '. movdqu %D0, %AM',
2025         outs      => [ "res", "M" ],
2026         units     => [ "SSE" ],
2027 },
2028
2029 xxStore => {
2030         op_flags => "L|F",
2031         state    => "exc_pinned",
2032         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
2033         emit     => '. movdqu %binop',
2034         units    => [ "SSE" ],
2035         mode     => "mode_M",
2036 },
2037
2038 ); # end of %nodes
2039
2040 # Include the generated SIMD node specification written by the SIMD optimization
2041 $my_script_name = dirname($myname) . "/../ia32/ia32_simd_spec.pl";
2042 unless ($return = do $my_script_name) {
2043         warn "couldn't parse $my_script_name: $@" if $@;
2044         warn "couldn't do $my_script_name: $!"    unless defined $return;
2045         warn "couldn't run $my_script_name"       unless $return;
2046 }