some cleanups in arm+sparc backends
[libfirm] / ir / be / sparc / sparc_spec.pl
1 # Creation: 2006/02/13
2 # $Id$
3
4 $arch = "sparc";
5
6 $mode_gp      = "mode_Iu";
7 $mode_flags   = "mode_Bu";
8 $mode_fp      = "mode_D";
9
10 $normal      =  0; # no special type
11 $caller_save =  1; # caller save (register must be saved by the caller of a function)
12 $callee_save =  2; # callee save (register must be saved by the called function)
13 $ignore      =  4; # ignore (do not assign this register)
14 $arbitrary   =  8; # emitter can choose an arbitrary register of this class
15 $virtual     = 16; # the register is a virtual one
16 $state       = 32; # register represents a state
17
18 # available SPARC registers: 8 globals, 24 window regs (8 ins, 8 outs, 8 locals)
19 %reg_classes = (
20         gp => [
21                 { name => "g0", realname => "g0", type => $ignore }, # hardwired 0, behaves like /dev/null
22                 { name => "g1", realname => "g1", type => $caller_save }, # temp. value
23                 { name => "g2", realname => "g2", type => $caller_save },
24                 { name => "g3", realname => "g3", type => $caller_save },
25                 { name => "g4", realname => "g4", type => $caller_save },
26                 { name => "g5", realname => "g5", type => $ignore }, # reserved by SPARC ABI
27                 { name => "g6", realname => "g6", type => $ignore }, # reserved by SPARC ABI
28                 { name => "g7", realname => "g7", type => $ignore }, # reserved by SPARC ABI
29
30                 # window's out registers
31                 { name => "o0", realname => "o0", type => $caller_save }, # param 1 / return value from callee
32                 { name => "o1", realname => "o1", type => $caller_save }, # param 2
33                 { name => "o2", realname => "o2", type => $caller_save }, # param 3
34                 { name => "o3", realname => "o3", type => $caller_save }, # param 4
35                 { name => "o4", realname => "o4", type => $caller_save }, # param 5
36                 { name => "o5", realname => "o5", type => $caller_save }, # param 6
37                 { name => "sp", realname => "sp", type => $ignore }, # our stackpointer
38                 { name => "o7", realname => "o6", type => $ignore }, # temp. value / address of CALL instr.
39
40                 # window's local registers
41                 { name => "l0", realname => "l0", type => 0 },
42                 { name => "l1", realname => "l1", type => 0 },
43                 { name => "l2", realname => "l2", type => 0 },
44                 { name => "l3", realname => "l3", type => 0 },
45                 { name => "l4", realname => "l4", type => 0 },
46                 { name => "l5", realname => "l5", type => 0 },
47                 { name => "l6", realname => "l6", type => 0 },
48                 { name => "l7", realname => "l7", type => 0 },
49
50                 # window's in registers
51                 { name => "i0", realname => "i0", type => 0 }, # incoming param1 / return value to caller
52                 { name => "i1", realname => "i1", type => 0 }, # param 2
53                 { name => "i2", realname => "i2", type => 0 }, # param 3
54                 { name => "i3", realname => "i3", type => 0 }, # param 4
55                 { name => "i4", realname => "i4", type => 0 }, # param 5
56                 { name => "i5", realname => "i5", type => 0 }, # param 6
57                 { name => "fp", realname => "fp", type => $ignore }, # our framepointer
58                 { name => "i7", realname => "i7", type => $ignore }, # return address - 8
59                 { mode => $mode_gp }
60         ],
61         flags => [
62                 { name => "y", realname => "y", type => $ignore },  # the multiply/divide state register
63                 { mode => $mode_flags, flags => "manual_ra" }
64         ],
65         # fp registers can be accessed any time
66         fp  => [
67                 { name => "f0",  type => $caller_save },
68                 { name => "f1",  type => $caller_save },
69                 { name => "f2",  type => $caller_save },
70                 { name => "f3",  type => $caller_save },
71                 { name => "f4",  type => $caller_save },
72                 { name => "f5",  type => $caller_save },
73                 { name => "f6",  type => $caller_save },
74                 { name => "f7",  type => $caller_save },
75                 { name => "f8",  type => $caller_save },
76                 { name => "f9",  type => $caller_save },
77                 { name => "f10", type => $caller_save },
78                 { name => "f11", type => $caller_save },
79                 { name => "f12", type => $caller_save },
80                 { name => "f13", type => $caller_save },
81                 { name => "f14", type => $caller_save },
82                 { name => "f15", type => $caller_save },
83                 { name => "f16", type => $caller_save },
84                 { name => "f17", type => $caller_save },
85                 { name => "f18", type => $caller_save },
86                 { name => "f19", type => $caller_save },
87                 { name => "f20", type => $caller_save },
88                 { name => "f21", type => $caller_save },
89                 { name => "f22", type => $caller_save },
90                 { name => "f23", type => $caller_save },
91                 { name => "f24", type => $caller_save },
92                 { name => "f25", type => $caller_save },
93                 { name => "f26", type => $caller_save },
94                 { name => "f27", type => $caller_save },
95                 { name => "f28", type => $caller_save },
96                 { name => "f29", type => $caller_save },
97                 { name => "f30", type => $caller_save },
98                 { name => "f31", type => $caller_save },
99                 { mode => $mode_fp }
100         ]
101 ); # %reg_classes
102
103 %emit_templates = (
104 # emit source reg or imm dep. on node's arity
105         RI => "${arch}_emit_reg_or_imm(node, -1);",
106         R1I => "${arch}_emit_reg_or_imm(node, 0);",
107         R2I => "${arch}_emit_reg_or_imm(node, 1);",
108         R3I => "${arch}_emit_reg_or_imm(node, 2);",
109 # simple reg emitters
110         S1 => "${arch}_emit_source_register(node, 0);",
111         S2 => "${arch}_emit_source_register(node, 1);",
112         S3 => "${arch}_emit_source_register(node, 2);",
113         S4 => "${arch}_emit_source_register(node, 3);",
114         S5 => "${arch}_emit_source_register(node, 4);",
115         S6 => "${arch}_emit_source_register(node, 5);",
116         D1 => "${arch}_emit_dest_register(node, 0);",
117         D2 => "${arch}_emit_dest_register(node, 1);",
118         D3 => "${arch}_emit_dest_register(node, 2);",
119         D4 => "${arch}_emit_dest_register(node, 3);",
120         D5 => "${arch}_emit_dest_register(node, 4);",
121         D6 => "${arch}_emit_dest_register(node, 5);",
122 # more custom emitters
123         C  => "${arch}_emit_immediate(node);",
124         LM  => "${arch}_emit_load_mode(node);",
125         SM  => "${arch}_emit_store_mode(node);",
126         EXTPREF  => "${arch}_emit_mode_sign_prefix(node);",
127         FPM  => "${arch}_emit_fp_mode_suffix(node);",
128         FPLM  => "${arch}_emit_fp_load_mode(node);",
129         FPSM  => "${arch}_emit_fp_store_mode(node);",
130         O  => "${arch}_emit_offset(node);",
131 );
132
133 $default_attr_type = "sparc_attr_t";
134 $default_copy_attr = "sparc_copy_attr";
135
136
137 %init_attr = (
138         sparc_attr_t             => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
139         sparc_load_store_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
140                                     "\tinit_sparc_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);",
141         sparc_symconst_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
142                                     "\tinit_sparc_symconst_attributes(res, entity);",
143         sparc_cmp_attr_t         => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n",
144         sparc_jmp_cond_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
145         sparc_jmp_switch_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
146         sparc_save_attr_t        => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
147
148 );
149
150 %compare_attr = (
151         sparc_attr_t            => "cmp_attr_sparc",
152         sparc_load_store_attr_t => "cmp_attr_sparc_load_store",
153         sparc_symconst_attr_t   => "cmp_attr_sparc_symconst",
154         sparc_jmp_cond_attr_t   => "cmp_attr_sparc_jmp_cond",
155         sparc_jmp_switch_attr_t => "cmp_attr_sparc_jmp_switch",
156         sparc_cmp_attr_t        => "cmp_attr_sparc_cmp",
157         sparc_save_attr_t       => "cmp_attr_sparc_save",
158 );
159
160 # addressing modes: imm, reg, reg +/- imm, reg + reg
161 # max. imm = 13 bits signed (-4096 ... 4096)
162
163 my %cmp_operand_constructors = (
164         imm => {
165                 attr       => "int immediate_value, bool ins_permuted, bool is_unsigned",
166                 custominit => "sparc_set_attr_imm(res, immediate_value);" .
167                                                 "\tinit_sparc_cmp_attr(res, ins_permuted, is_unsigned);",
168                 reg_req    => { in => [ "gp" ], out => [ "flags" ] },
169         ins        => [ "left" ],
170         },
171         reg => {
172         attr       => "bool ins_permuted, bool is_unsigned",
173                 custominit => "init_sparc_cmp_attr(res, ins_permuted, is_unsigned);",
174                 reg_req    => { in => [ "gp", "gp" ], out => [ "flags" ] },
175                 ins        => [ "left", "right" ],
176         },
177 );
178
179 my %unop_operand_constructors = (
180         imm => {
181                 attr       => "int immediate_value",
182                 custominit => "sparc_set_attr_imm(res, immediate_value);",
183                 reg_req    => { in => [], out => [ "gp" ] },
184         },
185         reg => {
186                 reg_req    => { in => [ "gp" ], out => [ "gp" ] },
187         },
188 );
189
190 my %binop_operand_constructors = (
191         imm => {
192                 attr       => "int immediate_value",
193                 custominit => "sparc_set_attr_imm(res, immediate_value);",
194                 reg_req    => { in => [ "gp" ], out => [ "gp" ] },
195                 ins        => [ "left" ],
196         },
197         reg => {
198                 reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
199                 ins        => [ "left", "right" ],
200         },
201 );
202
203 %nodes = (
204
205 Add => {
206         irn_flags => [ "rematerializable" ],
207         comment   => "construct Add: Add(a, b) = Add(b, a) = a + b",
208         mode            => $mode_gp,
209         emit      => '. add %S1, %R2I, %D1',
210         constructors => \%binop_operand_constructors,
211 },
212
213 Sub => {
214         irn_flags => [ "rematerializable" ],
215         comment   => "construct Sub: Sub(a, b) = a - b",
216         mode            => $mode_gp,
217         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
218         emit      => '. sub %S1, %R2I, %D1',
219         constructors => \%binop_operand_constructors,
220 },
221
222
223 # Load / Store
224 Load => {
225         op_flags  => [ "labeled", "fragile" ],
226         comment   => "construct Load: Load(ptr, mem) = LD ptr -> reg",
227         state     => "exc_pinned",
228         ins       => [ "ptr", "mem" ],
229         outs      => [ "res", "M" ],
230         reg_req   => { in => [ "gp", "none" ], out => [ "gp", "none" ] },
231         attr_type => "sparc_load_store_attr_t",
232         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
233         emit      => '. ld%LM [%S1%O], %D1'
234 },
235
236 LoadHi => {
237         op_flags  => [ "labeled", "fragile" ],
238         comment   => "construct LoadHi: Load(ptr, mem) = sethi hi(ptr) -> reg",
239         state     => "exc_pinned",
240         ins       => [ "ptr", "mem" ],
241         outs      => [ "res", "M" ],
242         reg_req   => { in => [ "gp", "none" ], out => [ "gp", "none" ] },
243         attr_type => "sparc_load_store_attr_t",
244         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
245         emit      => '. sethi %%hi(%S1), %D1',
246 },
247
248 HiImm => {
249         irn_flags => [ "rematerializable" ],
250         comment   => "construct LoadHi: Load(imm, mem) = sethi hi(imm) -> reg",
251         state     => "exc_pinned",
252         outs      => [ "res" ],
253         mode      => $mode_gp,
254         reg_req   => { in => [], out => [ "gp" ] },
255         #attr_type => "sparc_load_store_attr_t",
256         attr       => "int immediate_value",
257         custominit => "sparc_set_attr_imm(res, immediate_value);",
258 },
259
260 LoImm => {
261         irn_flags => [ "rematerializable" ],
262         comment   => "construct LoadHi: Load(imm, mem) = sethi hi(imm) -> reg",
263         state     => "exc_pinned",
264         ins       => [ "hireg" ],
265         outs      => [ "res" ],
266         mode      => $mode_gp,
267         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
268         #attr_type => "sparc_load_store_attr_t",
269         attr       => "int immediate_value",
270         custominit => "sparc_set_attr_imm(res, immediate_value);",
271 },
272
273 LoadLo => {
274         op_flags  => [ "labeled", "fragile" ],
275         comment   => "construct LoadLo: Or(in, ptr, mem) = or in lo(ptr) -> reg",
276         state     => "exc_pinned",
277         ins       => [ "hireg", "ptr", "mem" ],
278         outs      => [ "res", "M" ],
279         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "gp", "none" ] },
280         attr_type => "sparc_load_store_attr_t",
281         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
282         emit      => '. or %S1, %%lo(%S2), %D1'
283 },
284
285 Store => {
286         op_flags  => [ "labeled", "fragile" ],
287         comment   => "construct Store: Store(ptr, val, mem) = ST ptr,val",
288         mode            => "mode_M",
289         state     => "exc_pinned",
290         ins       => [ "ptr", "val", "mem" ],
291         outs      => [ "mem" ],
292         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
293         attr_type => "sparc_load_store_attr_t",
294         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
295         emit      => '. st%SM %S2, [%S1%O]'
296 },
297
298 Mov => {
299         irn_flags => [ "rematerializable" ],
300         comment   => "construct Mov: Mov(src, dest) = MV src,dest",
301         arity     => "variable",
302         emit      => '. mov %R1I, %D1',
303         mode      => $mode_gp,
304         constructors => \%unop_operand_constructors,
305 },
306
307 Save => {
308         comment => "function prolog instruction. autom. saves sp & shifts the register window. previous out regs become the new in regs",
309         reg_req   => {
310                 in => [ "sp", "none"],
311                 out => [ "sp:I|S","none" ]
312         },
313         ins       => [ "stack", "mem" ],
314         outs      => [ "stack", "mem" ],
315         attr      => "int initial_stacksize",
316         attr_type => "sparc_save_attr_t",
317         init_attr => "\tinit_sparc_save_attr(res, initial_stacksize);",
318 },
319
320 AddSP => {
321         comment => "alloc stack space",
322         reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "gp", "none" ] },
323         ins       => [ "stack", "size", "mem" ],
324         outs      => [ "stack", "addr", "M" ],
325         emit      => ". sub %S1, %S2, %D1\n",
326 },
327
328 SubSP => {
329         comment => "free stack space",
330         reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "none" ] },
331         ins       => [ "stack", "size", "mem" ],
332         outs      => [ "stack", "M" ],
333         emit      => ". add %S1, %S2, %D1\n",
334 },
335
336 SymConst => {
337         op_flags  => [ "constlike" ],
338         irn_flags => [ "rematerializable" ],
339         attr      => "ir_entity *entity",
340         reg_req   => { out => [ "gp" ] },
341         attr_type => "sparc_symconst_attr_t",
342         mode      => $mode_gp,
343 },
344
345 FrameAddr => {
346         op_flags  => [ "constlike" ],
347         irn_flags => [ "rematerializable" ],
348         attr      => "ir_entity *entity",
349         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
350         ins       => [ "base" ],
351         attr_type => "sparc_symconst_attr_t",
352         mode      => $mode_gp,
353 },
354
355 Branch => {
356         op_flags  => [ "labeled", "cfopcode", "forking" ],
357         state     => "pinned",
358         mode      => "mode_T",
359         reg_req   => { in => [ "flags" ], out => [ "none", "none" ] },
360         attr      => "int proj_num",
361         attr_type => "sparc_jmp_cond_attr_t",
362         init_attr => "\tset_sparc_jmp_cond_proj_num(res, proj_num);",
363 },
364
365 Jmp => {
366         state     => "pinned",
367         op_flags  => [ "cfopcode" ],
368         irn_flags => [ "simple_jump" ],
369         reg_req   => { out => [ "none" ] },
370         mode      => "mode_X",
371 },
372
373 Cmp => {
374         irn_flags    => [ "rematerializable", "modify_flags" ],
375         emit         => '. cmp %S1, %R2I',
376         mode         => $mode_flags,
377         attr_type    => "sparc_cmp_attr_t",
378         constructors => \%cmp_operand_constructors,
379 },
380
381 Tst => {
382         irn_flags    => [ "rematerializable", "modify_flags" ],
383         emit         => '. tst %S1',
384         mode         => $mode_flags,
385         attr_type    => "sparc_cmp_attr_t",
386         attr         => "bool ins_permuted, bool is_unsigned",
387         custominit   => "init_sparc_cmp_attr(res, ins_permuted, is_unsigned);",
388         reg_req      => { in => [ "gp" ], out => [ "flags" ] },
389         ins          => [ "left" ],
390 },
391
392 SwitchJmp => {
393         op_flags  => [ "labeled", "cfopcode", "forking" ],
394         state     => "pinned",
395         mode      => "mode_T",
396         attr      => "int n_projs, long def_proj_num",
397         init_attr => "\tset_sparc_jmp_switch_n_projs(res, n_projs);\n".
398                                         "\tset_sparc_jmp_switch_default_proj_num(res, def_proj_num);",
399         reg_req   => { in => [ "gp" ], out => [ "none" ] },
400         attr_type => "sparc_jmp_switch_attr_t",
401 },
402
403 ShiftLL => {
404         irn_flags => [ "rematerializable" ],
405         comment   => "construct shift logical left",
406         mode            => $mode_gp,
407         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
408         emit      => '. sll %S1, %R2I, %D1',
409         constructors => \%binop_operand_constructors,
410 },
411
412 ShiftLR => {
413         irn_flags => [ "rematerializable" ],
414         comment   => "construct shift logical right",
415         mode            => $mode_gp,
416         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
417         emit      => '. srl %S1, %R2I, %D1',
418         constructors => \%binop_operand_constructors,
419 },
420
421 ShiftRA => {
422         irn_flags => [ "rematerializable" ],
423         comment   => "construct shift right arithmetical",
424         mode            => $mode_gp,
425         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
426         emit      => '. sra %S1, %R2I, %D1',
427         constructors => \%binop_operand_constructors,
428 },
429
430 And => {
431         irn_flags => [ "rematerializable" ],
432         comment   => "construct logical and",
433         mode            => $mode_gp,
434         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
435         emit      => '. and %S1, %R2I, %D1',
436         constructors => \%binop_operand_constructors,
437 },
438
439 Or => {
440         irn_flags => [ "rematerializable" ],
441         comment   => "construct logical or",
442         mode            => $mode_gp,
443         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
444         emit      => '. or %S1, %R2I, %D1',
445         constructors => \%binop_operand_constructors,
446 },
447
448 Xor => {
449         irn_flags => [ "rematerializable" ],
450         comment   => "construct logical xor",
451         mode            => $mode_gp,
452         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
453         emit      => '. xor %S1, %R2I, %D1',
454         constructors => \%binop_operand_constructors,
455 },
456
457 Mul => {
458         state     => "exc_pinned",
459         comment   => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
460         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "flags" ] },
461         outs      => [ "low", "high" ],
462         constructors => \%binop_operand_constructors,
463         #emit      =>'. mul %S1, %R2I, %D1'
464 },
465
466 Mulh => {
467         state     => "exc_pinned",
468         comment   => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
469         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "gp" ] },
470         outs      => [ "low", "high" ],
471         constructors => \%binop_operand_constructors,
472 },
473
474 Div => {
475         irn_flags => [ "rematerializable" ],
476         state     => "exc_pinned",
477         comment   => "construct Div: Div(a, b) = a / b",
478         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
479         outs      => [ "res" ],
480         constructors => \%binop_operand_constructors,
481         #mode      => $mode_gp,
482         #emit      =>'. div %S1, %R2I, %D1'
483 },
484
485 Minus => {
486         irn_flags => [ "rematerializable" ],
487         mode        => $mode_gp,
488         comment   => "construct Minus: Minus(a) = -a",
489         #reg_req   => { in => [ "gp" ], out => [ "in_r1" ] },
490         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
491         emit      => ". sub %%g0, %S1, %D1"
492 },
493
494 Not => {
495         irn_flags   => [ "rematerializable" ],
496         mode          => $mode_gp,
497         comment     => "construct Not: Not(a) = !a",
498         reg_req     => { in => [ "gp" ], out => [ "gp" ] },
499         emit        => '. xnor %S1, %%g0, %D1'
500 },
501
502 Nop => {
503         op_flags => [ "keep" ],
504         reg_req  => { in => [], out => [ "none" ] },
505         emit     => '. nop',
506 },
507
508 fAdd => {
509         op_flags  => [ "commutative" ],
510         irn_flags => [ "rematerializable" ],
511         comment   => "construct FP Add: Add(a, b) = Add(b, a) = a + b",
512         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
513         emit      => '. fadd%FPM %S1, %S2, %D1'
514 },
515
516 fMul => {
517         op_flags  => [ "commutative" ],
518         comment   => "construct FP Mul: Mul(a, b) = Mul(b, a) = a * b",
519         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
520         emit      =>'. fmul%FPM %S1, %S2, %D1'
521 },
522
523 fsMuld => {
524         op_flags  => [ "commutative" ],
525         comment   => "construct FP single to double precision Mul: Mul(a, b) = Mul(b, a) = a * b",
526         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
527         emit      =>'. fsmuld %S1, %S2, %D1'
528 },
529
530 FpSToFpD => {
531         irn_flags => [ "rematerializable" ],
532         comment   => "convert FP (single) to FP (double)",
533         reg_req   => { in => [ "fp" ], out => [ "fp" ] },
534         emit      =>'. FsTOd %S1, %D1'
535 },
536
537 FpDToFpS => {
538         irn_flags => [ "rematerializable" ],
539         comment   => "convert FP (double) to FP (single)",
540         reg_req   => { in => [ "fp" ], out => [ "fp" ] },
541         emit      =>'. FdTOs %S1, %D1'
542 },
543
544 FpSToInt => {
545         irn_flags => [ "rematerializable" ],
546         comment   => "convert integer to FP",
547         reg_req   => { in => [ "fp" ], out => [ "gp" ] },
548         emit      =>'. FiTOs %S1, %D1'
549 },
550
551 FpDToInt => {
552         irn_flags => [ "rematerializable" ],
553         comment   => "convert integer to FP",
554         reg_req   => { in => [ "fp" ], out => [ "gp" ] },
555         emit      =>'. FiTOd %S1, %D1'
556 },
557
558 IntToFpS => {
559         irn_flags => [ "rematerializable" ],
560         comment   => "convert FP (single) to integer",
561         reg_req   => { in => [ "gp" ], out => [ "fp" ] },
562         emit      =>'. FsTOi %S1, %D1'
563 },
564
565 IntToFpD => {
566         irn_flags => [ "rematerializable" ],
567         comment   => "convert FP (double) to integer",
568         reg_req   => { in => [ "gp" ], out => [ "fp" ] },
569         emit      =>'. FdTOi %S1, %D1'
570 },
571
572 ); # end of %nodes