amd64_spec.pl 16.9 KB
Newer Older
1
2
$arch = "amd64";

3
4
$mode_gp      = "mode_Lu";
$mode_flags   = "mode_Iu";
5
$mode_xmm     = "amd64_mode_xmm";
6
7
8
$status_flags = "all"; # TODO
$all_flags    = "all";

9
10
%reg_classes = (
	gp => [
11
12
13
14
15
16
17
		{ name => "rax", dwarf => 0 },
		{ name => "rcx", dwarf => 2 },
		{ name => "rdx", dwarf => 1 },
		{ name => "rsi", dwarf => 4 },
		{ name => "rdi", dwarf => 5 },
		{ name => "rbx", dwarf => 3 },
		{ name => "rbp", dwarf => 6 },
18
		{ name => "rsp", dwarf => 7 },
19
20
21
22
23
24
25
26
		{ name => "r8",  dwarf => 8 },
		{ name => "r9",  dwarf => 9 },
		{ name => "r10", dwarf => 10 },
		{ name => "r11", dwarf => 11 },
		{ name => "r12", dwarf => 12 },
		{ name => "r13", dwarf => 13 },
		{ name => "r14", dwarf => 14 },
		{ name => "r15", dwarf => 15 },
27
		{ mode => $mode_gp }
28
	],
29
	flags => [
30
		{ name => "eflags", dwarf => 49 },
31
		{ mode => $mode_flags, flags => "manual_ra" }
32
	],
33
	xmm => [
Matthias Braun's avatar
Matthias Braun committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
		{ name => "xmm0",  dwarf => 17 },
		{ name => "xmm1",  dwarf => 18 },
		{ name => "xmm2",  dwarf => 19 },
		{ name => "xmm3",  dwarf => 20 },
		{ name => "xmm4",  dwarf => 21 },
		{ name => "xmm5",  dwarf => 22 },
		{ name => "xmm6",  dwarf => 23 },
		{ name => "xmm7",  dwarf => 24 },
		{ name => "xmm8",  dwarf => 25 },
		{ name => "xmm9",  dwarf => 26 },
		{ name => "xmm10", dwarf => 27 },
		{ name => "xmm11", dwarf => 28 },
		{ name => "xmm12", dwarf => 29 },
		{ name => "xmm13", dwarf => 30 },
		{ name => "xmm14", dwarf => 31 },
		{ name => "xmm15", dwarf => 32 },
50
51
		{ mode => $mode_xmm }
	]
52
53
);

54
55
56
57
58
59
60
sub amd64_custom_init_attr {
	my $constr = shift;
	my $node   = shift;
	my $name   = shift;
	my $res    = "";

	if(defined($node->{modified_flags})) {
61
		$res .= "\tarch_add_irn_flags(res, arch_irn_flag_modify_flags);\n";
62
63
64
65
66
	}
	return $res;
}
$custom_init_attr_func = \&amd64_custom_init_attr;

67
68
69
70
%custom_irn_flags = (
	commutative => "(arch_irn_flags_t)amd64_arch_irn_flag_commutative_binop",
);

71
72
$default_copy_attr = "amd64_copy_attr";

73
%init_attr = (
Matthias Braun's avatar
Matthias Braun committed
74
75
76
77
78
79
	amd64_attr_t =>
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);",
	amd64_addr_attr_t =>
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tattr->insn_mode = insn_mode;\n"
		."\tattr->addr = addr;",
80
81
82
	amd64_asm_attr_t =>
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tattr->asmattr = *asmattr;\n",
Matthias Braun's avatar
Matthias Braun committed
83
	amd64_binop_addr_attr_t =>
84
		"be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
85
		."\t*attr = *attr_init;",
86
	amd64_switch_jmp_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
87
88
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tinit_amd64_switch_attributes(res, table, table_entity);",
89
	amd64_cc_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
90
91
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tinit_amd64_cc_attributes(res, cc);",
92
	amd64_movimm_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
93
94
95
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tinit_amd64_movimm_attributes(res, insn_mode, entity, offset);",
	amd64_shift_attr_t =>
96
		"be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
97
		."\t*attr = *attr_init;\n",
98
99
);

100
101
my $binop = {
	state          => "exc_pinned",
102
	in_reqs        => "...",
103
	out_reqs       => [ "gp", "flags", "none" ],
104
105
106
107
108
109
110
111
112
	outs           => [ "res", "flags", "M" ],
	attr_type      => "amd64_binop_addr_attr_t",
	attr           => "const amd64_binop_addr_attr_t *attr_init",
	modified_flags => $status_flags,
};

