implement floatingpoint compares
[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_fpflags = "mode_Bu";
9 $mode_fp      = "mode_D";
10
11 $normal      =  0; # no special type
12 $caller_save =  1; # caller save (register must be saved by the caller of a function)
13 $callee_save =  2; # callee save (register must be saved by the called function)
14 $ignore      =  4; # ignore (do not assign this register)
15 $arbitrary   =  8; # emitter can choose an arbitrary register of this class
16 $virtual     = 16; # the register is a virtual one
17 $state       = 32; # register represents a state
18
19 # available SPARC registers: 8 globals, 24 window regs (8 ins, 8 outs, 8 locals)
20 %reg_classes = (
21         gp => [
22                 { name => "g0", type => $ignore }, # hardwired 0, behaves like /dev/null
23                 { name => "g1", type => $caller_save }, # temp. value
24                 { name => "g2", type => $caller_save },
25                 { name => "g3", type => $caller_save },
26                 { name => "g4", type => $caller_save },
27                 { name => "g5", type => $ignore }, # reserved by SPARC ABI
28                 { name => "g6", type => $ignore }, # reserved by SPARC ABI
29                 { name => "g7", type => $ignore }, # reserved by SPARC ABI
30
31                 # window's out registers
32                 { name => "o0", type => $caller_save }, # param 1 / return value from callee
33                 { name => "o1", type => $caller_save }, # param 2
34                 { name => "o2", type => $caller_save }, # param 3
35                 { name => "o3", type => $caller_save }, # param 4
36                 { name => "o4", type => $caller_save }, # param 5
37                 { name => "o5", type => $caller_save }, # param 6
38                 { name => "sp", type => $ignore }, # our stackpointer
39                 { name => "o7", type => $ignore }, # temp. value / address of CALL instr.
40
41                 # window's local registers
42                 { name => "l0", type => 0 },
43                 { name => "l1", type => 0 },
44                 { name => "l2", type => 0 },
45                 { name => "l3", type => 0 },
46                 { name => "l4", type => 0 },
47                 { name => "l5", type => 0 },
48                 { name => "l6", type => 0 },
49                 { name => "l7", type => 0 },
50
51                 # window's in registers
52                 { name => "i0", type => 0 }, # incoming param1 / return value to caller
53                 { name => "i1", type => 0 }, # param 2
54                 { name => "i2", type => 0 }, # param 3
55                 { name => "i3", type => 0 }, # param 4
56                 { name => "i4", type => 0 }, # param 5
57                 { name => "i5", type => 0 }, # param 6
58                 { name => "frame_pointer", realname => "fp", type => $ignore }, # our framepointer
59                 { name => "i7", type => $ignore }, # return address - 8
60                 { mode => $mode_gp }
61         ],
62         fpflags_class => [
63                 { name => "fpflags", type => $ignore },
64                 { mode => $mode_fpflags, flags => "manual_ra" }
65         ],
66         flags_class => [
67                 { name => "flags", type => $ignore },
68                 { mode => $mode_flags, flags => "manual_ra" }
69         ],
70         mul_div_high_res => [
71                 { name => "y", type => $ignore },
72                 { mode => $mode_gp, flags => "manual_ra" }
73         ],
74         # fp registers can be accessed any time
75         fp => [
76                 { name => "f0",  type => $caller_save },
77                 { name => "f1",  type => $caller_save },
78                 { name => "f2",  type => $caller_save },
79                 { name => "f3",  type => $caller_save },
80                 { name => "f4",  type => $caller_save },
81                 { name => "f5",  type => $caller_save },
82                 { name => "f6",  type => $caller_save },
83                 { name => "f7",  type => $caller_save },
84                 { name => "f8",  type => $caller_save },
85                 { name => "f9",  type => $caller_save },
86                 { name => "f10", type => $caller_save },
87                 { name => "f11", type => $caller_save },
88                 { name => "f12", type => $caller_save },
89                 { name => "f13", type => $caller_save },
90                 { name => "f14", type => $caller_save },
91                 { name => "f15", type => $caller_save },
92                 { name => "f16", type => $caller_save },
93                 { name => "f17", type => $caller_save },
94                 { name => "f18", type => $caller_save },
95                 { name => "f19", type => $caller_save },
96                 { name => "f20", type => $caller_save },
97                 { name => "f21", type => $caller_save },
98                 { name => "f22", type => $caller_save },
99                 { name => "f23", type => $caller_save },
100                 { name => "f24", type => $caller_save },
101                 { name => "f25", type => $caller_save },
102                 { name => "f26", type => $caller_save },
103                 { name => "f27", type => $caller_save },
104                 { name => "f28", type => $caller_save },
105                 { name => "f29", type => $caller_save },
106                 { name => "f30", type => $caller_save },
107                 { name => "f31", type => $caller_save },
108                 { mode => $mode_fp }
109         ]
110 ); # %reg_classes
111
112 %emit_templates = (
113 # emit source reg or imm dep. on node's arity
114         RI  => "${arch}_emit_reg_or_imm(node, -1);",
115         R1I => "${arch}_emit_reg_or_imm(node, 0);",
116         R2I => "${arch}_emit_reg_or_imm(node, 1);",
117         R3I => "${arch}_emit_reg_or_imm(node, 2);",
118         S1  => "${arch}_emit_source_register(node, 0);",
119         S2  => "${arch}_emit_source_register(node, 1);",
120         S3  => "${arch}_emit_source_register(node, 2);",
121         S4  => "${arch}_emit_source_register(node, 3);",
122         S5  => "${arch}_emit_source_register(node, 4);",
123         S6  => "${arch}_emit_source_register(node, 5);",
124         D1  => "${arch}_emit_dest_register(node, 0);",
125         D2  => "${arch}_emit_dest_register(node, 1);",
126         D3  => "${arch}_emit_dest_register(node, 2);",
127         D4  => "${arch}_emit_dest_register(node, 3);",
128         D5  => "${arch}_emit_dest_register(node, 4);",
129         D6  => "${arch}_emit_dest_register(node, 5);",
130         IM  => "${arch}_emit_immediate(node);",
131         LM  => "${arch}_emit_load_mode(node);",
132         SM  => "${arch}_emit_store_mode(node);",
133         FPM  => "${arch}_emit_fp_mode_suffix(node);",
134         FCONVS => "${arch}_emit_fp_conv_source(node);",
135         FCONVD => "${arch}_emit_fp_conv_destination(node);",
136         O      => "${arch}_emit_offset(node);",
137 );
138
139 $default_attr_type = "sparc_attr_t";
140 $default_copy_attr = "sparc_copy_attr";
141
142
143 %init_attr = (
144         sparc_attr_t             => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
145         sparc_load_store_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
146                                     "\tinit_sparc_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);",
147         sparc_symconst_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
148                                     "\tinit_sparc_symconst_attributes(res, entity);",
149         sparc_jmp_cond_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
150         sparc_jmp_switch_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
151         sparc_save_attr_t        => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
152         sparc_fp_attr_t          => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
153                                     "\tinit_sparc_fp_attributes(res, fp_mode);\n",
154         sparc_fp_conv_attr_t     => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);".
155                                     "\tinit_sparc_fp_conv_attributes(res, src_mode, dest_mode);\n",
156 );
157
158 %compare_attr = (
159         sparc_attr_t            => "cmp_attr_sparc",
160         sparc_load_store_attr_t => "cmp_attr_sparc_load_store",
161         sparc_symconst_attr_t   => "cmp_attr_sparc_symconst",
162         sparc_jmp_cond_attr_t   => "cmp_attr_sparc_jmp_cond",
163         sparc_jmp_switch_attr_t => "cmp_attr_sparc_jmp_switch",
164         sparc_save_attr_t       => "cmp_attr_sparc_save",
165         sparc_fp_attr_t         => "cmp_attr_sparc_fp",
166         sparc_fp_conv_attr_t    => "cmp_attr_sparc_fp_conv",
167 );
168
169 %custom_irn_flags = (
170         modifies_flags    => "sparc_arch_irn_flag_modifies_flags",
171         modifies_fp_flags => "sparc_arch_irn_flag_modifies_fp_flags",
172 );
173
174 # addressing modes: imm, reg, reg +/- imm, reg + reg
175 # max. imm = 13 bits signed (-4096 ... 4096)
176
177 my %cmp_operand_constructors = (
178         imm => {
179                 attr       => "int immediate_value",
180                 custominit => "sparc_set_attr_imm(res, immediate_value);",
181                 reg_req    => { in => [ "gp" ], out => [ "flags" ] },
182                 ins        => [ "left" ],
183         },
184         reg => {
185                 reg_req    => { in => [ "gp", "gp" ], out => [ "flags" ] },
186                 ins        => [ "left", "right" ],
187         },
188 );
189
190 my %unop_operand_constructors = (
191         imm => {
192                 attr       => "int immediate_value",
193                 custominit => "sparc_set_attr_imm(res, immediate_value);",
194                 reg_req    => { in => [], out => [ "gp" ] },
195         },
196         reg => {
197                 reg_req    => { in => [ "gp" ], out => [ "gp" ] },
198         },
199 );
200
201 my %binop_operand_constructors = (
202         imm => {
203                 attr       => "int immediate_value",
204                 custominit => "sparc_set_attr_imm(res, immediate_value);",
205                 reg_req    => { in => [ "gp" ], out => [ "gp" ] },
206                 ins        => [ "left" ],
207         },
208         reg => {
209                 reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
210                 ins        => [ "left", "right" ],
211         },
212 );
213
214 %nodes = (
215
216 Add => {
217         irn_flags => [ "rematerializable" ],
218         mode            => $mode_gp,
219         emit      => '. add %S1, %R2I, %D1',
220         constructors => \%binop_operand_constructors,
221 },
222
223 Sub => {
224         irn_flags => [ "rematerializable" ],
225         mode            => $mode_gp,
226         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
227         emit      => '. sub %S1, %R2I, %D1',
228         constructors => \%binop_operand_constructors,
229 },
230
231
232 # Load / Store
233 Ld => {
234         op_flags  => [ "labeled", "fragile" ],
235         state     => "exc_pinned",
236         ins       => [ "ptr", "mem" ],
237         outs      => [ "res", "M" ],
238         reg_req   => { in => [ "gp", "none" ], out => [ "gp", "none" ] },
239         attr_type => "sparc_load_store_attr_t",
240         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
241         emit      => '. ld%LM [%S1%O], %D1'
242 },
243
244 HiImm => {
245         irn_flags => [ "rematerializable" ],
246         state     => "exc_pinned",
247         outs      => [ "res" ],
248         mode      => $mode_gp,
249         reg_req   => { in => [], out => [ "gp" ] },
250         attr       => "int immediate_value",
251         custominit => "sparc_set_attr_imm(res, immediate_value);",
252 },
253
254 LoImm => {
255         irn_flags => [ "rematerializable" ],
256         state     => "exc_pinned",
257         ins       => [ "hireg" ],
258         outs      => [ "res" ],
259         mode      => $mode_gp,
260         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
261         attr       => "int immediate_value",
262         custominit => "sparc_set_attr_imm(res, immediate_value);",
263 },
264
265 St => {
266         op_flags  => [ "labeled", "fragile" ],
267         mode            => "mode_M",
268         state     => "exc_pinned",
269         ins       => [ "ptr", "val", "mem" ],
270         outs      => [ "M" ],
271         reg_req   => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
272         attr_type => "sparc_load_store_attr_t",
273         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
274         emit      => '. st%SM %S2, [%S1%O]'
275 },
276
277 Mov => {
278         irn_flags => [ "rematerializable" ],
279         arity     => "variable",
280         emit      => '. mov %R1I, %D1',
281         mode      => $mode_gp,
282         constructors => \%unop_operand_constructors,
283 },
284
285 Save => {
286         reg_req   => {
287                 in => [ "sp", "none"],
288                 out => [ "sp:I|S", "frame_pointer:I", "none" ]
289         },
290         ins       => [ "stack", "mem" ],
291         outs      => [ "stack", "frame", "mem" ],
292         attr      => "int initial_stacksize",
293         attr_type => "sparc_save_attr_t",
294         init_attr => "\tinit_sparc_save_attributes(res, initial_stacksize);",
295 },
296
297 SubSP => {
298         reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "gp", "none" ] },
299         ins       => [ "stack", "size", "mem" ],
300         outs      => [ "stack", "addr", "M" ],
301         emit      => ". sub %S1, %S2, %D1\n",
302 },
303
304 AddSP => {
305         reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "none" ] },
306         ins       => [ "stack", "size", "mem" ],
307         outs      => [ "stack", "M" ],
308         emit      => ". add %S1, %S2, %D1\n",
309 },
310
311 SymConst => {
312         op_flags  => [ "constlike" ],
313         irn_flags => [ "rematerializable" ],
314         attr      => "ir_entity *entity",
315         reg_req   => { out => [ "gp" ] },
316         attr_type => "sparc_symconst_attr_t",
317         mode      => $mode_gp,
318 },
319
320 FrameAddr => {
321         op_flags  => [ "constlike" ],
322         irn_flags => [ "rematerializable" ],
323         attr      => "ir_entity *entity",
324         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
325         ins       => [ "base" ],
326         attr_type => "sparc_symconst_attr_t",
327         mode      => $mode_gp,
328 },
329
330 Bicc => {
331         op_flags  => [ "labeled", "cfopcode", "forking" ],
332         state     => "pinned",
333         mode      => "mode_T",
334         attr_type => "sparc_jmp_cond_attr_t",
335         attr      => "pn_Cmp pnc, bool is_unsigned",
336         init_attr => "\tinit_sparc_jmp_cond_attr(res, pnc, is_unsigned);",
337         reg_req   => { in => [ "flags" ], out => [ "none", "none" ] },
338 },
339
340 fbfcc => {
341         op_flags  => [ "labeled", "cfopcode", "forking" ],
342         state     => "pinned",
343         mode      => "mode_T",
344         attr_type => "sparc_jmp_cond_attr_t",
345         attr      => "pn_Cmp pnc",
346         init_attr => "\tinit_sparc_jmp_cond_attr(res, pnc, false);",
347         reg_req   => { in => [ "fpflags" ], out => [ "none", "none" ] },
348 },
349
350 Ba => {
351         state     => "pinned",
352         op_flags  => [ "cfopcode" ],
353         irn_flags => [ "simple_jump" ],
354         reg_req   => { out => [ "none" ] },
355         mode      => "mode_X",
356 },
357
358 Call => {
359         irn_flags => [ "modifies_flags", "modifies_fp_flags" ],
360         state     => "exc_pinned",
361         arity     => "variable",
362         out_arity => "variable",
363         constructors => {
364                 imm => {
365                         attr       => "ir_entity *entity, long offset",
366                         custominit => "get_sparc_attr(res)->immediate_value_entity = entity;",
367                         arity     => "variable",
368                         out_arity => "variable",
369                 },
370                 reg => {
371                         arity     => "variable",
372                         out_arity => "variable",
373                 }
374         },
375 },
376
377 Cmp => {
378         irn_flags    => [ "rematerializable", "modifies_flags" ],
379         emit         => '. cmp %S1, %R2I',
380         reg_req      => { in => [ "gp", "gp" ], out => [ "flags" ] },
381         ins          => [ "left", "right" ],
382         mode         => $mode_flags,
383         constructors => \%cmp_operand_constructors,
384 },
385
386 Tst => {
387         irn_flags    => [ "rematerializable", "modifies_flags" ],
388         emit         => '. tst %S1',
389         mode         => $mode_flags,
390         reg_req      => { in => [ "gp" ], out => [ "flags" ] },
391         ins          => [ "val" ],
392 },
393
394 SwitchJmp => {
395         op_flags  => [ "labeled", "cfopcode", "forking" ],
396         irn_flags => [ "modifies_flags" ],
397         state     => "pinned",
398         mode      => "mode_T",
399         attr      => "int n_projs, long def_proj_num",
400         init_attr => "\tset_sparc_jmp_switch_n_projs(res, n_projs);\n".
401                                         "\tset_sparc_jmp_switch_default_proj_num(res, def_proj_num);",
402         reg_req   => { in => [ "gp" ], out => [ "none" ] },
403         attr_type => "sparc_jmp_switch_attr_t",
404 },
405
406 Sll => {
407         irn_flags => [ "rematerializable" ],
408         mode      => $mode_gp,
409         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
410         emit      => '. sll %S1, %R2I, %D1',
411         constructors => \%binop_operand_constructors,
412 },
413
414 Slr => {
415         irn_flags => [ "rematerializable" ],
416         mode      => $mode_gp,
417         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
418         emit      => '. srl %S1, %R2I, %D1',
419         constructors => \%binop_operand_constructors,
420 },
421
422 Sra => {
423         irn_flags => [ "rematerializable" ],
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         mode      => $mode_gp,
433         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
434         emit      => '. and %S1, %R2I, %D1',
435         constructors => \%binop_operand_constructors,
436 },
437
438 Or => {
439         irn_flags => [ "rematerializable" ],
440         mode      => $mode_gp,
441         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
442         emit      => '. or %S1, %R2I, %D1',
443         constructors => \%binop_operand_constructors,
444 },
445
446 Xor => {
447         irn_flags => [ "rematerializable" ],
448         mode      => $mode_gp,
449         reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
450         emit      => '. xor %S1, %R2I, %D1',
451         constructors => \%binop_operand_constructors,
452 },
453
454 Mul => {
455         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "y" ] },
456         constructors => \%binop_operand_constructors,
457         emit      => '. smul %S1, %R2I, %D1',
458         mode      => $mode_gp,
459 },
460
461 Mulh => {
462         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "gp" ] },
463         outs      => [ "low", "high" ],
464         constructors => \%binop_operand_constructors,
465 },
466
467 # The div instructions are kinda hacky. Things to improve:
468 # * Make high-value input explicitely. Either as a gp at first or ideally
469 #   as an explicit y-register
470
471 SDiv => {
472         irn_flags => [ "rematerializable" ],
473         state     => "exc_pinned",
474         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "none" ] },
475         ins       => [ "dividend_low", "divisor" ],
476         outs      => [ "res", "M" ],
477         constructors => \%binop_operand_constructors,
478 },
479
480 UDiv => {
481         irn_flags => [ "rematerializable" ],
482         state     => "exc_pinned",
483         reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "none" ] },
484         ins       => [ "dividend_low", "divisor" ],
485         outs      => [ "res", "M" ],
486         constructors => \%binop_operand_constructors,
487 },
488
489 Minus => {
490         irn_flags => [ "rematerializable" ],
491         mode      => $mode_gp,
492         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
493         emit      => ". sub %%g0, %S1, %D1"
494 },
495
496 Not => {
497         irn_flags => [ "rematerializable" ],
498         mode      => $mode_gp,
499         reg_req   => { in => [ "gp" ], out => [ "gp" ] },
500         emit      => '. xnor %S1, %%g0, %D1'
501 },
502
503 Nop => {
504         op_flags => [ "keep" ],
505         reg_req  => { in => [], out => [ "none" ] },
506         emit     => '. nop',
507 },
508
509 fcmp => {
510         irn_flags => [ "rematerializable", "modifies_fp_flags" ],
511         reg_req   => { in => [ "fp", "fp" ], out => [ "fpflags" ] },
512         emit      => '. fcmp%FPM %S1, %S2',
513         attr_type => "sparc_fp_attr_t",
514         attr      => "ir_mode *fp_mode",
515         mode      => $mode_fpflags,
516 },
517
518 fadd => {
519         op_flags  => [ "commutative" ],
520         irn_flags => [ "rematerializable" ],
521         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
522         emit      => '. fadd%FPM %S1, %S2, %D1',
523         attr_type => "sparc_fp_attr_t",
524         attr      => "ir_mode *fp_mode",
525         mode      => $mode_fp,
526 },
527
528 fsub => {
529         irn_flags => [ "rematerializable" ],
530         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
531         emit      => '. fsub%FPM %S1, %S2, %D1',
532         attr_type => "sparc_fp_attr_t",
533         attr      => "ir_mode *fp_mode",
534         mode      => $mode_fp,
535 },
536
537 fmul => {
538         irn_flags => [ "rematerializable" ],
539         op_flags  => [ "commutative" ],
540         reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
541         emit      =>'. fmul%FPM %S1, %S2, %D1',
542         attr_type => "sparc_fp_attr_t",
543         attr      => "ir_mode *fp_mode",
544         mode      => $mode_fp,
545 },
546
547 fdiv => {
548         irn_flags => [ "rematerializable" ],
549         reg_req   => { in => [ "fp", "fp" ], out => [ "fp", "none" ] },
550         emit      => '. fdiv%FPM %S1, %S2, %D1',
551         attr_type => "sparc_fp_attr_t",
552         attr      => "ir_mode *fp_mode",
553         outs      => [ "res", "M" ],
554 },
555
556 fneg => {
557         irn_flags => [ "rematerializable" ],
558         reg_req   => { in => [ "fp" ], out => [ "fp" ] },
559         emit      => '. fneg%FPM %S1, %D1',
560         attr_type => "sparc_fp_attr_t",
561         attr      => "ir_mode *fp_mode",
562         mode      => $mode_fp,
563 },
564
565 "fabs" => {
566         irn_flags => [ "rematerializable" ],
567         reg_req   => { in => [ "fp" ], out => [ "fp" ] },
568         emit      => '. fabs%FPM %S1, %D1',
569         attr_type => "sparc_fp_attr_t",
570         attr      => "ir_mode *fp_mode",
571         mode      => $mode_fp,
572 },
573
574 fftof => {
575         irn_flags => [ "rematerializable" ],
576         reg_req   => { in => [ "fp" ], out => [ "fp" ] },
577         emit      => '. f%FCONVS.to%FCONVD %S1, %D1',
578         attr_type => "sparc_fp_conv_attr_t",
579         attr      => "ir_mode *src_mode, ir_mode *dest_mode",
580         mode      => $mode_fp,
581 },
582
583 fitof => {
584         irn_flags => [ "rematerializable" ],
585         reg_req   => { in => [ "gp" ], out => [ "fp" ] },
586         emit      => '. fito%FPM %S1, %D1',
587         attr_type => "sparc_fp_attr_t",
588         attr      => "ir_mode *fp_mode",
589         mode      => $mode_fp,
590 },
591
592 fftoi => {
593         irn_flags => [ "rematerializable" ],
594         reg_req   => { in => [ "fp" ], out => [ "gp" ] },
595         emit      => '. f%FPM.toi %S1, %D1',
596         attr_type => "sparc_fp_attr_t",
597         attr      => "ir_mode *fp_mode",
598         mode      => $mode_gp,
599 },
600
601 Ldf => {
602         op_flags  => [ "labeled", "fragile" ],
603         state     => "exc_pinned",
604         ins       => [ "ptr", "mem" ],
605         outs      => [ "res", "M" ],
606         reg_req   => { in => [ "gp", "none" ], out => [ "fp", "none" ] },
607         attr_type => "sparc_load_store_attr_t",
608         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
609         emit      => '. ld [%S1%O], %D1'
610 },
611
612 Stf => {
613         op_flags  => [ "labeled", "fragile" ],
614         state     => "exc_pinned",
615         ins       => [ "ptr", "val", "mem" ],
616         outs      => [ "M" ],
617         reg_req   => { in => [ "gp", "fp", "none" ], out => [ "none" ] },
618         attr_type => "sparc_load_store_attr_t",
619         attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
620         emit      => '. st %S2, [%S1%O]',
621         mode      => 'mode_M',
622 },
623
624 ); # end of %nodes