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

$arch = "arm";

6
7
$mode_gp    = "arm_mode_gp";
$mode_flags = "arm_mode_flags";
8
$mode_fp    = "mode_F";
Michael Beck's avatar
Michael Beck committed
9

10
%reg_classes = (
Michael Beck's avatar
Michael Beck committed
11
	gp => [
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
		{ 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 },
28
		{ mode => $mode_gp }
Michael Beck's avatar
Michael Beck committed
29
	],
30
	fpa => [
31
32
33
34
35
36
37
38
		{ 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 },
39
		{ mode => $mode_fp }
40
41
	],
	flags => [
42
		{ name => "fl" },
43
44
		{ mode => $mode_flags, flags => "manual_ra" }
	],
45
);
46

Michael Beck's avatar
Michael Beck committed
47
%init_attr = (
48
49
50
51
	arm_attr_t =>
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
	arm_Address_attr_t =>
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);\n".
52
		"\tinit_arm_Address_attributes(res, entity, offset);",
53
54
55
56
57
58
	arm_CondJmp_attr_t =>
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
	arm_SwitchJmp_attr_t =>
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
	arm_fConst_attr_t =>
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
59
	arm_load_store_attr_t =>
60
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);\n".
61
62
		"\tinit_arm_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);",
	arm_shifter_operand_t =>
63
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
64
	arm_cmp_attr_t =>
65
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);",
66
	arm_farith_attr_t =>
67
		"init_arm_attributes(res, irn_flags, in_reqs, n_res);\n".
68
		"\tinit_arm_farith_attributes(res, op_mode);",
Michael Beck's avatar
Michael Beck committed
69
70
);

71
72
73
my $unop_shifter_operand = {
	irn_flags    => [ "rematerializable" ],
	attr_type    => "arm_shifter_operand_t",
74
	out_reqs     => [ "gp" ],
75
76
	constructors => {
		imm => {
77
78
79
			attr    => "unsigned char immediate_value, unsigned char immediate_rot",
			init    => "init_arm_shifter_operand(res, 0, immediate_value, ARM_SHF_IMM, immediate_rot);",
			in_reqs => [],
80
81
		},
		reg => {
82
83
84
			init    => "init_arm_shifter_operand(res, 0, 0, ARM_SHF_REG, 0);",
			in_reqs => [ "gp" ],
			ins     => [ "Rm" ],
85
86
		},
		reg_shift_reg => {
87
88
89
90
			attr    => "arm_shift_modifier_t shift_modifier",
			init    => "init_arm_shifter_operand(res, 0, 0, shift_modifier, 0);",
			in_reqs => [ "gp", "gp" ],
			ins     => [ "Rm", "Rs" ],
91
92
		},
		reg_shift_imm => {
93
94
95
96
			attr    => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
			init    => "init_arm_shifter_operand(res, 0, 0, shift_modifier, shift_immediate);",
			in_reqs => [ "gp" ],
			ins     => [ "Rm" ],
97
		},
98
	},
99
},
100

101
102
103
my $binop_shifter_operand = {
	irn_flags    => [ "rematerializable" ],
	attr_type    => "arm_shifter_operand_t",
104
	out_reqs     => [ "gp" ],
105
106
	constructors => {
		imm => {
107
108
109
110
			attr    => "unsigned char immediate_value, unsigned char immediate_rot",
			init    => "init_arm_shifter_operand(res, 1, immediate_value, ARM_SHF_IMM, immediate_rot);",
			in_reqs => [ "gp" ],
			ins     => [ "left" ],
111
112
		},
		reg => {
113
114
115
			init    => "init_arm_shifter_operand(res, 1, 0, ARM_SHF_REG, 0);",
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
116
117
		},
		reg_shift_reg => {
118
119
120
121
			attr    => "arm_shift_modifier_t shift_modifier",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, 0);",
			in_reqs => [ "gp", "gp", "gp" ],
			ins     => [ "left", "right", "shift" ],
122
123
		},
		reg_shift_imm => {
124
125
126
127
			attr    => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, shift_immediate);",
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
128
		},
129
	},
130
};
Michael Beck's avatar
Michael Beck committed
131

