sparc_spec.pl 16.2 KB
Newer Older
Hannes Rapp's avatar
Hannes Rapp committed
1
# Creation: 2006/02/13
Michael Beck's avatar
Michael Beck committed
2
# $Id$
Hannes Rapp's avatar
Hannes Rapp committed
3
4
5
6
7
8
9

$arch = "sparc";

$mode_gp      = "mode_Iu";
$mode_flags   = "mode_Bu";
$mode_fp      = "mode_D";

Matthias Braun's avatar
Matthias Braun committed
10
11
12
13
14
15
16
$normal      =  0; # no special type
$caller_save =  1; # caller save (register must be saved by the caller of a function)
$callee_save =  2; # callee save (register must be saved by the called function)
$ignore      =  4; # ignore (do not assign this register)
$arbitrary   =  8; # emitter can choose an arbitrary register of this class
$virtual     = 16; # the register is a virtual one
$state       = 32; # register represents a state
Hannes Rapp's avatar
Hannes Rapp committed
17
18
19
20

# available SPARC registers: 8 globals, 24 window regs (8 ins, 8 outs, 8 locals)
%reg_classes = (
	gp => [
Matthias Braun's avatar
Matthias Braun committed
21
22
23
24
25
26
27
28
		{ name => "g0", realname => "g0", type => $ignore }, # hardwired 0, behaves like /dev/null
		{ name => "g1", realname => "g1", type => $caller_save }, # temp. value
		{ name => "g2", realname => "g2", type => $caller_save },
		{ name => "g3", realname => "g3", type => $caller_save },
		{ name => "g4", realname => "g4", type => $caller_save },
		{ name => "g5", realname => "g5", type => $ignore }, # reserved by SPARC ABI
		{ name => "g6", realname => "g6", type => $ignore }, # reserved by SPARC ABI
		{ name => "g7", realname => "g7", type => $ignore }, # reserved by SPARC ABI
Hannes Rapp's avatar
Hannes Rapp committed
29
30

		# window's out registers
Matthias Braun's avatar
Matthias Braun committed
31
32
33
34
35
36
37
38
		{ name => "o0", realname => "o0", type => $caller_save }, # param 1 / return value from callee
		{ name => "o1", realname => "o1", type => $caller_save }, # param 2
		{ name => "o2", realname => "o2", type => $caller_save }, # param 3
		{ name => "o3", realname => "o3", type => $caller_save }, # param 4
		{ name => "o4", realname => "o4", type => $caller_save }, # param 5
		{ name => "o5", realname => "o5", type => $caller_save }, # param 6
		{ name => "sp", realname => "sp", type => $ignore }, # our stackpointer
		{ name => "o7", realname => "o6", type => $ignore }, # temp. value / address of CALL instr.
Hannes Rapp's avatar
Hannes Rapp committed
39
40

		# window's local registers
41
42
43
44
45
46
47
48
		{ name => "l0", realname => "l0", type => 0 },
		{ name => "l1", realname => "l1", type => 0 },
		{ name => "l2", realname => "l2", type => 0 },
		{ name => "l3", realname => "l3", type => 0 },
		{ name => "l4", realname => "l4", type => 0 },
		{ name => "l5", realname => "l5", type => 0 },
		{ name => "l6", realname => "l6", type => 0 },
		{ name => "l7", realname => "l7", type => 0 },
Hannes Rapp's avatar
Hannes Rapp committed
49
50

		# window's in registers
51
52
53
54
55
56
		{ name => "i0", realname => "i0", type => 0 }, # incoming param1 / return value to caller
		{ name => "i1", realname => "i1", type => 0 }, # param 2
		{ name => "i2", realname => "i2", type => 0 }, # param 3
		{ name => "i3", realname => "i3", type => 0 }, # param 4
		{ name => "i4", realname => "i4", type => 0 }, # param 5
		{ name => "i5", realname => "i5", type => 0 }, # param 6
Matthias Braun's avatar
Matthias Braun committed
57
58
		{ name => "fp", realname => "fp", type => $ignore }, # our framepointer
		{ name => "i7", realname => "i7", type => $ignore }, # return address - 8
Hannes Rapp's avatar
Hannes Rapp committed
59
60
61
		{ mode => $mode_gp }
	],
	flags => [
Matthias Braun's avatar
Matthias Braun committed
62
		{ name => "y", realname => "y", type => $ignore },  # the multiply/divide state register
Hannes Rapp's avatar
Hannes Rapp committed
63
64
65
66
		{ mode => $mode_flags, flags => "manual_ra" }
	],
	# fp registers can be accessed any time
	fp  => [
Matthias Braun's avatar
Matthias Braun committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
		{ name => "f0",  type => $caller_save },
		{ name => "f1",  type => $caller_save },
		{ name => "f2",  type => $caller_save },
		{ name => "f3",  type => $caller_save },
		{ name => "f4",  type => $caller_save },
		{ name => "f5",  type => $caller_save },
		{ name => "f6",  type => $caller_save },
		{ name => "f7",  type => $caller_save },
		{ name => "f8",  type => $caller_save },
		{ name => "f9",  type => $caller_save },
		{ name => "f10", type => $caller_save },
		{ name => "f11", type => $caller_save },
		{ name => "f12", type => $caller_save },
		{ name => "f13", type => $caller_save },
		{ name => "f14", type => $caller_save },
		{ name => "f15", type => $caller_save },
		{ name => "f16", type => $caller_save },
		{ name => "f17", type => $caller_save },
		{ name => "f18", type => $caller_save },
		{ name => "f19", type => $caller_save },
		{ name => "f20", type => $caller_save },
		{ name => "f21", type => $caller_save },
		{ name => "f22", type => $caller_save },
		{ name => "f23", type => $caller_save },
		{ name => "f24", type => $caller_save },
		{ name => "f25", type => $caller_save },
		{ name => "f26", type => $caller_save },
		{ name => "f27", type => $caller_save },
		{ name => "f28", type => $caller_save },
		{ name => "f29", type => $caller_save },
		{ name => "f30", type => $caller_save },
		{ name => "f31", type => $caller_save },
Hannes Rapp's avatar
Hannes Rapp committed
99
100
101
102
103
104
		{ mode => $mode_fp }
	]
); # %reg_classes

