arm_spec.pl 17.5 KB
Newer Older
1
2
# Arm Architecure Specification
# Author: Matthias Braun, Michael Beck, Oliver Richter, Tobias Gneist
3
4
5

$arch = "arm";

Michael Beck's avatar
Michael Beck committed
6
7
8
#
# Modes
#
9
10
$mode_gp    = "mode_Iu";
$mode_flags = "mode_Bu";
11
$mode_fp    = "mode_F";
Michael Beck's avatar
Michael Beck committed
12

13
14
# NOTE: Last entry of each class is the largest Firm-Mode a register can hold
%reg_classes = (
Michael Beck's avatar
Michael Beck committed
15
	gp => [
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
		{ name => "r0",  dwarf => 0 },
		{ name => "r1",  dwarf => 1 },
		{ name => "r2",  dwarf => 2 },
		{ name => "r3",  dwarf => 3 },
		{ name => "r4",  dwarf => 4 },
		{ name => "r5",  dwarf => 5 },
		{ name => "r6",  dwarf => 6 },
		{ name => "r7",  dwarf => 7 },
		{ name => "r8",  dwarf => 8 },
		{ name => "r9",  dwarf => 9 },
		{ name => "r10", dwarf => 10 },
		{ name => "r11", dwarf => 11 },
		{ name => "r12", dwarf => 12 },
		{ name => "sp",  dwarf => 13 },
		{ name => "lr",  dwarf => 14 },
		{ name => "pc",  dwarf => 15 },
32
		{ mode => $mode_gp }
Michael Beck's avatar
Michael Beck committed
33
	],
34
	fpa => [
35
36
37
38
39
40
41
42
		{ name => "f0", dwarf => 96 },
		{ name => "f1", dwarf => 97 },
		{ name => "f2", dwarf => 98 },
		{ name => "f3", dwarf => 99 },
		{ name => "f4", dwarf => 100 },
		{ name => "f5", dwarf => 101 },
		{ name => "f6", dwarf => 102 },
		{ name => "f7", dwarf => 103 },
43
		{ mode => $mode_fp }
44
45
	],
	flags => [
46
		{ name => "fl" },
47
48
		{ mode => $mode_flags, flags => "manual_ra" }
	],
49
);
50

Michael Beck's avatar
Michael Beck committed
51
%emit_templates = (
52
53
	FM  => "${arch}_emit_float_load_store_mode(node);",
	AM  => "${arch}_emit_float_arithmetic_mode(node);",
54
55
56
57
	LM  => "${arch}_emit_load_mode(node);",
	SM  => "${arch}_emit_store_mode(node);",
	SO  => "${arch}_emit_shifter_operand(node);",
	S0  => "${arch}_emit_source_register(node, 0);",
58
	SC  => "${arch}_emit_symconst(node);",
59
60
61
62
63
64
65
66
	S1  => "${arch}_emit_source_register(node, 1);",
	S2  => "${arch}_emit_source_register(node, 2);",
	S3  => "${arch}_emit_source_register(node, 3);",
	S4  => "${arch}_emit_source_register(node, 4);",
	D0  => "${arch}_emit_dest_register(node, 0);",
	D1  => "${arch}_emit_dest_register(node, 1);",
	D2  => "${arch}_emit_dest_register(node, 2);",
	O   => "${arch}_emit_offset(node);",
Michael Beck's avatar
Michael Beck committed
67
68
);

Michael Beck's avatar
Michael Beck committed
69
$default_attr_type = "arm_attr_t";
Matthias Braun's avatar
fix    
Matthias Braun committed
70
$default_copy_attr = "arm_copy_attr";
Michael Beck's avatar
Michael Beck committed
71
72

%init_attr = (
73
	arm_attr_t           => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);",
74
	arm_SymConst_attr_t  =>
75
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n".
76
		"\tinit_arm_SymConst_attributes(res, entity, symconst_offset);",
77
78
79
	arm_CondJmp_attr_t   => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);",
	arm_SwitchJmp_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);",
	arm_fConst_attr_t    => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);",
80
	arm_load_store_attr_t =>
81
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n".
82
83
		"\tinit_arm_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);",
	arm_shifter_operand_t =>