132
my $binop_shifter_operand_setflags = {
133
	irn_flags    => [ "modify_flags", "rematerializable" ],
134
	attr_type    => "arm_shifter_operand_t",
135
	out_reqs     => [ "gp", "flags" ],
136
137
138
	outs         => [ "res", "flags" ],
	constructors => {
		imm => {
139
140
141
142
			attr    => "unsigned char immediate_value, unsigned char immediate_rot",
			init    => "init_arm_shifter_operand(res, 1, immediate_value, ARM_SHF_IMM, immediate_rot);",
			in_reqs => [ "gp" ],
			ins     => [ "left" ],
143
144
		},
		reg => {
145
146
147
			init    => "init_arm_shifter_operand(res, 1, 0, ARM_SHF_REG, 0);",
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
148
149
		},
		reg_shift_reg => {
150
151
152
153
			attr    => "arm_shift_modifier_t shift_modifier",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, 0);",
			in_reqs => [ "gp", "gp", "gp" ],
			ins     => [ "left", "right", "shift" ],
154
155
		},
		reg_shift_imm => {
156
157
158
159
			attr    => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, shift_immediate);",
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
160
		},
Matthias Braun's avatar
Matthias Braun committed
161
	},
162
};
Matthias Braun's avatar
Matthias Braun committed
163

164
165
166
my $binop_shifter_operand_flags = {
	#irn_flags    => [ "rematerializable" ],
	attr_type    => "arm_shifter_operand_t",
167
	out_reqs     => [ "gp" ],
168
169
	constructors => {
		imm => {
170
171
172
173
			attr    => "unsigned char immediate_value, unsigned char immediate_rot",
			init    => "init_arm_shifter_operand(res, 1, immediate_value, ARM_SHF_IMM, immediate_rot);",
			in_reqs => [ "gp", "flags" ],
			ins     => [ "left", "flags" ],
174
175
		},
		reg => {
176
177
178
			init    => "init_arm_shifter_operand(res, 1, 0, ARM_SHF_REG, 0);",
			in_reqs => [ "gp", "gp", "flags" ],
			ins     => [ "left", "right", "flags" ],
179
180
		},
		reg_shift_reg => {
181
182
183
184
			attr    => "arm_shift_modifier_t shift_modifier",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, 0);",
			in_reqs => [ "gp", "gp", "gp", "flags" ],
			ins     => [ "left", "right", "shift", "flags" ],
185
186
		},
		reg_shift_imm => {
187
188
189
190
			attr    => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate",
			init    => "init_arm_shifter_operand(res, 1, 0, shift_modifier, shift_immediate);",
			in_reqs => [ "gp", "gp", "flags" ],
			ins     => [ "left", "right", "flags" ],
191
		},
Matthias Braun's avatar
Matthias Braun committed
192
	},
193
};
Matthias Braun's avatar
Matthias Braun committed
194

195
196
197
198
my $cmp_shifter_operand = {
	irn_flags    => [ "rematerializable", "modify_flags" ],
	emit         => 'cmp %S0, %O',
	attr_type    => "arm_cmp_attr_t",
199
	out_reqs     => [ "flags" ],
200
201
	constructors => {
		imm => {
202
203
			attr    => "unsigned char immediate_value, unsigned char immediate_rot, bool ins_permuted, bool is_unsigned",
			init    =>
204
205
				"init_arm_shifter_operand(res, 1, immediate_value, ARM_SHF_IMM, immediate_rot);\n".
				"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
206
207
			in_reqs => [ "gp" ],
			ins     => [ "left" ],
208
209
		},
		reg => {
210
211
			attr    => "bool ins_permuted, bool is_unsigned",
			init    =>
212
213
				"init_arm_shifter_operand(res, 1, 0, ARM_SHF_REG, 0);\n".
				"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
214
215
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
216
217
		},
		reg_shift_reg => {
218
219
			attr    => "arm_shift_modifier_t shift_modifier, bool ins_permuted, bool is_unsigned",
			init    =>
220
221
				"init_arm_shifter_operand(res, 1, 0, shift_modifier, 0);\n".
				"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
222
223
			in_reqs => [ "gp", "gp", "gp" ],
			ins     => [ "left", "right", "shift" ],
224
225
		},
		reg_shift_imm => {
226
227
			attr    => "arm_shift_modifier_t shift_modifier, unsigned shift_immediate, bool ins_permuted, bool is_unsigned",
			init    =>
228
229
				"init_arm_shifter_operand(res, 1, 0, shift_modifier, shift_immediate);\n".
				"\tinit_arm_cmp_attr(res, ins_permuted, is_unsigned);",
230
231
			in_reqs => [ "gp", "gp" ],
			ins     => [ "left", "right" ],
232
		},
233
	},
234
};
Michael Beck's avatar
Michael Beck committed
235