%emit_templates = (
# emit source reg or imm dep. on node's arity
105
106
107
108
	RI => "${arch}_emit_reg_or_imm(node, -1);",
	R1I => "${arch}_emit_reg_or_imm(node, 0);",
	R2I => "${arch}_emit_reg_or_imm(node, 1);",
	R3I => "${arch}_emit_reg_or_imm(node, 2);",
Hannes Rapp's avatar
Hannes Rapp committed
109
# simple reg emitters
110
111
112
113
114
115
116
117
118
119
120
121
	S1 => "${arch}_emit_source_register(node, 0);",
	S2 => "${arch}_emit_source_register(node, 1);",
	S3 => "${arch}_emit_source_register(node, 2);",
	S4 => "${arch}_emit_source_register(node, 3);",
	S5 => "${arch}_emit_source_register(node, 4);",
	S6 => "${arch}_emit_source_register(node, 5);",
	D1 => "${arch}_emit_dest_register(node, 0);",
	D2 => "${arch}_emit_dest_register(node, 1);",
	D3 => "${arch}_emit_dest_register(node, 2);",
	D4 => "${arch}_emit_dest_register(node, 3);",
	D5 => "${arch}_emit_dest_register(node, 4);",
	D6 => "${arch}_emit_dest_register(node, 5);",
Hannes Rapp's avatar
Hannes Rapp committed
122
123
124
125
# more custom emitters
	C  => "${arch}_emit_immediate(node);",
	LM  => "${arch}_emit_load_mode(node);",
	SM  => "${arch}_emit_store_mode(node);",
Hannes Rapp's avatar
Hannes Rapp committed
126
127
128
129
	EXTPREF  => "${arch}_emit_mode_sign_prefix(node);",
	FPM  => "${arch}_emit_fp_mode_suffix(node);",
	FPLM  => "${arch}_emit_fp_load_mode(node);",
	FPSM  => "${arch}_emit_fp_store_mode(node);",
Hannes Rapp's avatar
Hannes Rapp committed
130
131
132
133
134
135
136
137
	O  => "${arch}_emit_offset(node);",
);

