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