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