$default_attr_type = "sparc_attr_t";
$default_copy_attr = "sparc_copy_attr";


%init_attr = (
Matthias Braun's avatar
Matthias Braun committed
138
139
140
141
142
143
144
145
	sparc_attr_t             => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
	sparc_load_store_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
	                            "\tinit_sparc_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);",
	sparc_symconst_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);\n".
	                            "\tinit_sparc_symconst_attributes(res, entity);",
	sparc_jmp_cond_attr_t    => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
	sparc_jmp_switch_attr_t  => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
	sparc_save_attr_t        => "\tinit_sparc_attributes(res, flags, in_reqs, exec_units, n_res);",
Hannes Rapp's avatar
Hannes Rapp committed
146
147
148
149

);

%compare_attr = (
Matthias Braun's avatar
Matthias Braun committed
150
151
152
153
154
155
	sparc_attr_t            => "cmp_attr_sparc",
	sparc_load_store_attr_t => "cmp_attr_sparc_load_store",
	sparc_symconst_attr_t   => "cmp_attr_sparc_symconst",
	sparc_jmp_cond_attr_t   => "cmp_attr_sparc_jmp_cond",
	sparc_jmp_switch_attr_t	=> "cmp_attr_sparc_jmp_switch",
	sparc_save_attr_t       => "cmp_attr_sparc_save",
Hannes Rapp's avatar
Hannes Rapp committed
156
157
158
159
160
161
);

# addressing modes: imm, reg, reg +/- imm, reg + reg
# max. imm = 13 bits signed (-4096 ... 4096)

my %cmp_operand_constructors = (
162
	imm => {
163
164
		attr       => "int immediate_value",
		custominit => "sparc_set_attr_imm(res, immediate_value);",
165
		reg_req    => { in => [ "gp" ], out => [ "flags" ] },
166
		ins        => [ "left" ],
167
168
169
170
171
	},
	reg => {
		reg_req    => { in => [ "gp", "gp" ], out => [ "flags" ] },
		ins        => [ "left", "right" ],
	},
Hannes Rapp's avatar
Hannes Rapp committed
172
173
174
);

my %unop_operand_constructors = (
175
176
177
178
179
180
181
182
	imm => {
		attr       => "int immediate_value",
		custominit => "sparc_set_attr_imm(res, immediate_value);",
		reg_req    => { in => [], out => [ "gp" ] },
	},
	reg => {
		reg_req    => { in => [ "gp" ], out => [ "gp" ] },
	},
Hannes Rapp's avatar
Hannes Rapp committed
183
184
185
);

my %binop_operand_constructors = (
186
187
188
189
190
191
192
193
194
195
	imm => {
		attr       => "int immediate_value",
		custominit => "sparc_set_attr_imm(res, immediate_value);",
		reg_req    => { in => [ "gp" ], out => [ "gp" ] },
		ins        => [ "left" ],
	},
	reg => {
		reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
		ins        => [ "left", "right" ],
	},
Hannes Rapp's avatar
Hannes Rapp committed
196
197
198
199
200
);