84
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n",
85
	arm_cmp_attr_t =>
86
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n",
87
	arm_farith_attr_t =>
88
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n".
89
		"\tinit_arm_farith_attributes(res, op_mode);",
90
	arm_CopyB_attr_t =>
91
		"\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n".
92
		"\tinit_arm_CopyB_attributes(res, size);",
Michael Beck's avatar
Michael Beck committed
93
94
95
);

%compare_attr = (
96
97
98
99
	arm_attr_t            => "cmp_attr_arm",
	arm_SymConst_attr_t   => "cmp_attr_arm_SymConst",
	arm_CondJmp_attr_t    => "cmp_attr_arm_CondJmp",
	arm_SwitchJmp_attr_t  => "cmp_attr_arm_SwitchJmp",
100
	arm_fConst_attr_t     => "cmp_attr_arm_fConst",
101
	arm_load_store_attr_t => "cmp_attr_arm_load_store",
102
103
104
	arm_shifter_operand_t => "cmp_attr_arm_shifter_operand",
	arm_CopyB_attr_t      => "cmp_attr_arm_CopyB",
	arm_cmp_attr_t        => "cmp_attr_arm_cmp",
105
	arm_farith_attr_t     => "cmp_attr_arm_farith",
Michael Beck's avatar
Michael Beck committed
106
);
107

108
109
110
111
112
113
114
115
116
117
118
my %unop_shifter_operand_constructors = (
	imm => {
		attr       => "unsigned char immediate_value, unsigned char immediate_rot",
		custominit => "init_arm_shifter_operand(res, immediate_value, ARM_SHF_IMM, immediate_rot);",
		reg_req    => { in => [], out => [ "gp" ] },
	},
	reg => {
		custominit => "init_arm_shifter_operand(res, 0, ARM_SHF_REG, 0);",
		reg_req    => { in => [ "gp" ], out => [ "gp" ] },
	},
	reg_shift_reg => {
119
		attr       => "arm_shift_modifier_t shift_modifier",
120
121
122
123
		custominit => "init_arm_shifter_operand(res, 0, shift_modifier, 0);",
		reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
	},
	reg_shift_imm => {
124
		attr       => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
125
126
127
128
		custominit => "init_arm_shifter_operand(res, 0, shift_modifier, shift_immediate);",
		reg_req    => { in => [ "gp" ], out => [ "gp" ] },
	},
);
129

130
131
132
133
134
135
136
137
138
139
140
141
142
my %binop_shifter_operand_constructors = (
	imm => {
		attr       => "unsigned char immediate_value, unsigned char immediate_rot",
		custominit => "init_arm_shifter_operand(res, immediate_value, ARM_SHF_IMM, immediate_rot);",
		reg_req    => { in => [ "gp" ], out => [ "gp" ] },
		ins        => [ "left" ],
	},
	reg => {
		custominit => "init_arm_shifter_operand(res, 0, ARM_SHF_REG, 0);",
		reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
		ins        => [ "left", "right" ],
	},
	reg_shift_reg => {
143
		attr       => "arm_shift_modifier_t shift_modifier",
144
145
146
147
148
		custominit => "init_arm_shifter_operand(res, 0, shift_modifier, 0);",
		reg_req    => { in => [ "gp", "gp", "gp" ], out => [ "gp" ] },
		ins        => [ "left", "right", "shift" ],
	},
	reg_shift_imm => {
149
		attr       => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
150
151
152
153
154
		custominit => "init_arm_shifter_operand(res, 0, shift_modifier, shift_immediate);",
		reg_req    => { in => [ "gp", "gp" ], out => [ "gp" ] },
		ins        => [ "left", "right" ],
	},
);
Michael Beck's avatar
Michael Beck committed
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
my %cmp_shifter_operand_constructors = (
	imm => {
		attr       => "unsigned char immediate_value, unsigned char immediate_rot, bool ins_permuted, bool is_unsigned",
		custominit =>
			"init_arm_shifter_operand(res, immediate_value, ARM_SHF_IMM, immediate_rot);\n".
			"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
		reg_req    => { in => [ "gp" ], out => [ "flags" ] },
		ins        => [ "left" ],
	},
	reg => {
		attr       => "bool ins_permuted, bool is_unsigned",
		custominit =>
			"init_arm_shifter_operand(res, 0, ARM_SHF_REG, 0);\n".
			"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
		reg_req    => { in => [ "gp", "gp" ], out => [ "flags" ] },
		ins        => [ "left", "right" ],
	},
	reg_shift_reg => {
174
		attr       => "arm_shift_modifier_t shift_modifier, bool ins_permuted, bool is_unsigned",
175
176
177
178
179
180
181
		custominit =>
			"init_arm_shifter_operand(res, 0, shift_modifier, 0);\n".
			"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
		reg_req    => { in => [ "gp", "gp", "gp" ], out => [ "flags" ] },
		ins        => [ "left", "right", "shift" ],
	},
	reg_shift_imm => {
182
		attr       => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate, bool ins_permuted, bool is_unsigned",
183
184
185
186
187
188
189
		custominit =>
			"init_arm_shifter_operand(res, 0, shift_modifier, shift_immediate);\n".
			"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
		reg_req    => { in => [ "gp", "gp" ], out => [ "flags" ] },
		ins        => [ "left", "right" ],
	},
);
Michael Beck's avatar
Michael Beck committed
190

