added missing function
[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 # the cpu architecture (ia32, ia64, mips, sparc, ppc, ...)
6
7 $arch = "ia32";
8
9 # The node description is done as a perl hash initializer with the
10 # following structure:
11 #
12 # %nodes = (
13 #
14 # <op-name> => {
15 #   "op_flags"  => "N|L|C|X|I|F|Y|H|c|K",
16 #   "irn_flags" => "R|N|I"
17 #   "arity"     => "0|1|2|3 ... |variable|dynamic|any",
18 #   "state"     => "floats|pinned|mem_pinned|exc_pinned",
19 #   "args"      => [
20 #                    { "type" => "type 1", "name" => "name 1" },
21 #                    { "type" => "type 2", "name" => "name 2" },
22 #                    ...
23 #                  ],
24 #   "comment"   => "any comment for constructor",
25 #   "emit"      => "emit code with templates",
26 #   "rd_constructor" => "c source code which constructs an ir_node"
27 # },
28 #
29 # ... # (all nodes you need to describe)
30 #
31 # ); # close the %nodes initializer
32
33 # op_flags: flags for the operation, OPTIONAL (default is "N")
34 # the op_flags correspond to the firm irop_flags:
35 #   N   irop_flag_none
36 #   L   irop_flag_labeled
37 #   C   irop_flag_commutative
38 #   X   irop_flag_cfopcode
39 #   I   irop_flag_ip_cfopcode
40 #   F   irop_flag_fragile
41 #   Y   irop_flag_forking
42 #   H   irop_flag_highlevel
43 #   c   irop_flag_constlike
44 #   K   irop_flag_keep
45 #
46 # irn_flags: special node flags, OPTIONAL (default is 0)
47 # following irn_flags are supported:
48 #   R   rematerializeable
49 #   N   not spillable
50 #   I   ignore for register allocation
51 #
52 # state: state of the operation, OPTIONAL (default is "floats")
53 #
54 # arity: arity of the operation, MUST NOT BE OMITTED
55 #
56 # args:  the OPTIONAL arguments of the node constructor (debug, irg and block
57 #        are always the first 3 arguments and are always autmatically
58 #        created)
59 #        If this key is missing the following arguments will be created:
60 #        for i = 1 .. arity: ir_node *op_i
61 #        ir_mode *mode
62 #
63 # comment: OPTIONAL comment for the node constructor
64 #
65 # rd_constructor: for every operation there will be a
66 #      new_rd_<arch>_<op-name> function with the arguments from above
67 #      which creates the ir_node corresponding to the defined operation
68 #      you can either put the complete source code of this function here
69 #
70 #      This key is OPTIONAL. If omitted, the following constructor will
71 #      be created:
72 #      if (!op_<arch>_<op-name>) assert(0);
73 #      for i = 1 to arity
74 #         set in[i] = op_i
75 #      done
76 #      res = new_ir_node(db, irg, block, op_<arch>_<op-name>, mode, arity, in)
77 #      return res
78 #
79 # NOTE: rd_constructor and args are only optional if and only if arity is 0,1,2 or 3
80
81 # register types:
82 #   0 - no special type
83 #   1 - caller save (register must be saved by the caller of a function)
84 #   2 - callee save (register must be saved by the called function)
85 #   4 - ignore (do not assign this register)
86 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
87 %reg_classes = (
88   "gp" => [
89             { "name" => "eax", "type" => 1 },
90             { "name" => "edx", "type" => 1 },
91             { "name" => "ebx", "type" => 2 },
92             { "name" => "ecx", "type" => 1 },
93             { "name" => "esi", "type" => 2 },
94             { "name" => "edi", "type" => 2 },
95             { "name" => "ebp", "type" => 2 },
96             { "name" => "esp", "type" => 6 },
97             { "name" => "xxx", "type" => 6 },  # we need a dummy register for NoReg and Unknown nodes
98                         { "mode" => "mode_P" }
99           ],
100   "fp" => [
101             { "name" => "xmm0", "type" => 1 },
102             { "name" => "xmm1", "type" => 1 },
103             { "name" => "xmm2", "type" => 1 },
104             { "name" => "xmm3", "type" => 1 },
105             { "name" => "xmm4", "type" => 1 },
106             { "name" => "xmm5", "type" => 1 },
107             { "name" => "xmm6", "type" => 1 },
108             { "name" => "xmm7", "type" => 1 },
109             { "name" => "xxxx", "type" => 6 },  # we need a dummy register for NoReg and Unknown nodes
110                         { "mode" => "mode_D" }
111           ]
112 ); # %reg_classes
113
114 #--------------------------------------------------#
115 #                        _                         #
116 #                       (_)                        #
117 #  _ __   _____      __  _ _ __    ___  _ __  ___  #
118 # | '_ \ / _ \ \ /\ / / | | '__|  / _ \| '_ \/ __| #
119 # | | | |  __/\ V  V /  | | |    | (_) | |_) \__ \ #
120 # |_| |_|\___| \_/\_/   |_|_|     \___/| .__/|___/ #
121 #                                      | |         #
122 #                                      |_|         #
123 #--------------------------------------------------#
124
125 %nodes = (
126
127 #-----------------------------------------------------------------#
128 #  _       _                                         _            #
129 # (_)     | |                                       | |           #
130 #  _ _ __ | |_ ___  __ _  ___ _ __   _ __   ___   __| | ___  ___  #
131 # | | '_ \| __/ _ \/ _` |/ _ \ '__| | '_ \ / _ \ / _` |/ _ \/ __| #
132 # | | | | | ||  __/ (_| |  __/ |    | | | | (_) | (_| |  __/\__ \ #
133 # |_|_| |_|\__\___|\__, |\___|_|    |_| |_|\___/ \__,_|\___||___/ #
134 #                   __/ |                                         #
135 #                  |___/                                          #
136 #-----------------------------------------------------------------#
137
138 # commutative operations
139
140 # NOTE:
141 # All nodes supporting Addressmode have 5 INs:
142 # 1 - base    r1 == NoReg in case of no AM or no base
143 # 2 - index   r2 == NoReg in case of no AM or no index
144 # 3 - op1     r3 == always present
145 # 4 - op2     r4 == NoReg in case of immediate operation
146 # 5 - mem     NoMem in case of no AM otherwise it takes the mem from the Load
147
148 "Add" => {
149   "irn_flags" => "R",
150   "comment"   => "construct Add: Add(a, b) = Add(b, a) = a + b",
151   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
152   "emit"      => '. add %ia32_emit_binop\t\t\t/* Add(%A1, %A2) -> %D1 */'
153 },
154
155 "Mul" => {
156   "irn_flags" => "A",
157   "comment"   => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
158   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
159   "emit"      => '. imul %ia32_emit_binop\t\t\t/* Mul(%A1, %A2) -> %D1 */'
160 },
161
162 # Mulh is an exception from the 4 INs with AM because the target is always EAX:EDX
163 "Mulh" => {
164   "comment"   => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
165   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "eax in_r1", "edx in_r2" ] },
166   "emit"      => '. imul %ia32_emit_unop\t\t\t/* Mulh(%A1, %A2) -> %D1 */ '
167 },
168
169 "And" => {
170   "irn_flags" => "R",
171   "comment"   => "construct And: And(a, b) = And(b, a) = a AND b",
172   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
173   "emit"      => '. and %ia32_emit_binop\t\t\t/* And(%A1, %A2) -> %D1 */'
174 },
175
176 "Or" => {
177   "irn_flags" => "R",
178   "comment"   => "construct Or: Or(a, b) = Or(b, a) = a OR b",
179   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
180   "emit"      => '. or %ia32_emit_binop\t\t\t/* Or(%A1, %A2) -> %D1 */'
181 },
182
183 "Eor" => {
184   "irn_flags" => "R",
185   "comment"   => "construct Eor: Eor(a, b) = Eor(b, a) = a EOR b",
186   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
187   "emit"      => '. xor %ia32_emit_binop\t\t\t/* Xor(%A1, %A2) -> %D1 */'
188 },
189
190 "Max" => {
191   "irn_flags" => "R",
192   "comment"   => "construct Max: Max(a, b) = Max(b, a) = a > b ? a : b",
193   "reg_req"   => { "in" => [ "gp", "gp" ], "out" => [ "in_r1" ] },
194   "emit"      =>
195 '2. cmp %S1, %S2\t\t\t/* prepare Max (%S1 - %S2), (%A1, %A2) */
196   if (mode_is_signed(get_irn_mode(n))) {
197 4.  cmovl %D1, %S2\t\t\t/* %S1 is less %S2 */
198   }
199   else {
200 4.  cmovb %D1, %S2\t\t\t/* %S1 is below %S2 */
201   }
202 '
203 },
204
205 "Min" => {
206   "irn_flags" => "R",
207   "comment"   => "construct Min: Min(a, b) = Min(b, a) = a < b ? a : b",
208   "reg_req"   => { "in" => [ "gp", "gp" ], "out" => [ "in_r1" ] },
209   "emit"      =>
210 '2. cmp %S1, %S2\t\t\t/* prepare Min (%S1 - %S2), (%A1, %A2) */
211   if (mode_is_signed(get_irn_mode(n))) {
212 2.  cmovg %D1, %S2\t\t\t/* %S1 is greater %S2 */
213   }
214   else {
215 2.  cmova %D1, %S2, %D1\t\t\t/* %S1 is above %S2 */
216   }
217 '
218 },
219
220 # not commutative operations
221
222 "Sub" => {
223   "irn_flags" => "R",
224   "comment"   => "construct Sub: Sub(a, b) = a - b",
225   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
226   "emit"      => '. sub %ia32_emit_binop\t\t\t/* Sub(%A1, %A2) -> %D1 */'
227 },
228
229 "DivMod" => {
230   "op_flags" => "F|L",
231   "state"    => "exc_pinned",
232   "reg_req"  => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "eax in_r1", "edx in_r3" ] },
233   "emit"     =>
234 '  if (mode_is_signed(get_irn_mode(n))) {
235 4.  idiv %S2\t\t\t/* signed DivMod(%S1, %S2) -> %D1, (%A1, %A2, %A3) */
236   }
237   else {
238 4.  div %S2\t\t\t/* unsigned DivMod(%S1, %S2) -> %D1, (%A1, %A2, %A3) */
239   }
240 '
241 },
242
243 "Shl" => {
244   "irn_flags" => "R",
245   "comment"   => "construct Shl: Shl(a, b) = a << b",
246   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r1" ] },
247   "emit"      => '. shl %ia32_emit_binop\t\t\t/* Shl(%A1, %A2) -> %D1 */'
248 },
249
250 "Shr" => {
251   "irn_flags" => "R",
252   "comment"   => "construct Shr: Shr(a, b) = a >> b",
253   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r1" ] },
254   "emit"      => '. shr %ia32_emit_binop\t\t\t/* Shr(%A1, %A2) -> %D1 */'
255 },
256
257 "Shrs" => {
258   "irn_flags" => "R",
259   "comment"   => "construct Shrs: Shrs(a, b) = a >> b",
260   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r1" ] },
261   "emit"      => '. sar %ia32_emit_binop\t\t\t/* Shrs(%A1, %A2) -> %D1 */'
262 },
263
264 "RotR" => {
265   "irn_flags" => "R",
266   "comment"     => "construct RotR: RotR(a, b) = a ROTR b",
267   "reg_req"     => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r1" ] },
268   "emit"        => '. ror %ia32_emit_binop\t\t\t/* RotR(%A1, %A2) -> %D1 */'
269 },
270
271 "RotL" => {
272   "irn_flags" => "R",
273   "comment"   => "construct RotL: RotL(a, b) = a ROTL b",
274   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r1" ] },
275   "emit"      => '. rol %ia32_emit_binop\t\t\t/* RotL(%A1, %A2) -> %D1 */'
276 },
277
278 # unary operations
279
280 "Minus" => {
281   "irn_flags" => "R",
282   "comment"   => "construct Minus: Minus(a) = -a",
283   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
284   "emit"      => '. neg %ia32_emit_unop\t\t\t/* Neg(%A1) -> %D1, (%A1) */'
285 },
286
287 "Inc" => {
288   "irn_flags" => "R",
289   "comment"   => "construct Increment: Inc(a) = a++",
290   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
291   "emit"      => '. inc %ia32_emit_unop\t\t\t/* Inc(%S1) -> %D1, (%A1) */'
292 },
293
294 "Dec" => {
295   "irn_flags" => "R",
296   "comment"   => "construct Decrement: Dec(a) = a--",
297   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
298   "emit"      => '. dec %ia32_emit_unop\t\t\t/* Dec(%S1) -> %D1, (%A1) */'
299 },
300
301 "Not" => {
302   "irn_flags" => "R",
303   "comment"   => "construct Not: Not(a) = !a",
304   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r1" ] },
305   "emit"      => '. not %ia32_emit_unop\t\t\t/* Not(%S1) -> %D1, (%A1) */'
306 },
307
308 # other operations
309
310 "Conv" => {
311   "reg_req"  => { "in" => [ "gp" ], "out" => [ "in_r1" ] },
312   "comment"  => "construct Conv: Conv(a) = (conv)a"
313 },
314
315 "CondJmp" => {
316   "op_flags"  => "L|X|Y",
317   "comment"   => "construct conditional jump: CMP A, B && JMPxx LABEL",
318   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "none", "none" ] },
319 },
320
321 "SwitchJmp" => {
322   "op_flags"  => "L|X|Y",
323   "comment"   => "construct switch",
324   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "none" ] },
325 },
326
327 "Const" => {
328   "op_flags"  => "c",
329   "irn_flags" => "R",
330   "comment"   => "represents an integer constant",
331   "reg_req"   => { "out" => [ "gp" ] },
332   "emit"      => '. mov %D1, %C\t\t\t/* Mov Const into register */',
333   "cmp_attr"  =>
334 '
335   if (attr_a->tp == attr_b->tp) {
336     if (attr_a->tp == ia32_SymConst) {
337       if (attr_a->sc == NULL || attr_b->sc == NULL)
338         return 1;
339       else
340         return strcmp(attr_a->sc, attr_b->sc);
341     }
342     else {
343       if (attr_a->tv == NULL || attr_b->tv == NULL)
344         return 1;
345
346       if (tarval_cmp(attr_a->tv, attr_b->tv) == pn_Cmp_Eq)
347         return 0;
348       else
349         return 1;
350     }
351   }
352   else
353     return 1;
354 '
355 },
356
357 "Cdq" => {
358   "irn_flags" => "R",
359   "comment"   => "construct CDQ: sign extend EAX -> EDX:EAX",
360   "reg_req"   => { "in" => [ "gp" ], "out" => [ "eax in_r1", "edx" ] },
361   "emit"      => '. cdq\t\t\t/* sign extend EAX -> EDX:EAX, (%A1) */'
362 },
363
364 # Load / Store
365
366 "Load" => {
367   "op_flags"  => "L|F",
368   "irn_flags" => "R",
369   "state"     => "exc_pinned",
370   "comment"   => "construct Load: Load(ptr, mem) = LD ptr -> reg",
371   "reg_req"   => { "in" => [ "gp", "gp", "none" ], "out" => [ "gp" ] },
372   "emit"      => '. mov %D1, %ia32_emit_am\t\t\t/* Load((%A1)) -> %D1 */'
373 },
374
375 "Store" => {
376   "op_flags"  => "L|F",
377   "state"     => "exc_pinned",
378   "comment"   => "construct Store: Store(ptr, val, mem) = ST ptr,val",
379   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ] },
380   "emit"      => '. mov %ia32_emit_am, %S3\t\t\t/* Store(%A2) -> (%A1) */'
381 },
382
383 "Lea" => {
384   "irn_flags" => "R",
385   "comment"   => "construct Lea: Lea(a,b) = lea [a+b*const+offs] | res = a + b * const + offs with const = 0,1,2,4,8",
386   "reg_req"   => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
387   "emit"      => '. lea %D1, %ia32_emit_am\t\t/* %D1 = %S1 + %S2 << %C + %O, (%A1, %A2) */'
388 },
389
390 "StackParam" => {
391   "arity"    => 1,
392   "remat"    => 1,
393   "comment"  => "constructs a Stack Parameter to retrieve a parameter from Stack",
394   "reg_req"  => { "in" => [ "none" ], "out" => [ "gp" ] },
395   "cmp_attr" =>
396 '
397   return (attr_a->pn_code != attr_b->pn_code);
398 '
399 },
400
401 "StackArg" => {
402   "arity"    => 2,
403   "comment"  => "constructs a Stack Argument to pass an argument on Stack",
404   "reg_req"  => { "in" => [ "none", "gp" ], "out" => [ "none" ] },
405   "cmp_attr" =>
406 '
407   return (attr_a->pn_code != attr_b->pn_code);
408 '
409 },
410
411 #--------------------------------------------------------#
412 #    __ _             _                     _            #
413 #   / _| |           | |                   | |           #
414 #  | |_| | ___   __ _| |_   _ __   ___   __| | ___  ___  #
415 #  |  _| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
416 #  | | | | (_) | (_| | |_  | | | | (_) | (_| |  __/\__ \ #
417 #  |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
418 #--------------------------------------------------------#
419
420 # commutative operations
421
422 "fAdd" => {
423   "irn_flags" => "R",
424   "comment"   => "construct SSE Add: Add(a, b) = Add(b, a) = a + b",
425   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r1" ] },
426   "emit"      => '. adds%M %ia32_emit_binop\t\t\t/* SSE Add(%A1, %A2) -> %D1 */'
427 },
428
429 "fMul" => {
430   "irn_flags" => "R",
431   "comment"   => "construct SSE Mul: Mul(a, b) = Mul(b, a) = a * b",
432   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
433   "emit"      => '. muls%M %ia32_emit_binop\t\t\t/* SSE Mul(%A1, %A2) -> %D1 */'
434 },
435
436 "fMax" => {
437   "irn_flags" => "R",
438   "comment"   => "construct SSE Max: Max(a, b) = Max(b, a) = a > b ? a : b",
439   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
440   "emit"      => '. maxs%M %ia32_emit_binop\t\t\t/* SSE Max(%A1, %A2) -> %D1 */'
441 },
442
443 "fMin" => {
444   "irn_flags" => "R",
445   "comment"   => "construct SSE Min: Min(a, b) = Min(b, a) = a < b ? a : b",
446   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
447   "emit"      => '. mins%M %ia32_emit_binop\t\t\t/* SSE Min(%A1, %A2) -> %D1 */'
448 },
449
450 "fAnd" => {
451   "irn_flags" => "R",
452   "comment"   => "construct SSE And: And(a, b) = a AND b",
453   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
454   "emit"      => '. andp%M %ia32_emit_binop\t\t\t/* SSE And(%A3, %A4) -> %D1 */'
455 },
456
457 "fOr" => {
458   "irn_flags" => "R",
459   "comment"   => "construct SSE Or: Or(a, b) = a OR b",
460   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
461   "emit"      => '. orp%M %ia32_emit_binop\t\t\t/* SSE Or(%A3, %A4) -> %D1 */'
462 },
463
464 "fEor" => {
465   "irn_flags" => "R",
466   "comment"   => "construct SSE Eor: Eor(a, b) = a XOR b",
467   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r3" ] },
468   "emit"      => '. xorp%M %ia32_emit_binop\t\t\t/* SSE Xor(%A3, %A4) -> %D1 */'
469 },
470
471 # not commutative operations
472
473 "fSub" => {
474   "irn_flags" => "R",
475   "comment"   => "construct SSE Sub: Sub(a, b) = a - b",
476   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r1" ] },
477   "emit"      => '. subs%M %ia32_emit_binop\t\t\t/* SSE Sub(%A1, %A2) -> %D1 */'
478 },
479
480 "fDiv" => {
481   "irn_flags" => "R",
482   "comment"   => "construct SSE Div: Div(a, b) = a / b",
483   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "in_r1" ] },
484   "emit"      => '. divs%M %ia32_emit_binop\t\t\t/* SSE Div(%A1, %A2) -> %D1 */'
485 },
486
487 # other operations
488
489 "fConv" => {
490   "reg_req"  => { "in" => [ "fp" ], "out" => [ "gp" ] },
491   "comment"  => "construct Conv: Conv(a) = (conv)a"
492 },
493
494 "fCondJmp" => {
495   "op_flags"  => "L|X|Y",
496   "comment"   => "construct conditional jump: UCOMIS A, B && JMPxx LABEL",
497   "reg_req"   => { "in" => [ "gp", "gp", "fp", "fp", "none" ], "out" => [ "none", "none" ] },
498 },
499
500 "fConst" => {
501   "op_flags"  => "c",
502   "irn_flags" => "R",
503   "comment"   => "represents a SSE constant",
504   "reg_req"   => { "out" => [ "fp" ] },
505   "emit"      => '. mov%M %D1, %C\t\t\t/* Load fConst into register */',
506   "cmp_attr"  =>
507 '
508   if (attr_a->tp == attr_b->tp) {
509     if (attr_a->tp == ia32_SymConst) {
510       if (attr_a->sc == NULL || attr_b->sc == NULL)
511         return 1;
512       else
513         return strcmp(attr_a->sc, attr_b->sc);
514     }
515     else {
516       if (attr_a->tv == NULL || attr_b->tv == NULL)
517         return 1;
518
519       if (tarval_cmp(attr_a->tv, attr_b->tv) == pn_Cmp_Eq)
520         return 0;
521       else
522         return 1;
523     }
524   }
525   else
526     return 1;
527 '
528 },
529
530 # Load / Store
531
532 "fLoad" => {
533   "op_flags"  => "L|F",
534   "irn_flags" => "R",
535   "state"     => "exc_pinned",
536   "comment"   => "construct SSE Load: Load(ptr, mem) = LD ptr",
537   "reg_req"   => { "in" => [ "gp", "gp", "none" ], "out" => [ "fp" ] },
538   "emit"      => '. movs%M %D1, %ia32_emit_am\t\t\t/* Load((%A1)) -> %D1 */'
539 },
540
541 "fStore" => {
542   "op_flags" => "L|F",
543   "state"    => "exc_pinned",
544   "comment"  => "construct Store: Store(ptr, val, mem) = ST ptr,val",
545   "reg_req"  => { "in" => [ "gp", "gp", "fp", "none" ] },
546   "emit"     => '. movs%M %ia32_emit_am, %S3\t\t\t/* Store(%S3) -> (%A1) */'
547 },
548
549 "fStackParam" => {
550   "arity"    => 1,
551   "remat"    => 1,
552   "comment"  => "constructs a Stack Parameter to retrieve a SSE parameter from Stack",
553   "reg_req"  => { "in" => [ "none" ], "out" => [ "fp" ] },
554   "cmp_attr" =>
555 '
556   return (attr_a->pn_code != attr_b->pn_code);
557 '
558 },
559
560 "fStackArg" => {
561   "arity"    => 2,
562   "comment"  => "constructs a Stack Argument to pass an argument on Stack",
563   "reg_req"  => { "in" => [ "none", "fp" ], "out" => [ "none" ] },
564   "cmp_attr" =>
565 '
566   return (attr_a->pn_code != attr_b->pn_code);
567 '
568 },
569
570 # Call
571
572 "Call" => {
573   "op_flags" => "L|F",
574   "state"    => "mem_pinned",
575   "arity"    => "variable",
576   "comment"  => "construct Call: Call(...)",
577   "args"     => [
578                   { "type" => "int",        "name" => "n" },
579                   { "type" => "ir_node **", "name" => "in" }
580                 ],
581   "rd_constructor" =>
582 "  if (!op_ia32_Call) assert(0);
583   return new_ir_node(db, irg, block, op_ia32_Call, mode_T, n, in);
584 "
585 },
586
587 # Return
588
589 "Return" => {
590   "op_flags" => "L|X",
591   "state"    => "pinned",
592   "arity"    => "variable",
593   "comment"  => "construct Return: Return(...)",
594   "args"     => [
595                   { "type" => "int",        "name" => "n" },
596                   { "type" => "ir_node **", "name" => "in" }
597                 ],
598   "rd_constructor" =>
599 "  if (!op_ia32_Return) assert(0);
600   return new_ir_node(db, irg, block, op_ia32_Return, mode_X, n, in);
601 "
602 },
603
604 # M/Alloc
605
606 "Alloca" => {
607   "op_flags" => "L|F",
608   "state"    => "pinned",
609   "arity"    => "2",
610   "comment"  => "construct Alloca: allocate memory on Stack",
611   "reg_req"  => { "in" => [ "gp" ], "out" => [ "gp" ] }
612 },
613
614 ); # end of %nodes