%nodes = (

Add => {
Matthias Braun's avatar
Matthias Braun committed
201
202
203
204
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	emit      => '. add %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
205
206
207
},

Sub => {
Matthias Braun's avatar
Matthias Braun committed
208
209
210
211
212
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. sub %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
213
214
215
216
},


# Load / Store
217
Ld => {
Matthias Braun's avatar
Matthias Braun committed
218
219
220
221
222
223
224
225
	op_flags  => [ "labeled", "fragile" ],
	state     => "exc_pinned",
	ins       => [ "ptr", "mem" ],
	outs      => [ "res", "M" ],
	reg_req   => { in => [ "gp", "none" ], out => [ "gp", "none" ] },
	attr_type => "sparc_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
	emit      => '. ld%LM [%S1%O], %D1'
Hannes Rapp's avatar
Hannes Rapp committed
226
227
},

228
HiImm => {
Matthias Braun's avatar
Matthias Braun committed
229
230
231
232
233
234
235
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
	outs      => [ "res" ],
	mode      => $mode_gp,
	reg_req   => { in => [], out => [ "gp" ] },
	attr       => "int immediate_value",
	custominit => "sparc_set_attr_imm(res, immediate_value);",
236
237
238
},

LoImm => {
Matthias Braun's avatar
Matthias Braun committed
239
240
241
242
243
244
245
246
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
	ins       => [ "hireg" ],
	outs      => [ "res" ],
	mode      => $mode_gp,
	reg_req   => { in => [ "gp" ], out => [ "gp" ] },
	attr       => "int immediate_value",
	custominit => "sparc_set_attr_imm(res, immediate_value);",
Hannes Rapp's avatar
Hannes Rapp committed
247
248
},

249
St => {
Matthias Braun's avatar
Matthias Braun committed
250
251
252
253
254
255
256
257
258
	op_flags  => [ "labeled", "fragile" ],
	mode 		=> "mode_M",
	state     => "exc_pinned",
	ins       => [ "ptr", "val", "mem" ],
	outs      => [ "mem" ],
	reg_req   => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
	attr_type => "sparc_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
	emit      => '. st%SM %S2, [%S1%O]'
Hannes Rapp's avatar
Hannes Rapp committed
259
260
261
},

Mov => {
Matthias Braun's avatar
Matthias Braun committed
262
263
264
265
266
	irn_flags => [ "rematerializable" ],
	arity     => "variable",
	emit      => '. mov %R1I, %D1',
	mode      => $mode_gp,
	constructors => \%unop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
267
268
},

269
270
Save => {
	reg_req   => {
Matthias Braun's avatar
Matthias Braun committed
271
272
		in => [ "sp", "none"],
		out => [ "sp:I|S","none" ]
273
274
275
276
277
	},
	ins       => [ "stack", "mem" ],
	outs      => [ "stack", "mem" ],
	attr      => "int initial_stacksize",
	attr_type => "sparc_save_attr_t",
Matthias Braun's avatar
Matthias Braun committed
278
	init_attr => "\tinit_sparc_save_attr(res, initial_stacksize);",
279
280
},

281
SubSP => {
Hannes Rapp's avatar
Hannes Rapp committed
282
283
284
285
286
287
	reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "gp", "none" ] },
	ins       => [ "stack", "size", "mem" ],
	outs      => [ "stack", "addr", "M" ],
	emit      => ". sub %S1, %S2, %D1\n",
},

288
AddSP => {
Hannes Rapp's avatar
Hannes Rapp committed
289
290
291
292
293
294
295
	reg_req   => { in => [ "sp", "gp", "none" ], out => [ "sp:I|S", "none" ] },
	ins       => [ "stack", "size", "mem" ],
	outs      => [ "stack", "M" ],
	emit      => ". add %S1, %S2, %D1\n",
},

SymConst => {
296
297
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
Hannes Rapp's avatar
Hannes Rapp committed
298
299
300
301
302
303
304
	attr      => "ir_entity *entity",
	reg_req   => { out => [ "gp" ] },
	attr_type => "sparc_symconst_attr_t",
	mode      => $mode_gp,
},

FrameAddr => {
305
306
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
Hannes Rapp's avatar
Hannes Rapp committed
307
308
309
310
311
312
313
	attr      => "ir_entity *entity",
	reg_req   => { in => [ "gp" ], out => [ "gp" ] },
	ins       => [ "base" ],
	attr_type => "sparc_symconst_attr_t",
	mode      => $mode_gp,
},

314
BXX => {
315
	op_flags  => [ "labeled", "cfopcode", "forking" ],
Hannes Rapp's avatar
Hannes Rapp committed
316
317
318
	state     => "pinned",
	mode      => "mode_T",
	reg_req   => { in => [ "flags" ], out => [ "none", "none" ] },
319
	attr      => "int proj_num, bool is_unsigned",
Hannes Rapp's avatar
Hannes Rapp committed
320
	attr_type => "sparc_jmp_cond_attr_t",
321
	init_attr => "\tinit_sparc_jmp_cond_attr(res, proj_num, is_unsigned);",
Hannes Rapp's avatar
Hannes Rapp committed
322
323
},