236
237
my $mullop = {
	irn_flags => [ "rematerializable" ],
238
239
	in_reqs   => [ "gp", "gp" ],
	out_reqs  => [ "gp", "gp" ],
240
241
242
243
244
	outs      => [ "low", "high" ],
};

my $binopf = {
	irn_flags => [ "rematerializable" ],
245
246
	in_reqs   => [ "fpa", "fpa" ],
	out_reqs  => [ "fpa" ],
247
248
249
250
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
};

251

252
%nodes = (
253

Michael Beck's avatar
Michael Beck committed
254
Add => {
255
256
	template => $binop_shifter_operand,
	emit     => 'add %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
257
258
},

Matthias Braun's avatar
Matthias Braun committed
259
AddS => {
260
261
	template => $binop_shifter_operand_setflags,
	emit     => 'adds %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
262
263
264
},

AdC => {
265
266
	template => $binop_shifter_operand_flags,
	emit     => 'adc %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
267
268
},

Michael Beck's avatar
Michael Beck committed
269
Mul => {
270
	irn_flags    => [ "rematerializable" ],
271
	in_reqs      => [ "gp", "gp" ],
272
273
	emit         => 'mul %D0, %S0, %S1',
	constructors => {
274
		"" => { out_reqs => [ "gp" ]     },
275
		# TODO: !in_r0 for out constraints the register allocator more than
276
277
		# necessary, as usually you can fix the problem by swapping the inputs. But
		# for this scheme we would need a special if both inputs are the same value.
278
		v5 => { out_reqs => [ "!in_r0" ] },
279
	},
Michael Beck's avatar
Michael Beck committed
280
281
},

Matthias Braun's avatar
Matthias Braun committed
282
SMulL => {
283
284
	template => $mullop,
	emit     => 'smull %D0, %D1, %S0, %S1',
Michael Beck's avatar
Michael Beck committed
285
286
},

Matthias Braun's avatar
Matthias Braun committed
287
UMulL => {
288
289
	template => $mullop,
	emit     => 'umull %D0, %D1, %S0, %S1',
Michael Beck's avatar
Michael Beck committed
290
291
292
},

Mla => {
293
	irn_flags => [ "rematerializable" ],
294
	in_reqs   => [ "gp", "gp", "gp" ],
295
296
	ins       => [ "left", "right", "add" ],
	emit      => 'mla %D0, %S0, %S1, %S2',
297
	constructors => {
298
		"" => { out_reqs => [ "gp" ]     },
299
		# See comments for Mul_v5 out register constraint
300
		v5 => { out_reqs => [ "!in_r0" ] },
301
	}
302
303
304
305
},

Mls => {
	irn_flags => [ "rematerializable" ],
306
307
	in_reqs   => [ "gp", "gp", "gp" ],
	out_reqs  => [ "gp" ],
308
309
	ins       => [ "left", "right", "sub" ],
	emit      => 'mls %D0, %S0, %S1, %S2',
Michael Beck's avatar
Michael Beck committed
310
311
312
},

And => {
313
314
	template => $binop_shifter_operand,
	emit     => 'and %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
315
316
317
},

Or => {
318
319
	template => $binop_shifter_operand,
	emit     => 'orr %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
320
321
},

Matthias Braun's avatar
Matthias Braun committed
322
323
OrPl => {
	#irn_flags => [ "rematerializable" ],
324
325
326
	emit      => 'orrpl %D0, %S2, %O',
	attr_type => "arm_shifter_operand_t",
	in_reqs   => [ "gp", "flags", "gp", "gp" ],
327
	out_reqs  => [ "in_r2" ],
328
329
	ins       => [ "falseval", "flags", "left", "right" ],
	init      => "init_arm_shifter_operand(res, 3, 0, ARM_SHF_REG, 0);",
Matthias Braun's avatar
Matthias Braun committed
330
331
},

Michael Beck's avatar
Michael Beck committed
332
Eor => {
333
334
	template => $binop_shifter_operand,
	emit     => 'eor %D0, %S0, %O',
335
336
},

Michael Beck's avatar
Michael Beck committed
337
Bic => {
338
339
	template => $binop_shifter_operand,
	emit     => 'bic %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
340
341
342
},

Sub => {
343
344
	template => $binop_shifter_operand,
	emit     => 'sub %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
345
346
},

Matthias Braun's avatar
Matthias Braun committed
347
SubS => {
348
349
	template => $binop_shifter_operand_setflags,
	emit     => 'subs %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
350
351
352
},

SbC => {
353
354
	template => $binop_shifter_operand_flags,
	emit     => 'sbc %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
355
356
357
},

RsC => {
358
359
	template => $binop_shifter_operand_flags,
	emit     => 'rsc %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
360
361
},

Michael Beck's avatar
Michael Beck committed
362
Rsb => {
363
364
	template => $binop_shifter_operand,
	emit     => 'rsb %D0, %S0, %O',
Michael Beck's avatar
Michael Beck committed
365
},
366

Matthias Braun's avatar
Matthias Braun committed
367
RsbS => {
368
369
	template => $binop_shifter_operand_setflags,
	emit     => 'rsbs %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
370
371
},

Michael Beck's avatar
Michael Beck committed
372
Mov => {
373
374
375
	template => $unop_shifter_operand,
	emit     => 'mov %D0, %O',
	ins      => [ "Rm", "Rs" ],
Michael Beck's avatar
Michael Beck committed
376
377
378
},

Mvn => {
379
380
	template => $unop_shifter_operand,
	emit     => 'mvn %D0, %O',
Michael Beck's avatar
Michael Beck committed
381
382
},

Matthias Braun's avatar
Matthias Braun committed
383
Pkhbt => {
384
385
	template => $binop_shifter_operand,
	emit     => 'pkhbt %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
386
387
388
},

Pkhtb => {
389
390
	template => $binop_shifter_operand,
	emit     => 'pkhtb %D0, %S0, %O',
Matthias Braun's avatar
Matthias Braun committed
391
392
},

393
394
Clz => {
	irn_flags => [ "rematerializable" ],
395
396
	in_reqs   => [ "gp" ],
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
397
	emit      => 'clz %D0, %S0',
398
399
},

400
401
402
# mov lr, pc\n mov pc, XXX -- This combination is used for calls to function
# pointers
LinkMovPC => {
403
404
405
406
407
408
409
410
411
	state     => "exc_pinned",
	irn_flags => [ "modify_flags" ],
	in_reqs   => "...",
	out_reqs  => "...",
	attr_type => "arm_shifter_operand_t",
	attr      => "unsigned shiftop_input, arm_shift_modifier_t shift_modifier, unsigned char immediate_value, unsigned char immediate_rot",
	init      => "init_arm_shifter_operand(res, shiftop_input, immediate_value, shift_modifier, immediate_rot);\n",
	emit      => "mov lr, pc\n".
	             "mov pc, %O",
412
413
414
415
416
},

# mov lr, pc\n ldr pc, XXX -- This combination is used for calls to function
# pointers
LinkLdrPC => {
417
418
419
420
421
422
423
424
	state     => "exc_pinned",
	irn_flags => [ "modify_flags" ],
	in_reqs   => "...",
	out_reqs  => "...",
	attr_type => "arm_load_store_attr_t",
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
	emit      => "mov lr, pc\n".
	             "ldr pc, %O",
425
426
427
428
429
430
431
},

Bl => {
	state     => "exc_pinned",
	irn_flags => [ "modify_flags" ],
	in_reqs   => "...",
	out_reqs  => "...",
432
	outs      => [ "M", "stack", "first_result" ],
433
434
435
	attr_type => "arm_Address_attr_t",
	attr      => "ir_entity *entity, int offset",
	emit      => 'bl %I',
436
437
},

438
FrameAddr => {
439
440
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
441
	attr      => "ir_entity *entity, int offset",
442
443
	in_reqs   => [ "gp" ],
	out_reqs  => [ "gp" ],
444
	ins       => [ "base" ],
445
	attr_type => "arm_Address_attr_t",
446
447
},

448
Address => {
449
450
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
451
	attr      => "ir_entity *entity, int offset",
452
	out_reqs  => [ "gp" ],
453
	attr_type => "arm_Address_attr_t",
454
455
},

456
457
458
459
460
Cmn => {
	template => $cmp_shifter_operand,
	emit     => 'cmn %S0, %O',
},

461
Cmp => {
462
463
	template => $cmp_shifter_operand,
	emit     => 'cmp %S0, %O',
464
465
},

466
Tst => {
467
468
	template => $cmp_shifter_operand,
	emit     => 'tst %S0, %O',
469
470
471
},

B => {
472
	op_flags  => [ "cfopcode", "forking" ],
473
	state     => "pinned",
474
	in_reqs   => [ "flags" ],
475
	out_reqs  => [ "exec", "exec" ],
476
	ins       => [ "flags" ],
477
	attr      => "ir_relation relation",
Michael Beck's avatar
Michael Beck committed
478
	attr_type => "arm_CondJmp_attr_t",
479
	init      => "\tset_arm_CondJmp_relation(res, relation);",
480
481
},

482
483
Jmp => {
	state     => "pinned",
484
485
	op_flags  => [ "cfopcode" ],
	irn_flags => [ "simple_jump" ],
486
	out_reqs  => [ "exec" ],
487
488
},

489
490
491
492
493
494
495
496
497
498
IJmp => {
	op_flags  => [ "cfopcode", "forking" ],
	state     => "pinned",
	in_reqs   => [ "gp" ],
	ins       => [ "target" ],
	out_reqs  => [ "exec" ],
	outs      => [ "jmp" ],
	emit      => "mov pc, %S0",
},

Michael Beck's avatar
Michael Beck committed
499
SwitchJmp => {
500
	op_flags  => [ "cfopcode", "forking" ],
Michael Beck's avatar
Michael Beck committed
501
	state     => "pinned",
Matthias Braun's avatar
Matthias Braun committed
502
	attr      => "const ir_switch_table *table",
503
	init      => "init_arm_SwitchJmp_attributes(res, table);",
504
	in_reqs   => [ "gp" ],
505
	out_reqs  => "...",
Michael Beck's avatar
Michael Beck committed
506
	attr_type => "arm_SwitchJmp_attr_t",
507
508
},

509
Ldr => {
510
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
511
	state     => "exc_pinned",
512
513
	ins       => [ "ptr", "mem" ],
	outs      => [ "res", "M" ],
514
515
	in_reqs   => [ "gp", "mem" ],
	out_reqs  => [ "gp", "mem" ],
516
	emit      => 'ldr%ML %D0, %A',
517
	attr_type => "arm_load_store_attr_t",
518
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
519
520
},

521
Str => {
522
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
523
	state     => "exc_pinned",
524
	ins       => [ "ptr", "val", "mem" ],
525
	outs      => [ "M" ],
526
527
	in_reqs   => [ "gp", "gp", "mem" ],
	out_reqs  => [ "mem" ],
528
	emit      => 'str%MS %S1, %A',
529
	attr_type => "arm_load_store_attr_t",
530
	attr      => "ir_mode *ls_mode, ir_entity *entity, int entity_sign, long offset, bool is_frame_entity",
Michael Beck's avatar
Michael Beck committed
531
532
},

533

534
Adf => {
535
536
	template => $binopf,
	emit     => 'adf%MA %D0, %S0, %S1',
537
538
},

539
Muf => {
540
541
	template => $binopf,
	emit     => 'muf%MA %D0, %S0, %S1',
Michael Beck's avatar
Michael Beck committed
542
543
},

544
Suf => {
545
546
	template => $binopf,
	emit     => 'suf%MA %D0, %S0, %S1',
Michael Beck's avatar
Michael Beck committed
547
548
},

549
Dvf => {
550
	in_reqs   => [ "fpa", "fpa" ],
551
	out_reqs  => [ "fpa", "mem" ],
Matthias Braun's avatar
Matthias Braun committed
552
	emit      => 'dvf%MA %D0, %S0, %S1',
553
	outs      => [ "res", "M" ],
554
	attr_type => "arm_farith_attr_t",
Michael Beck's avatar
Michael Beck committed
555
	attr      => "ir_mode *op_mode",
556
	mode      => "first",
Michael Beck's avatar
Michael Beck committed
557
558
},

559
Mvf => {
560
	irn_flags => [ "rematerializable" ],
561
562
	in_reqs   => [ "fpa" ],
	out_reqs  => [ "fpa" ],
Matthias Braun's avatar
Matthias Braun committed
563
	emit      => 'mvf%MA %S0, %D0',
564
565
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
566
567
},

568
FltX => {
569
	irn_flags => [ "rematerializable" ],
570
571
	in_reqs   => [ "gp" ],
	out_reqs  => [ "fpa" ],
Matthias Braun's avatar
Matthias Braun committed
572
	emit      => 'flt%MA %D0, %S0',
573
574
575
576
	attr_type => "arm_farith_attr_t",
	attr      => "ir_mode *op_mode",
},

577
Cmfe => {
578
	irn_flags => [ "rematerializable", "modify_flags" ],
579
580
	attr_type => "arm_cmp_attr_t",
	attr      => "bool ins_permuted",
581
	init      => "init_arm_cmp_attr(res, ins_permuted, false);",
582
583
	in_reqs   => [ "fpa", "fpa" ],
	out_reqs  => [ "flags" ],
Matthias Braun's avatar
Matthias Braun committed
584
	emit      => 'cmfe %S0, %S1',
585
586
},

587
Ldf => {
588
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
589
	state     => "exc_pinned",
590
	ins       => [ "ptr", "mem" ],
Michael Beck's avatar
Michael Beck committed
591
	outs      => [ "res", "M" ],
592
593
	in_reqs   => [ "gp", "mem" ],
	out_reqs  => [ "fpa", "mem" ],
594
	emit      => 'ldf%MF %D0, %A',
595
596
	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
597
598
},

599
Stf => {
600
	op_flags  => [ "uses_memory" ],
Michael Beck's avatar
Michael Beck committed
601
	state     => "exc_pinned",
602
603
	ins       => [ "ptr", "val", "mem" ],
	outs      => [ "M" ],
604
605
	in_reqs   => [ "gp", "fpa", "mem" ],
	out_reqs  => [ "mem" ],
606
	emit      => 'stf%MF %S1, %A',
607
608
	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
609
610
},

Michael Beck's avatar
Michael Beck committed
611
# floating point constants
612
fConst => {
613
614
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
Matthias Braun's avatar
Matthias Braun committed
615
	attr      => "ir_tarval *tv",
616
	init      => "attr->tv = tv;",
617
	out_reqs  => [ "fpa" ],
618
	attr_type => "arm_fConst_attr_t",
619
620
621
622
623
},

Return => {
	state    => "pinned",
	op_flags => [ "cfopcode" ],
624
	in_reqs  => "...",
625
	ins      => [ "mem", "sp", "first_result" ],
626
	out_reqs => [ "exec" ],
627
	emit     => "bx lr",
628
},
Michael Beck's avatar
Michael Beck committed
629

Matthias Braun's avatar
Matthias Braun committed
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
AddS_t => {
	ins       => [ "left", "right" ],
	outs      => [ "res", "flags" ],
	attr_type => "",
	dump_func => "NULL",
},

AdC_t => {
	ins       => [ "left", "right", "flags" ],
	attr_type => "",
	dump_func => "NULL",
},

SubS_t => {
	ins       => [ "left", "right" ],
	outs      => [ "res", "flags" ],
	attr_type => "",
	dump_func => "NULL",
},

SbC_t => {
	ins       => [ "left", "right", "flags" ],
	attr_type => "",
	dump_func => "NULL",
},

UMulL_t => {
	ins       => [ "left", "right" ],
	outs      => [ "low", "high" ],
	attr_type => "",
	dump_func => "NULL",
},

SMulL_t => {
	ins       => [ "left", "right" ],
	outs      => [ "low", "high" ],
	attr_type => "",
	dump_func => "NULL",
},

OrPl_t => {
	ins       => [ "falseval", "flags", "left", "right" ],
	attr_type => "",
	dump_func => "NULL",
},

676
);