191

192
%nodes = (
193

Michael Beck's avatar
Michael Beck committed
194
Add => {
195
	irn_flags => [ "rematerializable" ],
196
197
198
199
	emit      => '. add %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
200
201
202
},

Mul => {
203
	irn_flags => [ "rematerializable" ],
204
205
206
	reg_req   => { in => [ "gp", "gp" ], out => [ "!in_r1" ] },
	emit      =>'. mul %D0, %S0, %S1',
	mode      => $mode_gp,
Michael Beck's avatar
Michael Beck committed
207
208
209
},

Smull => {
210
	irn_flags => [ "rematerializable" ],
211
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "gp" ] },
Michael Beck's avatar
Michael Beck committed
212
213
	emit      =>'. smull %D0, %D1, %S0, %S1',
	outs      => [ "low", "high" ],
Michael Beck's avatar
Michael Beck committed
214
215
216
},

Umull => {
217
	irn_flags => [ "rematerializable" ],
218
	reg_req   => { in => [ "gp", "gp" ], out => [ "gp", "gp" ] },
Michael Beck's avatar
Michael Beck committed
219
220
	emit      =>'. umull %D0, %D1, %S0, %S1',
	outs      => [ "low", "high" ],
221
	mode      => $mode_gp,
Michael Beck's avatar
Michael Beck committed
222
223
224
},

Mla => {
225
	irn_flags => [ "rematerializable" ],
226
227
228
	reg_req   => { in => [ "gp", "gp", "gp" ], out => [ "!in_r1" ] },
	emit      =>'. mla %D0, %S0, %S1, %S2',
	mode      => $mode_gp,
Michael Beck's avatar
Michael Beck committed
229
230
231
},

And => {
232
	irn_flags => [ "rematerializable" ],
233
234
235
236
	emit      => '. and %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
237
238
239
},

Or => {
240
	irn_flags => [ "rematerializable" ],
241
242
243
244
	emit      => '. orr %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
245
246
247
},

Eor => {
248
	irn_flags => [ "rematerializable" ],
249
250
251
252
	emit      => '. eor %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
253
254
},

Michael Beck's avatar
Michael Beck committed
255
Bic => {
256
	irn_flags => [ "rematerializable" ],
257
258
259
260
	emit      => '. bic %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
261
262
263
},

Sub => {
264
	irn_flags => [ "rematerializable" ],
265
266
267
268
	emit      => '. sub %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
269
270
271
},

Rsb => {
272
	irn_flags => [ "rematerializable" ],
273
274
275
276
	emit      => '. rsb %D0, %S0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%binop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
277
},
278

Michael Beck's avatar
Michael Beck committed
279
Mov => {
280
	irn_flags => [ "rematerializable" ],
281
282
283
284
285
	arity     => "variable",
	emit      => '. mov %D0, %SO',
	mode      => $mode_gp,
	attr_type => "arm_shifter_operand_t",
	constructors => \%unop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
286
287
288
},