324
Ba => {
Hannes Rapp's avatar
Hannes Rapp committed
325
	state     => "pinned",
326
327
	op_flags  => [ "cfopcode" ],
	irn_flags => [ "simple_jump" ],
Hannes Rapp's avatar
Hannes Rapp committed
328
329
330
331
	reg_req   => { out => [ "none" ] },
	mode      => "mode_X",
},

Hannes Rapp's avatar
Hannes Rapp committed
332
Cmp => {
333
	irn_flags    => [ "rematerializable", "modify_flags" ],
Hannes Rapp's avatar
Hannes Rapp committed
334
335
336
337
338
339
	emit         => '. cmp %S1, %R2I',
	mode         => $mode_flags,
	constructors => \%cmp_operand_constructors,
},

Tst => {
340
	irn_flags    => [ "rematerializable", "modify_flags" ],
Hannes Rapp's avatar
Hannes Rapp committed
341
342
343
	emit         => '. tst %S1',
	mode         => $mode_flags,
	reg_req      => { in => [ "gp" ], out => [ "flags" ] },
344
	ins          => [ "val" ],
Hannes Rapp's avatar
Hannes Rapp committed
345
346
347
},

SwitchJmp => {
348
	op_flags  => [ "labeled", "cfopcode", "forking" ],
Hannes Rapp's avatar
Hannes Rapp committed
349
350
351
352
353
354
355
356
	state     => "pinned",
	mode      => "mode_T",
	attr      => "int n_projs, long def_proj_num",
	init_attr => "\tset_sparc_jmp_switch_n_projs(res, n_projs);\n".
					"\tset_sparc_jmp_switch_default_proj_num(res, def_proj_num);",
	reg_req   => { in => [ "gp" ], out => [ "none" ] },
	attr_type => "sparc_jmp_switch_attr_t",
},
Hannes Rapp's avatar
Hannes Rapp committed
357

358
Sll => {
Matthias Braun's avatar
Matthias Braun committed
359
360
361
362
363
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. sll %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
364
365
},

366
Slr => {
Matthias Braun's avatar
Matthias Braun committed
367
368
369
370
371
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. srl %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
372
373
},

374
Sra => {
Matthias Braun's avatar
Matthias Braun committed
375
376
377
378
379
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. sra %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
380
381
382
},

And => {
Matthias Braun's avatar
Matthias Braun committed
383
384
385
386
387
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. and %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
388
389
390
},

Or => {
Matthias Braun's avatar
Matthias Braun committed
391
392
393
394
395
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. or %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
396
397
},

398
Xor => {
Matthias Braun's avatar
Matthias Braun committed
399
400
401
402
403
	irn_flags => [ "rematerializable" ],
	mode		=> $mode_gp,
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	emit      => '. xor %S1, %R2I, %D1',
	constructors => \%binop_operand_constructors,
404
405
},

Hannes Rapp's avatar
Hannes Rapp committed
406
Mul => {
Matthias Braun's avatar
Matthias Braun committed
407
408
409
410
411
	state     => "exc_pinned",
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "flags" ] },
	outs      => [ "low", "high" ],
	constructors => \%binop_operand_constructors,
	#emit      =>'. mul %S1, %R2I, %D1'
412
413
},

Hannes Rapp's avatar
Hannes Rapp committed
414
Mulh => {
Matthias Braun's avatar
Matthias Braun committed
415
416
417
418
	state     => "exc_pinned",
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "gp" ] },
	outs      => [ "low", "high" ],
	constructors => \%binop_operand_constructors,
Hannes Rapp's avatar
Hannes Rapp committed
419
420
421
},

Div => {
Matthias Braun's avatar
Matthias Braun committed
422
423
424
425
426
427
428
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp" ] },
	outs      => [ "res" ],
	constructors => \%binop_operand_constructors,
	#mode      => $mode_gp,
	#emit      =>'. div %S1, %R2I, %D1'
429
430
},

431
Minus => {
Matthias Braun's avatar
Matthias Braun committed
432
433
434
435
	irn_flags => [ "rematerializable" ],
	mode	    => $mode_gp,
	reg_req   => { in => [ "gp" ], out => [ "gp" ] },
	emit      => ". sub %%g0, %S1, %D1"
436
437
438
},

