9cc0454fe439cc451b6c940f1186906961dc134b
[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         unop => "${arch}_emit_unop(env, node);",
275         binop => "${arch}_emit_binop(env, node);",
276         x87_binop => "${arch}_emit_x87_binop(env, node);",
277 );
278
279 #--------------------------------------------------#
280 #                        _                         #
281 #                       (_)                        #
282 #  _ __   _____      __  _ _ __    ___  _ __  ___  #
283 # | '_ \ / _ \ \ /\ / / | | '__|  / _ \| '_ \/ __| #
284 # | | | |  __/\ V  V /  | | |    | (_) | |_) \__ \ #
285 # |_| |_|\___| \_/\_/   |_|_|     \___/| .__/|___/ #
286 #                                      | |         #
287 #                                      |_|         #
288 #--------------------------------------------------#
289
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     => "ia32_compare_nodes_attr",
305         ia32_x87_attr_t => "ia32_compare_x87_attr",
306         ia32_asm_attr_t => "ia32_compare_asm_attr",
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         ins      => [ "base", "index", "val", "mem" ],
1277         mode     => $mode_gp,
1278         modified_flags => $status_flags
1279 },
1280
1281 Conv_I2I8Bit => {
1282         reg_req  => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => [ "in_r3", "none" ] },
1283         ins      => [ "base", "index", "val", "mem" ],
1284         units    => [ "GP" ],
1285         mode     => $mode_gp,
1286         modified_flags => $status_flags
1287 },
1288
1289 Conv_I2FP => {
1290         reg_req  => { in => [ "gp", "gp", "gp", "none" ], out => [ "xmm", "none" ] },
1291         latency  => 10,
1292         units    => [ "SSE" ],
1293         mode     => "mode_E",
1294 },
1295
1296 Conv_FP2I => {
1297         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "gp", "none" ] },
1298         latency  => 10,
1299         units    => [ "SSE" ],
1300         mode     => $mode_gp,
1301 },
1302
1303 Conv_FP2FP => {
1304         reg_req  => { in => [ "gp", "gp", "xmm", "none" ], out => [ "xmm", "none" ] },
1305         latency  => 8,
1306         units    => [ "SSE" ],
1307         mode     => "mode_E",
1308 },
1309
1310 CmpCMov => {
1311         irn_flags => "R",
1312         reg_req   => { in => [ "gp", "gp", "gp", "gp" ], out => [ "in_r4" ] },
1313         latency   => 2,
1314         units     => [ "GP" ],
1315         mode      => $mode_gp,
1316 },
1317
1318 PsiCondCMov => {
1319         irn_flags => "R",
1320         reg_req   => { in => [ "gp", "gp", "gp" ], out => [ "in_r3" ] },
1321         latency   => 2,
1322         units     => [ "GP" ],
1323         mode      => $mode_gp,
1324 },
1325
1326 xCmpCMov => {
1327         irn_flags => "R",
1328         reg_req   => { in => [ "xmm", "xmm", "gp", "gp" ], out => [ "in_r4" ] },
1329         latency   => 5,
1330         units     => [ "SSE" ],
1331         mode      => $mode_gp,
1332 },
1333
1334 vfCmpCMov => {
1335         irn_flags => "R",
1336         reg_req   => { in => [ "vfp", "vfp", "gp", "gp" ], out => [ "in_r4" ] },
1337         latency   => 10,
1338         units     => [ "VFP" ],
1339         mode      => $mode_gp,
1340         attr_type => "ia32_x87_attr_t",
1341 },
1342
1343 CmpSet => {
1344         irn_flags => "R",
1345         reg_req   => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "eax ebx ecx edx" ] },
1346         latency   => 2,
1347         units     => [ "GP" ],
1348         mode      => $mode_gp,
1349 },
1350
1351 PsiCondSet => {
1352         irn_flags => "R",
1353         reg_req   => { in => [ "gp" ], out => [ "eax ebx ecx edx" ] },
1354         latency   => 2,
1355         units     => [ "GP" ],
1356         mode      => $mode_gp,
1357 },
1358
1359 xCmpSet => {
1360         irn_flags => "R",
1361         reg_req   => { in => [ "gp", "gp", "xmm", "xmm", "none" ], out => [ "eax ebx ecx edx" ] },
1362         latency   => 5,
1363         units     => [ "SSE" ],
1364         mode      => $mode_gp,
1365 },
1366
1367 vfCmpSet => {
1368         irn_flags => "R",
1369         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "eax ebx ecx edx" ] },
1370         latency   => 10,
1371         units     => [ "VFP" ],
1372         mode      => $mode_gp,
1373         attr_type => "ia32_x87_attr_t",
1374 },
1375
1376 vfCMov => {
1377         irn_flags => "R",
1378         reg_req   => { in => [ "vfp", "vfp", "vfp", "vfp" ], out => [ "vfp" ] },
1379         latency   => 10,
1380         units     => [ "VFP" ],
1381         mode      => "mode_E",
1382         attr_type => "ia32_x87_attr_t",
1383 },
1384
1385 #----------------------------------------------------------#
1386 #        _      _               _    __ _             _    #
1387 #       (_)    | |             | |  / _| |           | |   #
1388 # __   ___ _ __| |_ _   _  __ _| | | |_| | ___   __ _| |_  #
1389 # \ \ / / | '__| __| | | |/ _` | | |  _| |/ _ \ / _` | __| #
1390 #  \ V /| | |  | |_| |_| | (_| | | | | | | (_) | (_| | |_  #
1391 #   \_/ |_|_|   \__|\__,_|\__,_|_| |_| |_|\___/ \__,_|\__| #
1392 #                 | |                                      #
1393 #  _ __   ___   __| | ___  ___                             #
1394 # | '_ \ / _ \ / _` |/ _ \/ __|                            #
1395 # | | | | (_) | (_| |  __/\__ \                            #
1396 # |_| |_|\___/ \__,_|\___||___/                            #
1397 #----------------------------------------------------------#
1398
1399 vfadd => {
1400         irn_flags => "R",
1401         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "vfp" ] },
1402         latency   => 4,
1403         units     => [ "VFP" ],
1404         mode      => "mode_E",
1405         attr_type => "ia32_x87_attr_t",
1406 },
1407
1408 vfmul => {
1409         irn_flags => "R",
1410         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "vfp" ] },
1411         latency   => 4,
1412         units     => [ "VFP" ],
1413         mode      => "mode_E",
1414         attr_type => "ia32_x87_attr_t",
1415 },
1416
1417 l_vfmul => {
1418         op_flags  => "C",
1419         cmp_attr  => "return 1;",
1420         arity     => 2,
1421 },
1422
1423 vfsub => {
1424         irn_flags => "R",
1425         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "vfp" ] },
1426         latency   => 4,
1427         units     => [ "VFP" ],
1428         mode      => "mode_E",
1429         attr_type => "ia32_x87_attr_t",
1430 },
1431
1432 l_vfsub => {
1433         cmp_attr  => "return 1;",
1434         arity     => 2,
1435 },
1436
1437 vfdiv => {
1438         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "vfp", "none" ] },
1439         outs      => [ "res", "M" ],
1440         latency   => 20,
1441         units     => [ "VFP" ],
1442         attr_type => "ia32_x87_attr_t",
1443 },
1444
1445 l_vfdiv => {
1446         cmp_attr  => "return 1;",
1447         outs      => [ "res", "M" ],
1448         arity     => 2,
1449 },
1450
1451 vfprem => {
1452         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "vfp" ] },
1453         latency   => 20,
1454         units     => [ "VFP" ],
1455         mode      => "mode_E",
1456         attr_type => "ia32_x87_attr_t",
1457 },
1458
1459 l_vfprem => {
1460         cmp_attr  => "return 1;",
1461         arity     => 2,
1462 },
1463
1464 vfabs => {
1465         irn_flags => "R",
1466         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1467         latency   => 2,
1468         units     => [ "VFP" ],
1469         mode      => "mode_E",
1470         attr_type => "ia32_x87_attr_t",
1471 },
1472
1473 vfchs => {
1474         irn_flags => "R",
1475         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1476         latency   => 2,
1477         units     => [ "VFP" ],
1478         mode      => "mode_E",
1479         attr_type => "ia32_x87_attr_t",
1480 },
1481
1482 vfsin => {
1483         irn_flags => "R",
1484         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1485         latency   => 150,
1486         units     => [ "VFP" ],
1487         mode      => "mode_E",
1488         attr_type => "ia32_x87_attr_t",
1489 },
1490
1491 vfcos => {
1492         irn_flags => "R",
1493         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1494         latency   => 150,
1495         units     => [ "VFP" ],
1496         mode      => "mode_E",
1497         attr_type => "ia32_x87_attr_t",
1498 },
1499
1500 vfsqrt => {
1501         irn_flags => "R",
1502         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1503         latency   => 30,
1504         units     => [ "VFP" ],
1505         mode      => "mode_E",
1506         attr_type => "ia32_x87_attr_t",
1507 },
1508
1509 # virtual Load and Store
1510
1511 vfld => {
1512         op_flags  => "L|F",
1513         state     => "exc_pinned",
1514         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1515         outs      => [ "res", "M" ],
1516         latency   => 2,
1517         units     => [ "VFP" ],
1518         attr_type => "ia32_x87_attr_t",
1519 },
1520
1521 vfst => {
1522         op_flags  => "L|F",
1523         state     => "exc_pinned",
1524         reg_req   => { in => [ "gp", "gp", "vfp", "none" ] },
1525         latency   => 2,
1526         units     => [ "VFP" ],
1527         mode      => "mode_M",
1528         attr_type => "ia32_x87_attr_t",
1529 },
1530
1531 # Conversions
1532
1533 vfild => {
1534         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "vfp", "none" ] },
1535         outs      => [ "res", "M" ],
1536         latency   => 4,
1537         units     => [ "VFP" ],
1538         attr_type => "ia32_x87_attr_t",
1539 },
1540
1541 l_vfild => {
1542         cmp_attr  => "return 1;",
1543         outs      => [ "res", "M" ],
1544         arity     => 2,
1545 },
1546
1547 vfist => {
1548         reg_req   => { in => [ "gp", "gp", "vfp", "fpcw", "none" ] },
1549         latency   => 4,
1550         units     => [ "VFP" ],
1551         mode      => "mode_M",
1552         attr_type => "ia32_x87_attr_t",
1553 },
1554
1555 l_vfist => {
1556         cmp_attr  => "return 1;",
1557         arity     => 3,
1558         mode      => "mode_M",
1559 },
1560
1561
1562 # constants
1563
1564 vfldz => {
1565         irn_flags => "R",
1566         reg_req   => { out => [ "vfp" ] },
1567         latency   => 4,
1568         units     => [ "VFP" ],
1569         mode      => "mode_E",
1570         attr_type => "ia32_x87_attr_t",
1571 },
1572
1573 vfld1 => {
1574         irn_flags => "R",
1575         reg_req   => { out => [ "vfp" ] },
1576         latency   => 4,
1577         units     => [ "VFP" ],
1578         mode      => "mode_E",
1579         attr_type => "ia32_x87_attr_t",
1580 },
1581
1582 vfldpi => {
1583         irn_flags => "R",
1584         reg_req   => { out => [ "vfp" ] },
1585         latency   => 4,
1586         units     => [ "VFP" ],
1587         mode      => "mode_E",
1588         attr_type => "ia32_x87_attr_t",
1589 },
1590
1591 vfldln2 => {
1592         irn_flags => "R",
1593         reg_req   => { out => [ "vfp" ] },
1594         latency   => 4,
1595         units     => [ "VFP" ],
1596         mode      => "mode_E",
1597         attr_type => "ia32_x87_attr_t",
1598 },
1599
1600 vfldlg2 => {
1601         irn_flags => "R",
1602         reg_req   => { out => [ "vfp" ] },
1603         latency   => 4,
1604         units     => [ "VFP" ],
1605         mode      => "mode_E",
1606         attr_type => "ia32_x87_attr_t",
1607 },
1608
1609 vfldl2t => {
1610         irn_flags => "R",
1611         reg_req   => { out => [ "vfp" ] },
1612         latency   => 4,
1613         units     => [ "VFP" ],
1614         mode      => "mode_E",
1615         attr_type => "ia32_x87_attr_t",
1616 },
1617
1618 vfldl2e => {
1619         irn_flags => "R",
1620         reg_req   => { out => [ "vfp" ] },
1621         latency   => 4,
1622         units     => [ "VFP" ],
1623         mode      => "mode_E",
1624         attr_type => "ia32_x87_attr_t",
1625 },
1626
1627 vfConst => {
1628         op_flags  => "c",
1629         irn_flags => "R",
1630         reg_req   => { out => [ "vfp" ] },
1631         latency   => 3,
1632         units     => [ "VFP" ],
1633         mode      => "mode_E",
1634         attr_type => "ia32_x87_attr_t",
1635 },
1636
1637 # other
1638
1639 vfCondJmp => {
1640         state     => "pinned",
1641         op_flags  => "L|X|Y",
1642         reg_req   => { in => [ "gp", "gp", "vfp", "vfp", "none" ], out => [ "none", "none", "eax" ] },
1643         outs      => [ "false", "true", "temp_reg_eax" ],
1644         latency   => 10,
1645         units     => [ "VFP" ],
1646         attr_type => "ia32_x87_attr_t",
1647 },
1648
1649 #------------------------------------------------------------------------#
1650 #       ___ _____    __ _             _                     _            #
1651 # __  _( _ )___  |  / _| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
1652 # \ \/ / _ \  / /  | |_| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
1653 #  >  < (_) |/ /   |  _| | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
1654 # /_/\_\___//_/    |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
1655 #------------------------------------------------------------------------#
1656
1657 # Note: gas is strangely buggy: fdivrp and fdivp as well as fsubrp and fsubp
1658 #       are swapped, we work this around in the emitter...
1659
1660 fadd => {
1661         op_flags  => "R",
1662         rd_constructor => "NONE",
1663         reg_req   => { },
1664         emit      => '. fadd%XM %x87_binop',
1665         attr_type => "ia32_x87_attr_t",
1666 },
1667
1668 faddp => {
1669         op_flags  => "R",
1670         rd_constructor => "NONE",
1671         reg_req   => { },
1672         emit      => '. faddp %x87_binop',
1673         attr_type => "ia32_x87_attr_t",
1674 },
1675
1676 fmul => {
1677         op_flags  => "R",
1678         rd_constructor => "NONE",
1679         reg_req   => { },
1680         emit      => '. fmul%XM %x87_binop',
1681         attr_type => "ia32_x87_attr_t",
1682 },
1683
1684 fmulp => {
1685         op_flags  => "R",
1686         rd_constructor => "NONE",
1687         reg_req   => { },
1688         emit      => '. fmulp %x87_binop',,
1689         attr_type => "ia32_x87_attr_t",
1690 },
1691
1692 fsub => {
1693         op_flags  => "R",
1694         rd_constructor => "NONE",
1695         reg_req   => { },
1696         emit      => '. fsub%XM %x87_binop',
1697         attr_type => "ia32_x87_attr_t",
1698 },
1699
1700 fsubp => {
1701         op_flags  => "R",
1702         rd_constructor => "NONE",
1703         reg_req   => { },
1704 # see note about gas bugs
1705         emit      => '. fsubrp %x87_binop',
1706         attr_type => "ia32_x87_attr_t",
1707 },
1708
1709 fsubr => {
1710         op_flags  => "R",
1711         rd_constructor => "NONE",
1712         irn_flags => "R",
1713         reg_req   => { },
1714         emit      => '. fsubr%XM %x87_binop',
1715         attr_type => "ia32_x87_attr_t",
1716 },
1717
1718 fsubrp => {
1719         op_flags  => "R",
1720         rd_constructor => "NONE",
1721         irn_flags => "R",
1722         reg_req   => { },
1723 # see note about gas bugs
1724         emit      => '. fsubp %x87_binop',
1725         attr_type => "ia32_x87_attr_t",
1726 },
1727
1728 fprem => {
1729         op_flags  => "R",
1730         rd_constructor => "NONE",
1731         reg_req   => { },
1732         emit      => '. fprem1',
1733         attr_type => "ia32_x87_attr_t",
1734 },
1735
1736 # this node is just here, to keep the simulator running
1737 # we can omit this when a fprem simulation function exists
1738 fpremp => {
1739         op_flags  => "R",
1740         rd_constructor => "NONE",
1741         reg_req   => { },
1742         emit      => '. fprem1',
1743         attr_type => "ia32_x87_attr_t",
1744 },
1745
1746 fdiv => {
1747         op_flags  => "R",
1748         rd_constructor => "NONE",
1749         reg_req   => { },
1750         emit      => '. fdiv%XM %x87_binop',
1751         attr_type => "ia32_x87_attr_t",
1752 },
1753
1754 fdivp => {
1755         op_flags  => "R",
1756         rd_constructor => "NONE",
1757         reg_req   => { },
1758 # see note about gas bugs
1759         emit      => '. fdivrp %x87_binop',
1760         attr_type => "ia32_x87_attr_t",
1761 },
1762
1763 fdivr => {
1764         op_flags  => "R",
1765         rd_constructor => "NONE",
1766         reg_req   => { },
1767         emit      => '. fdivr%XM %x87_binop',
1768         attr_type => "ia32_x87_attr_t",
1769 },
1770
1771 fdivrp => {
1772         op_flags  => "R",
1773         rd_constructor => "NONE",
1774         reg_req   => { },
1775 # see note about gas bugs
1776         emit      => '. fdivp %x87_binop',
1777         attr_type => "ia32_x87_attr_t",
1778 },
1779
1780 fabs => {
1781         op_flags  => "R",
1782         rd_constructor => "NONE",
1783         reg_req   => { },
1784         emit      => '. fabs',
1785         attr_type => "ia32_x87_attr_t",
1786 },
1787
1788 fchs => {
1789         op_flags  => "R|K",
1790         rd_constructor => "NONE",
1791         reg_req   => { },
1792         emit      => '. fchs',
1793         attr_type => "ia32_x87_attr_t",
1794 },
1795
1796 fsin => {
1797         op_flags  => "R",
1798         rd_constructor => "NONE",
1799         reg_req   => { },
1800         emit      => '. fsin',
1801         attr_type => "ia32_x87_attr_t",
1802 },
1803
1804 fcos => {
1805         op_flags  => "R",
1806         rd_constructor => "NONE",
1807         reg_req   => { },
1808         emit      => '. fcos',
1809         attr_type => "ia32_x87_attr_t",
1810 },
1811
1812 fsqrt => {
1813         op_flags  => "R",
1814         rd_constructor => "NONE",
1815         reg_req   => { },
1816         emit      => '. fsqrt $',
1817         attr_type => "ia32_x87_attr_t",
1818 },
1819
1820 # x87 Load and Store
1821
1822 fld => {
1823         rd_constructor => "NONE",
1824         op_flags  => "R|L|F",
1825         state     => "exc_pinned",
1826         reg_req   => { },
1827         emit      => '. fld%XM %AM',
1828         attr_type => "ia32_x87_attr_t",
1829 },
1830
1831 fst => {
1832         rd_constructor => "NONE",
1833         op_flags  => "R|L|F",
1834         state     => "exc_pinned",
1835         reg_req   => { },
1836         emit      => '. fst%XM %AM',
1837         mode      => "mode_M",
1838         attr_type => "ia32_x87_attr_t",
1839 },
1840
1841 fstp => {
1842         rd_constructor => "NONE",
1843         op_flags  => "R|L|F",
1844         state     => "exc_pinned",
1845         reg_req   => { },
1846         emit      => '. fstp%XM %AM',
1847         mode      => "mode_M",
1848         attr_type => "ia32_x87_attr_t",
1849 },
1850
1851 # Conversions
1852
1853 fild => {
1854         op_flags  => "R",
1855         rd_constructor => "NONE",
1856         reg_req   => { },
1857         emit      => '. fild%XM %AM',
1858         attr_type => "ia32_x87_attr_t",
1859 },
1860
1861 fist => {
1862         op_flags  => "R",
1863         rd_constructor => "NONE",
1864         reg_req   => { },
1865         emit      => '. fist%XM %AM',
1866         mode      => "mode_M",
1867         attr_type => "ia32_x87_attr_t",
1868 },
1869
1870 fistp => {
1871         op_flags  => "R",
1872         rd_constructor => "NONE",
1873         reg_req   => { },
1874         emit      => '. fistp%XM %AM',
1875         mode      => "mode_M",
1876         attr_type => "ia32_x87_attr_t",
1877 },
1878
1879 # constants
1880
1881 fldz => {
1882         op_flags  => "R|c|K",
1883         irn_flags  => "R",
1884         reg_req   => { },
1885         emit      => '. fldz',
1886         attr_type => "ia32_x87_attr_t",
1887 },
1888
1889 fld1 => {
1890         op_flags  => "R|c|K",
1891         irn_flags  => "R",
1892         reg_req   => { },
1893         emit      => '. fld1',
1894         attr_type => "ia32_x87_attr_t",
1895 },
1896
1897 fldpi => {
1898         op_flags  => "R|c|K",
1899         irn_flags  => "R",
1900         reg_req   => { },
1901         emit      => '. fldpi',
1902         attr_type => "ia32_x87_attr_t",
1903 },
1904
1905 fldln2 => {
1906         op_flags  => "R|c|K",
1907         irn_flags  => "R",
1908         reg_req   => { },
1909         emit      => '. fldln2',
1910         attr_type => "ia32_x87_attr_t",
1911 },
1912
1913 fldlg2 => {
1914         op_flags  => "R|c|K",
1915         irn_flags  => "R",
1916         reg_req   => { },
1917         emit      => '. fldlg2',
1918         attr_type => "ia32_x87_attr_t",
1919 },
1920
1921 fldl2t => {
1922         op_flags  => "R|c|K",
1923         irn_flags  => "R",
1924         reg_req   => { },
1925         emit      => '. fldll2t',
1926         attr_type => "ia32_x87_attr_t",
1927 },
1928
1929 fldl2e => {
1930         op_flags  => "R|c|K",
1931         irn_flags  => "R",
1932         reg_req   => { },
1933         emit      => '. fldl2e',
1934         attr_type => "ia32_x87_attr_t",
1935 },
1936
1937 # fxch, fpush, fpop
1938 # Note that it is NEVER allowed to do CSE on these nodes
1939 # Moreover, note the virtual register requierements!
1940
1941 fxch => {
1942         op_flags  => "R|K",
1943         reg_req   => { },
1944         cmp_attr  => "return 1;",
1945         emit      => '. fxch %X0',
1946         attr_type => "ia32_x87_attr_t",
1947 },
1948
1949 fpush => {
1950         op_flags  => "R|K",
1951         reg_req   => {},
1952         cmp_attr  => "return 1;",
1953         emit      => '. fld %X0',
1954         attr_type => "ia32_x87_attr_t",
1955 },
1956
1957 fpushCopy => {
1958         op_flags  => "R",
1959         reg_req   => { in => [ "vfp"], out => [ "vfp" ] },
1960         cmp_attr  => "return 1;",
1961         emit      => '. fld %X0',
1962         attr_type => "ia32_x87_attr_t",
1963 },
1964
1965 fpop => {
1966         op_flags  => "R|K",
1967         reg_req   => { },
1968         cmp_attr  => "return 1;",
1969         emit      => '. fstp %X0',
1970         attr_type => "ia32_x87_attr_t",
1971 },
1972
1973 # compare
1974
1975 fcomJmp => {
1976         op_flags  => "L|X|Y",
1977         reg_req   => { },
1978         attr_type => "ia32_x87_attr_t",
1979 },
1980
1981 fcompJmp => {
1982         op_flags  => "L|X|Y",
1983         reg_req   => { },
1984         attr_type => "ia32_x87_attr_t",
1985 },
1986
1987 fcomppJmp => {
1988         op_flags  => "L|X|Y",
1989         reg_req   => { },
1990         attr_type => "ia32_x87_attr_t",
1991 },
1992
1993 fcomrJmp => {
1994         op_flags  => "L|X|Y",
1995         reg_req   => { },
1996         attr_type => "ia32_x87_attr_t",
1997 },
1998
1999 fcomrpJmp => {
2000         op_flags  => "L|X|Y",
2001         reg_req   => { },
2002         attr_type => "ia32_x87_attr_t",
2003 },
2004
2005 fcomrppJmp => {
2006         op_flags  => "L|X|Y",
2007         reg_req   => { },
2008         attr_type => "ia32_x87_attr_t",
2009 },
2010
2011
2012 # -------------------------------------------------------------------------------- #
2013 #  ____ ____  _____                  _                               _             #
2014 # / ___/ ___|| ____| __   _____  ___| |_ ___  _ __   _ __   ___   __| | ___  ___   #
2015 # \___ \___ \|  _|   \ \ / / _ \/ __| __/ _ \| '__| | '_ \ / _ \ / _` |/ _ \/ __|  #
2016 #  ___) |__) | |___   \ V /  __/ (__| || (_) | |    | | | | (_) | (_| |  __/\__ \  #
2017 # |____/____/|_____|   \_/ \___|\___|\__\___/|_|    |_| |_|\___/ \__,_|\___||___/  #
2018 #                                                                                  #
2019 # -------------------------------------------------------------------------------- #
2020
2021
2022 # Spilling and reloading of SSE registers, hardcoded, not generated #
2023
2024 xxLoad => {
2025         op_flags  => "L|F",
2026         state     => "exc_pinned",
2027         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "xmm", "none" ] },
2028         emit      => '. movdqu %D0, %AM',
2029         outs      => [ "res", "M" ],
2030         units     => [ "SSE" ],
2031 },
2032
2033 xxStore => {
2034         op_flags => "L|F",
2035         state    => "exc_pinned",
2036         reg_req  => { in => [ "gp", "gp", "xmm", "none" ] },
2037         emit     => '. movdqu %binop',
2038         units    => [ "SSE" ],
2039         mode     => "mode_M",
2040 },
2041
2042 ); # end of %nodes
2043
2044 # Include the generated SIMD node specification written by the SIMD optimization
2045 $my_script_name = dirname($myname) . "/../ia32/ia32_simd_spec.pl";
2046 unless ($return = do $my_script_name) {
2047         warn "couldn't parse $my_script_name: $@" if $@;
2048         warn "couldn't do $my_script_name: $!"    unless defined $return;
2049         warn "couldn't run $my_script_name"       unless $return;
2050 }