Mvn => {
289
	irn_flags => [ "rematerializable" ],
290
291
292
293
294
	attr_type => "arm_shifter_operand_t",
	arity     => "variable",
	emit      => '. mvn %D0, %SO',
	mode      => $mode_gp,
	constructors => \%unop_shifter_operand_constructors,
Michael Beck's avatar
Michael Beck committed
295
296
},

297
298
299
300
301
302
303
Clz => {
	irn_flags => [ "rematerializable" ],
	reg_req   => { in => [ "gp" ], out => [ "gp" ] },
	emit      =>'. clz %D0, %S0',
	mode      => $mode_gp,
},

304
305
306
307
308
309
310
311
312
# mov lr, pc\n mov pc, XXX -- This combination is used for calls to function
# pointers
LinkMovPC => {
	state        => "exc_pinned",
	arity        => "variable",
	out_arity    => "variable",
	attr_type    => "arm_shifter_operand_t",
	attr         => "arm_shift_modifier_t shift_modifier, unsigned char immediate_value, unsigned char immediate_rot",
	custominit   => "init_arm_shifter_operand(res, immediate_value, shift_modifier, immediate_rot);\n".
313
	                "\tarch_add_irn_flags(res, arch_irn_flags_modify_flags);",
314
315
316
317
318
319
320
321
322
323
324
325
	emit         => ". mov lr, pc\n".
	                ". mov pc, %SO",
},

# mov lr, pc\n ldr pc, XXX -- This combination is used for calls to function
# pointers
LinkLdrPC => {
	state        => "exc_pinned",
	arity        => "variable",
	out_arity    => "variable",
	attr_type    => "arm_load_store_attr_t",
	attr         => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
326
	custominit   => "arch_add_irn_flags(res, arch_irn_flags_modify_flags);",
327
328
329
330
331
332
333
334
335
336
	emit         => ". mov lr, pc\n".
	                ". ldr pc, %SO",
},

Bl => {
	state      => "exc_pinned",
	arity      => "variable",
	out_arity  => "variable",
	attr_type  => "arm_SymConst_attr_t",
	attr       => "ir_entity *entity, int symconst_offset",
337
	custominit => "arch_add_irn_flags(res, arch_irn_flags_modify_flags);",
338
339
340
	emit       => '. bl %SC',
},

341
# this node produces ALWAYS an empty (tempary) gp reg and cannot be CSE'd
Michael Beck's avatar
Michael Beck committed
342
EmptyReg => {
343
344
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
345
	reg_req   => { out => [ "gp" ] },
Michael Beck's avatar
Michael Beck committed
346
	emit      => '. /* %D0 now available for calculations */',
347
348
	cmp_attr  => 'return 1;',
	mode      => $mode_gp,
349
350
},

Michael Beck's avatar
Michael Beck committed
351
CopyB => {
Michael Beck's avatar
Michael Beck committed
352
	state     => "pinned",
353
354
355
	attr      => "unsigned size",
	attr_type => "arm_CopyB_attr_t",
	reg_req   => { in => [ "!sp", "!sp", "gp", "gp", "gp", "none" ], out => [ "none" ] },
Michael Beck's avatar
Michael Beck committed
356
	outs      => [ "M" ],
357
358
},

359
FrameAddr => {
360
361
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
362
	attr      => "ir_entity *entity, int symconst_offset",
363
364
365
366
367
368
	reg_req   => { in => [ "gp" ], out => [ "gp" ] },
	ins       => [ "base" ],
	attr_type => "arm_SymConst_attr_t",
	mode      => $mode_gp,
},

Michael Beck's avatar
Michael Beck committed
369
SymConst => {
370
371
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
372
	attr      => "ir_entity *entity, int symconst_offset",
373
374
375
	reg_req   => { out => [ "gp" ] },
	attr_type => "arm_SymConst_attr_t",
	mode      => $mode_gp,
376
377
},

378
Cmp => {
379
	irn_flags    => [ "rematerializable", "modify_flags" ],
380
381
382
383
	emit         => '. cmp %S0, %SO',
	mode         => $mode_flags,
	attr_type    => "arm_cmp_attr_t",
	constructors => \%cmp_shifter_operand_constructors,
384
385
},