Not => {
Matthias Braun's avatar
Matthias Braun committed
439
440
441
442
	irn_flags   => [ "rematerializable" ],
	mode	      => $mode_gp,
	reg_req     => { in => [ "gp" ], out => [ "gp" ] },
	emit        => '. xnor %S1, %%g0, %D1'
443
},
Hannes Rapp's avatar
Hannes Rapp committed
444

Hannes Rapp's avatar
Hannes Rapp committed
445
Nop => {
446
	op_flags => [ "keep" ],
Hannes Rapp's avatar
Hannes Rapp committed
447
448
449
450
451
	reg_req	 => { in => [], out => [ "none" ] },
	emit     => '. nop',
},

fAdd => {
Matthias Braun's avatar
Matthias Braun committed
452
453
454
455
	op_flags  => [ "commutative" ],
	irn_flags => [ "rematerializable" ],
	reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
	emit      => '. fadd%FPM %S1, %S2, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
456
457
458
},

fMul => {
Matthias Braun's avatar
Matthias Braun committed
459
460
461
	op_flags  => [ "commutative" ],
	reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
	emit      =>'. fmul%FPM %S1, %S2, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
462
463
464
},

fsMuld => {
Matthias Braun's avatar
Matthias Braun committed
465
466
467
	op_flags  => [ "commutative" ],
	reg_req   => { in => [ "fp", "fp" ], out => [ "fp" ] },
	emit      =>'. fsmuld %S1, %S2, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
468
469
},

470
FsTOd => {
Matthias Braun's avatar
Matthias Braun committed
471
472
473
	irn_flags => [ "rematerializable" ],
	reg_req   => { in => [ "fp" ], out => [ "fp" ] },
	emit      =>'. FsTOd %S1, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
474
475
},

476
FdTOs => {
Matthias Braun's avatar
Matthias Braun committed
477
478
479
	irn_flags => [ "rematerializable" ],
	reg_req   => { in => [ "fp" ], out => [ "fp" ] },
	emit      =>'. FdTOs %S1, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
480
481
},

482
FiTOs => {
Matthias Braun's avatar
Matthias Braun committed
483
	irn_flags => [ "rematerializable" ],
484
	reg_req   => { in => [ "gp" ], out => [ "fp" ] },
Matthias Braun's avatar
Matthias Braun committed
485
	emit      =>'. FiTOs %S1, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
486
487
},

488
FiTOd => {
Matthias Braun's avatar
Matthias Braun committed
489
	irn_flags => [ "rematerializable" ],
490
	reg_req   => { in => [ "gp" ], out => [ "fp" ] },
Matthias Braun's avatar
Matthias Braun committed
491
	emit      =>'. FiTOd %S1, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
492
493
},

494
FsTOi => {
Matthias Braun's avatar
Matthias Braun committed
495
	irn_flags => [ "rematerializable" ],
496
	reg_req   => { in => [ "fp" ], out => [ "gp" ] },
Matthias Braun's avatar
Matthias Braun committed
497
	emit      =>'. FsTOi %S1, %D1'
Hannes Rapp's avatar
Hannes Rapp committed
498
499
},

500
FdTOi => {
Matthias Braun's avatar
Matthias Braun committed
501
	irn_flags => [ "rematerializable" ],
502
	reg_req   => { in => [ "fp" ], out => [ "gp" ] },
Matthias Braun's avatar
Matthias Braun committed
503
504
	emit      =>'. FdTOi %S1, %D1'
},
Hannes Rapp's avatar
Hannes Rapp committed
505

506
507
508
509
510
511
512
513
514
515
516
Ldf => {
	op_flags  => [ "labeled", "fragile" ],
	state     => "exc_pinned",
	ins       => [ "ptr", "mem" ],
	outs      => [ "res", "M" ],
	reg_req   => { in => [ "gp", "none" ], out => [ "fp", "none" ] },
	attr_type => "sparc_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
	emit      => '. ld [%S1%O], %D1'
},

Hannes Rapp's avatar
Hannes Rapp committed
517
); # end of %nodes