my $binop_commutative = {
	irn_flags      => [ "rematerializable", "commutative" ],
	state          => "exc_pinned",
113
	in_reqs        => "...",
114
	out_reqs       => [ "gp", "flags", "none" ],
115
116
117
118
119
120
121
122
	outs           => [ "res", "flags", "M" ],
	attr_type      => "amd64_binop_addr_attr_t",
	attr           => "const amd64_binop_addr_attr_t *attr_init",
	modified_flags => $status_flags,
};

my $divop = {
	state          => "pinned",
123
	in_reqs        => "...",
124
	out_reqs       => [ "rax", "flags", "none", "rdx" ],
125
126
127
128
129
130
131
132
133
134
135
136
137
138
	outs           => [ "res_div", "flags", "M", "res_mod" ],
	attr_type      => "amd64_addr_attr_t",
	fixed          => "amd64_addr_t addr = { { NULL, 0 }, NO_INPUT, NO_INPUT, NO_INPUT, 0, AMD64_SEGMENT_DEFAULT };\n"
	                 ."amd64_op_mode_t op_mode = AMD64_OP_RAX_REG;\n",
	attr           => "amd64_insn_mode_t insn_mode",
	modified_flags => $status_flags,
};

my $mulop = {
	# Do not rematerialize this node
	# TODO: should mark this commutative as soon as the backend code
	#       can handle this special case
	# It produces 2 results and has strict constraints
	state          => "exc_pinned",
139
	in_reqs        => "...",
140
	out_reqs       => [ "rax", "flags", "none", "rdx" ],
141
142
143
144
145
146
147
	outs           => [ "res_low", "flags", "M", "res_high" ],
	attr_type      => "amd64_addr_attr_t",
	attr           => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	modified_flags => $status_flags,
};

my $shiftop = {
148
149
150
151
152
153
	irn_flags      => [ "rematerializable" ],
	in_reqs        => "...",
	out_reqs       => [ "gp", "flags" ],
	outs           => [ "res", "flags" ],
	attr_type      => "amd64_shift_attr_t",
	attr           => "const amd64_shift_attr_t *attr_init",
154
155
156
157
158
	modified_flags => $status_flags
};

my $unop = {
	irn_flags      => [ "rematerializable" ],
159
160
	in_reqs        => [ "gp" ],
	out_reqs       => [ "in_r1", "flags" ],
161
162
163
164
165
166
167
168
169
170
171
172
	ins            => [ "val" ],
	outs           => [ "res", "flags" ],
	attr_type      => "amd64_addr_attr_t",
	attr           => "amd64_insn_mode_t insn_mode",
	fixed          => "amd64_op_mode_t op_mode = AMD64_OP_UNOP_REG;\n"
	                 ."amd64_addr_t addr = { { NULL, 0 }, NO_INPUT, NO_INPUT, NO_INPUT, 0, AMD64_SEGMENT_DEFAULT };",
	modified_flags => $status_flags
};