386
Tst => {
387
	irn_flags    => [ "rematerializable", "modify_flags" ],
388
389
390
391
392
393
394
	emit         => '. tst %S0, %SO',
	mode         => $mode_flags,
	attr_type    => "arm_cmp_attr_t",
	constructors => \%cmp_shifter_operand_constructors,
},

B => {
395
	op_flags  => [ "cfopcode", "forking" ],
396
397
	state     => "pinned",
	mode      => "mode_T",
398
	reg_req   => { in => [ "flags" ], out => [ "none", "none" ] },
399
	attr      => "ir_relation relation",
Michael Beck's avatar
Michael Beck committed
400
	attr_type => "arm_CondJmp_attr_t",
401
	init_attr => "\tset_arm_CondJmp_relation(res, relation);",
402
403
},

404
405
Jmp => {
	state     => "pinned",
406
407
	op_flags  => [ "cfopcode" ],
	irn_flags => [ "simple_jump" ],
408
409
410
411
	reg_req   => { out => [ "none" ] },
	mode      => "mode_X",
},

Michael Beck's avatar
Michael Beck committed
412
SwitchJmp => {
413
	op_flags  => [ "cfopcode", "forking" ],
Michael Beck's avatar
Michael Beck committed
414
415
	state     => "pinned",
	mode      => "mode_T",
Matthias Braun's avatar
Matthias Braun committed
416
417
	attr      => "const ir_switch_table *table",
	init_attr => "init_arm_SwitchJmp_attributes(res, table);",
418
	reg_req   => { in => [ "gp" ], out => [ "none" ] },
Matthias Braun's avatar
Matthias Braun committed
419
	out_arity => "variable",
Michael Beck's avatar
Michael Beck committed
420
	attr_type => "arm_SwitchJmp_attr_t",
421
422
},

423
Ldr => {
424
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
425
	state     => "exc_pinned",
426
427
	ins       => [ "ptr", "mem" ],
	outs      => [ "res", "M" ],
428
429
	reg_req   => { in => [ "gp", "none" ], out => [ "gp", "none" ] },
	emit      => '. ldr%LM %D0, [%S0, #%O]',
430
	attr_type => "arm_load_store_attr_t",
431
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
432
433
},

434
Str => {
435
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
436
	state     => "exc_pinned",
437
	ins       => [ "ptr", "val", "mem" ],
438
	outs      => [ "M" ],
439
440
	reg_req   => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
	emit      => '. str%SM %S1, [%S0, #%O]',
Michael Beck's avatar
Michael Beck committed
441
	mode      => "mode_M",
442
	attr_type => "arm_load_store_attr_t",
443
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
444
445
446
},

StoreStackM4Inc => {
447
	op_flags  => [ "uses_memory" ],
448
	irn_flags => [ "rematerializable" ],
Michael Beck's avatar
Michael Beck committed
449
	state     => "exc_pinned",
450
	reg_req   => { in => [ "sp", "gp", "gp", "gp", "gp", "none" ], out => [ "sp:I|S", "none" ] },
Michael Beck's avatar
Michael Beck committed
451
452
	emit      => '. stmfd %S0!, {%S1, %S2, %S3, %S4}',
	outs      => [ "ptr", "M" ],
Michael Beck's avatar
Michael Beck committed
453
454
},

455
LoadStackM3Epilogue => {
456
	op_flags  => [ "uses_memory" ],
457
	irn_flags => [ "rematerializable" ],
Michael Beck's avatar
Michael Beck committed
458
	state     => "exc_pinned",
459
	reg_req   => { in => [ "sp", "none" ], out => [ "r11:I", "sp:I|S", "pc:I", "none" ] },
Michael Beck's avatar
Michael Beck committed
460
461
	emit      => '. ldmfd %S0, {%D0, %D1, %D2}',
	outs      => [ "res0", "res1", "res2", "M" ],
462
463
464
465
},



466
Adf => {
467
	irn_flags => [ "rematerializable" ],
468
	reg_req   => { in => [ "fpa", "fpa" ], out => [ "fpa" ] },
469
470
471
472
	emit      => '. adf%AM %D0, %S0, %S1',
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
	mode      => $mode_fp,
473
474
},

