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