my $binopx = {
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
173
	in_reqs   => "...",
174
	out_reqs  => [ "xmm", "none", "none" ],
175
176
177
178
179
180
181
182
	outs      => [ "res", "none", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
};

my $binopx_commutative = {
	irn_flags => [ "rematerializable", "commutative" ],
	state     => "exc_pinned",
183
	in_reqs   => "...",
184
	out_reqs  => [ "xmm", "none", "none" ],
185
186
187
188
189
190
191
	outs      => [ "res", "none", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
};

my $cvtop2x = {
	state     => "exc_pinned",
192
	in_reqs   => "...",
193
	out_reqs  => [ "xmm", "none", "none" ],
194
195
196
197
198
199
200
	outs      => [ "res", "none", "M" ],
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
};

my $cvtopx2i = {
	state     => "exc_pinned",
201
	in_reqs   => "...",
202
	out_reqs  => [ "gp", "none", "none" ],
203
204
205
206
207
208
209
	outs      => [ "res", "none", "M" ],
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
};

my $movopx = {
	state     => "exc_pinned",
210
	in_reqs   => "...",
211
	outs      => [ "res", "none", "M" ],
212
	out_reqs  => [ "xmm", "none", "none" ],
213
214
215
216
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_op_mode_t op_mode, amd64_addr_t addr",
};

217
%nodes = (
218
push_am => {
219
	op_flags  => [ "uses_memory" ],
220
	state     => "exc_pinned",
221
	in_reqs   => "...",
222
	out_reqs  => [ "rsp:I|S", "none" ],
223
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
224
225
226
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_addr_t addr",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_ADDR;\n",
Matthias Braun's avatar
Matthias Braun committed
227
	emit      => "push%M %A",
228
229
},

230
push_reg => {
231
232
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
233
	in_reqs   => [ "rsp", "gp" ],
234
	out_reqs  => [ "rsp:I|S" ],
235
	ins       => [ "stack", "val" ],
236
237
	outs      => [ "stack" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
238
	emit      => "pushq %^S1",
239
240
},

241
pop_am => {
242
243
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
244
	in_reqs   => "...",
245
	out_reqs  => [ "rsp:I|S", "none" ],
246
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
247
248
249
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_addr_t addr",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_ADDR;\n",
Matthias Braun's avatar
Matthias Braun committed
250
	emit      => "pop%M %A",
251
},
252

253
sub_sp => {
Tobias Rapp's avatar
Tobias Rapp committed
254
	state     => "pinned",
255
	in_reqs   => "...",
256
	out_reqs  => [ "rsp:I|S", "gp", "none" ],
Tobias Rapp's avatar
Tobias Rapp committed
257
258
259
260
261
262
263
264
	outs      => [ "stack", "addr", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	emit      => "subq %AM\n".
	             "movq %%rsp, %D1",
	modified_flags => $status_flags,
},

265
leave => {
266
267
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
268
	in_reqs   => [ "rbp" ],
269
	out_reqs  => [ "rbp:I", "rsp:I|S" ],
270
271
272
273
274
	outs      => [ "frame", "stack" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
	emit      => "leave",
},

275
add => {
276
277
	template => $binop_commutative,
	emit     => "add%M %AM",
278
},
279

280
and => {
281
282
	template => $binop_commutative,
	emit     => "and%M %AM",
283
},
Matthias Braun's avatar
Matthias Braun committed
284

285
asm => {
286
	in_reqs   => "...",
287
	out_reqs  => "...",
288
289
290
	attr_type => "amd64_asm_attr_t",
	attr      => "const x86_asm_attr_t *asmattr",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
291
292
},

293
div => {
294
295
	template => $divop,
	emit     => "div%M %AM",
Matthias Braun's avatar
Matthias Braun committed
296
297
},

298
idiv => {
299
300
	template => $divop,
	emit     => "idiv%M %AM",
Matthias Braun's avatar
Matthias Braun committed
301
302
},

303
imul => {
304
305
	template => $binop_commutative,
	emit     => "imul%M %AM",
306
},
307

308
imul_1op => {
309
310
	template => $mulop,
	emit     => "imul%M %AM",
311
312
},

313
mul => {
314
315
	template => $mulop,
	emit     => "mul%M %AM",
316
317
},

318
or => {
319
320
	template => $binop_commutative,
	emit     => "or%M %AM",
321
322
},

323
shl => {
324
325
	template => $shiftop,
	emit     => "shl%MS %SO",
326
327
},

328
shr => {
329
330
	template => $shiftop,
	emit     => "shr%MS %SO",
331
332
},

333
sar => {
334
335
	template => $shiftop,
	emit     => "sar%MS %SO",
336
337
},

338
sub => {
339
	template  => $binop,
Matthias Braun's avatar
Matthias Braun committed
340
	irn_flags => [ "rematerializable" ],
341
	emit      => "sub%M %AM",
342
},
343

344
sbb => {
345
346
	template => $binop,
	emit     => "sbb%M %AM",
347
348
},

349
neg => {
350
351
	template => $unop,
	emit     => "neg%M %AM",
352
},
353

354
not => {
355
356
	template => $unop,
	emit     => "not%M %AM",
Christoph Mallon's avatar
Christoph Mallon committed
357
358
},

359
xor => {
360
361
	template => $binop_commutative,
	emit     => "xor%M %AM",
362
363
},

364
xor_0 => {
Matthias Braun's avatar
Matthias Braun committed
365
366
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
367
	out_reqs  => [ "gp", "flags" ],
368
	outs      => [ "res", "flags" ],
Matthias Braun's avatar
Matthias Braun committed
369
370
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
	emit      => "xorl %3D0, %3D0",
371
	modified_flags => $status_flags,
Matthias Braun's avatar
Matthias Braun committed
372
373
},

374
mov_imm => {
375
	op_flags  => [ "constlike" ],
376
	irn_flags => [ "rematerializable" ],
377
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
378
379
380
381
	attr_type => "amd64_movimm_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, int64_t offset, ir_entity *entity",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_IMM64;",
	emit      => 'mov%MM $%C, %D0',
382
	mode      => $mode_gp,
383
},
384

385
movs => {
386
	state     => "exc_pinned",
387
	in_reqs   => "...",
388
	out_reqs  => [ "gp", "none", "none" ],
Matthias Braun's avatar
Matthias Braun committed
389
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
390
391
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
Matthias Braun's avatar
Matthias Braun committed
392
393
394
	emit      => "movs%Mq %AM, %^D0",
},

395
mov_gp => {
Matthias Braun's avatar
Matthias Braun committed
396
	state     => "exc_pinned",
397
	in_reqs   => "...",
398
	out_reqs  => [ "gp", "none", "none" ],
Matthias Braun's avatar
Matthias Braun committed
399
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
400
401
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
402
},
403

404
ijmp => {
405
406
	state     => "pinned",
	op_flags  => [ "cfopcode", "unknown_jump" ],
407
	in_reqs   => "...",
408
	out_reqs  => [ "none", "none", "none" ],
409
	outs      => [ "X", "unused", "M" ],
410
	attr_type => "amd64_addr_attr_t",
411
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
412
	emit      => "jmp %*AM",
413
414
},

415
jmp => {
Matthias Braun's avatar
Matthias Braun committed
416
417
	state    => "pinned",
	op_flags => [ "cfopcode" ],
418
	out_reqs => [ "none" ],
Matthias Braun's avatar
Matthias Braun committed
419
420
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_IMM32;",
	mode     => "mode_X",
421
},
422

423
cmp => {
424
	irn_flags => [ "rematerializable" ],
425
	state     => "exc_pinned",
426
	in_reqs   => "...",
427
	out_reqs  => [ "none", "flags", "none" ],
Matthias Braun's avatar
Matthias Braun committed
428
	outs      => [ "dummy", "flags", "M" ],
Matthias Braun's avatar
Matthias Braun committed
429
430
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
Matthias Braun's avatar
Matthias Braun committed
431
	emit      => "cmp%M %AM",
432
	modified_flags => $status_flags,
433
},
434

435
lea => {
Matthias Braun's avatar
Matthias Braun committed
436
	irn_flags => [ "rematerializable" ],
437
	in_reqs   => "...",
438
	outs      => [ "res" ],
439
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
440
441
442
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_addr_t addr",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_ADDR;\n",
Matthias Braun's avatar
Matthias Braun committed
443
	emit      => "lea%M %A, %D0",
444
	mode      => $mode_gp,
Matthias Braun's avatar
Matthias Braun committed
445
446
},

447
jcc => {
448
	state     => "pinned",
449
	op_flags  => [ "cfopcode", "forking" ],
450
451
	in_reqs   => [ "eflags" ],
	out_reqs  => [ "none", "none" ],
452
453
	ins       => [ "eflags" ],
	outs      => [ "false", "true" ],
454
	attr_type => "amd64_cc_attr_t",
Matthias Braun's avatar
Matthias Braun committed
455
456
	attr      => "x86_condition_code_t cc",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
457
},
458

459
mov_store => {
460
	op_flags  => [ "uses_memory" ],
461
	state     => "exc_pinned",
462
	in_reqs   => "...",
463
	out_reqs  => [ "none" ],
464
	outs      => [ "M" ],
Matthias Braun's avatar
Matthias Braun committed
465
466
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
Matthias Braun's avatar
Matthias Braun committed
467
468
	mode      => "mode_M",
	emit      => "mov%M %S0, %A",
469
},
470

471
jmp_switch => {
Matthias Braun's avatar
Matthias Braun committed
472
473
	op_flags  => [ "cfopcode", "forking" ],
	state     => "pinned",
474
	in_reqs   => [ "gp" ],
475
	out_reqs  => "...",
Matthias Braun's avatar
Matthias Braun committed
476
477
478
	attr_type => "amd64_switch_jmp_attr_t",
	attr      => "const ir_switch_table *table, ir_entity *table_entity",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
479
480
},

481
call => {
482
	state     => "exc_pinned",
483
	in_reqs   => "...",
484
	out_reqs  => "...",
485
	outs      => [ "M", "stack", "flags", "first_result" ],
Matthias Braun's avatar
Matthias Braun committed
486
487
488
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_op_mode_t op_mode, amd64_addr_t addr",
	fixed     => "amd64_insn_mode_t insn_mode = INSN_MODE_64;\n",
489
	emit      => "call %*AM",
490
	modified_flags => $all_flags,
491
492
},

493
start => {
494
	irn_flags => [ "schedule_first" ],
495
	state     => "pinned",
496
	out_reqs  => "...",
497
	ins       => [],
Matthias Braun's avatar
Matthias Braun committed
498
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
499
	emit      => "",
500
501
},

502
ret => {
Matthias Braun's avatar
Matthias Braun committed
503
	state    => "pinned",
504
	op_flags => [ "cfopcode" ],
505
	in_reqs  => "...",
506
	out_reqs => [ "none" ],
507
	ins      => [ "mem", "stack", "first_result" ],
Matthias Braun's avatar
Matthias Braun committed
508
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
509
	mode     => "mode_X",
510
	emit     => "ret",
511
512
},

513
514
# SSE

515
adds => {
516
517
	template => $binopx_commutative,
	emit     => "adds%MX %AM",
518
519
},

520
divs => {
521
522
	template => $binopx,
	emit     => "divs%MX %AM",
523
524
},

525
movs_xmm => {
526
527
528
	template => $movopx,
	attr     => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	emit     => "movs%MX %AM, %D0",
529
530
},

531
muls => {
532
533
	template => $binopx_commutative,
	emit     => "muls%MX %AM",
Tobias Rapp's avatar
Tobias Rapp committed
534
535
},

536
movs_store_xmm => {
537
538
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
539
	in_reqs   => "...",
540
	out_reqs  => [ "none" ],
541
542
543
544
	outs      => [ "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	mode      => "mode_M",
545
	emit      => "movs%MX %^S0, %A",
546
547
},

548
subs => {
549
550
	template => $binopx,
	emit     => "subs%MX %AM",
551
552
},

553
ucomis => {
Tobias Rapp's avatar
Tobias Rapp committed
554
555
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
556
	in_reqs   => "...",
557
	out_reqs  => [ "none", "flags", "none" ],
Tobias Rapp's avatar
Tobias Rapp committed
558
559
560
561
562
563
564
	outs      => [ "dummy", "flags", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	emit      => "ucomis%MX %AM",
	modified_flags => $status_flags,
},

565
xorpd_0 => {
566
567
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
568
	out_reqs  => [ "xmm" ],
569
570
	outs      => [ "res" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
571
	emit      => "xorpd %^D0, %^D0",
572
573
574
	mode      => $mode_xmm,
},

575
xorp  => {
576
577
	template => $binopx_commutative,
	emit     => "xorp%MX %AM",
578
579
},

580
581
# Conversion operations

582
cvtss2sd => {
583
584
	template => $cvtop2x,
	emit     => "cvtss2sd %AM, %^D0",
585
586
},

587
cvtsd2ss => {
588
589
590
591
	template => $cvtop2x,
	attr     => "amd64_op_mode_t op_mode, amd64_addr_t addr",
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_64;\n",
	emit     => "cvtsd2ss %AM, %^D0",
592
593
},

594
cvttsd2si => {
595
596
	template => $cvtopx2i,
	emit     => "cvttsd2si %AM, %D0",
597
598
},

599
cvttss2si => {
600
601
	template => $cvtopx2i,
	emit     => "cvttss2si %AM, %D0",
602
603
},

604
cvtsi2ss => {
605
606
	template => $cvtop2x,
	emit     => "cvtsi2ss %AM, %^D0",
607
608
},

609
cvtsi2sd => {
610
611
	template => $cvtop2x,
	emit     => "cvtsi2sd %AM, %^D0",
612
613
},

614
movq => {
615
616
617
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_64;\n",
	emit     => "movq %AM, %D0",
618
619
},

620
movdqa => {
621
622
623
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqa %AM, %D0",
624
625
},

626
movdqu => {
627
628
629
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqu %AM, %D0",
630
631
632
633
634
},

movdqu_store => {
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
635
	in_reqs   => "...",
636
	out_reqs  => [ "none" ],
637
638
639
640
641
642
643
	outs      => [ "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	mode      => "mode_M",
	emit      => "movdqu %^S0, %A",
},

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
l_punpckldq => {
	ins       => [ "arg0", "arg1" ],
	outs      => [ "res" ],
	attr_type => "",
	dump_func => "NULL",
	mode      => $mode_xmm,
},

l_subpd => {
	ins       => [ "arg0", "arg1" ],
	outs      => [ "res" ],
	attr_type => "",
	dump_func => "NULL",
	mode      => $mode_xmm,
},

l_haddpd => {
	ins       => [ "arg0", "arg1" ],
	outs      => [ "res" ],
	attr_type => "",
	dump_func => "NULL",
	mode      => $mode_xmm,
},

punpckldq => {
669
670
	template => $binopx,
	emit     => "punpckldq %AM",
671
672
673
},

subpd => {
674
675
	template => $binopx,
	emit     => "subpd %AM",
676
677
678
},

haddpd => {
679
680
	template => $binopx,
	emit     => "haddpd %AM",
681
682
},

683
);