475
Muf => {
476
	irn_flags => [ "rematerializable" ],
477
	reg_req   => { in => [ "fpa", "fpa" ], out => [ "fpa" ] },
478
479
480
481
	emit      =>'. muf%AM %D0, %S0, %S1',
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
	mode      => $mode_fp,
Michael Beck's avatar
Michael Beck committed
482
483
},

484
Suf => {
485
	irn_flags => [ "rematerializable" ],
486
	reg_req   => { in => [ "fpa", "fpa" ], out => [ "fpa" ] },
487
488
	emit      => '. suf%AM %D0, %S0, %S1',
	attr_type => "arm_farith_attr_t",
Michael Beck's avatar
Michael Beck committed
489
	attr      => "ir_mode *op_mode",
490
	mode      => $mode_fp,
Michael Beck's avatar
Michael Beck committed
491
492
},

493
Dvf => {
494
	reg_req   => { in => [ "fpa", "fpa" ], out => [ "fpa", "none" ] },
495
	emit      =>'. dvf%AM %D0, %S0, %S1',
496
	outs      => [ "res", "M" ],
497
	attr_type => "arm_farith_attr_t",
Michael Beck's avatar
Michael Beck committed
498
	attr      => "ir_mode *op_mode",
499
	mode      => $mode_fp,
Michael Beck's avatar
Michael Beck committed
500
501
},

502
Mvf => {
503
	irn_flags => [ "rematerializable" ],
504
	reg_req   => { in => [ "fpa" ], out => [ "fpa" ] },
505
506
507
508
	emit      => '. mvf%AM %S0, %D0',
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
	mode      => $mode_fp,
509
510
},

511
FltX => {
512
	irn_flags => [ "rematerializable" ],
513
514
515
516
517
518
519
	reg_req   => { in => [ "gp" ], out => [ "fpa" ] },
	emit      => '. flt%AM %D0, %S0',
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
	mode      => $mode_fp,
},

520
Cmfe => {
521
	irn_flags => [ "rematerializable", "modify_flags" ],
522
523
524
525
526
527
	mode      => $mode_flags,
	attr_type => "arm_cmp_attr_t",
	attr      => "bool ins_permuted",
	init_attr => "init_arm_cmp_attr(res, ins_permuted, false);",
	reg_req   => { in => [ "fpa", "fpa" ], out => [ "flags" ] },
	emit      => '. cmfe %S0, %S1',
528
529
},

530
Ldf => {
531
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
532
	state     => "exc_pinned",
533
	ins       => [ "ptr", "mem" ],
Michael Beck's avatar
Michael Beck committed
534
	outs      => [ "res", "M" ],
535
536
537
538
	reg_req   => { in => [ "gp", "none" ], out => [ "fpa", "none" ] },
	emit      => '. ldf%FM %D0, [%S0, #%O]',
	attr_type => "arm_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
539
540
},

541
Stf => {
542
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
543
	state     => "exc_pinned",
544
545
	ins       => [ "ptr", "val", "mem" ],
	outs      => [ "M" ],
Michael Beck's avatar
Michael Beck committed
546
	mode      => "mode_M",
547
548
549
550
	reg_req   => { in => [ "gp", "fpa", "none" ], out => [ "none" ] },
	emit      => '. stf%FM %S1, [%S0, #%O]',
	attr_type => "arm_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
551
552
},

Michael Beck's avatar
Michael Beck committed
553
554
555
#
# floating point constants
#
556
fConst => {
557
558
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
Matthias Braun's avatar
Matthias Braun committed
559
	attr      => "ir_tarval *tv",
Michael Beck's avatar
Michael Beck committed
560
	init_attr => "attr->tv = tv;",
Michael Beck's avatar
Michael Beck committed
561
	mode      => "get_tarval_mode(tv)",
562
	reg_req   => { out => [ "fpa" ] },
563
	attr_type => "arm_fConst_attr_t",
Michael Beck's avatar
Michael Beck committed
564
}
Michael Beck's avatar
Michael Beck committed
565

566
); # end of %nodes