amd64_spec.pl 16.5 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
34
35
36
37
38
39
40
41
42
43
	xmm => [
		{ 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 },
		{ mode => $mode_xmm }
	]
44
45
);

46
47
48
49
50
51
52
sub amd64_custom_init_attr {
	my $constr = shift;
	my $node   = shift;
	my $name   = shift;
	my $res    = "";

	if(defined($node->{modified_flags})) {
53
		$res .= "\tarch_add_irn_flags(res, arch_irn_flag_modify_flags);\n";
54
55
56
57
58
	}
	return $res;
}
$custom_init_attr_func = \&amd64_custom_init_attr;

59
60
61
62
%custom_irn_flags = (
	commutative => "(arch_irn_flags_t)amd64_arch_irn_flag_commutative_binop",
);

63
64
$default_copy_attr = "amd64_copy_attr";

65
%init_attr = (
Matthias Braun's avatar
Matthias Braun committed
66
67
68
69
70
71
	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;",
72
73
74
	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
75
	amd64_binop_addr_attr_t =>
76
		"be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
77
		."\t*attr = *attr_init;",
78
	amd64_switch_jmp_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
79
80
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tinit_amd64_switch_attributes(res, table, table_entity);",
81
	amd64_cc_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
82
83
		"init_amd64_attributes(res, irn_flags_, in_reqs, n_res, op_mode);\n"
		."\tinit_amd64_cc_attributes(res, cc);",
84
	amd64_movimm_attr_t =>
Matthias Braun's avatar
Matthias Braun committed
85
86
87
		"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 =>
88
		"be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
89
		."\t*attr = *attr_init;\n",
90
91
);

92
93
my $binop = {
	state          => "exc_pinned",
94
	in_reqs        => "...",
95
	out_reqs       => [ "gp", "flags", "none" ],
96
97
98
99
100
101
102
103
104
	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",
105
	in_reqs        => "...",
106
	out_reqs       => [ "gp", "flags", "none" ],
107
108
109
110
111
112
113
114
	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",
115
	in_reqs        => "...",
116
	out_reqs       => [ "rax", "flags", "none", "rdx" ],
117
118
119
120
121
122
123
124
125
126
127
128
129
130
	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",
131
	in_reqs        => "...",
132
	out_reqs       => [ "rax", "flags", "none", "rdx" ],
133
134
135
136
137
138
139
	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 = {
140
141
142
143
144
145
	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",
146
147
148
149
150
	modified_flags => $status_flags
};

my $unop = {
	irn_flags      => [ "rematerializable" ],
151
152
	in_reqs        => [ "gp" ],
	out_reqs       => [ "in_r1", "flags" ],
153
154
155
156
157
158
159
160
161
162
163
164
	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",
165
	in_reqs   => "...",
166
	out_reqs  => [ "xmm", "none", "none" ],
167
168
169
170
171
172
173
174
	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",
175
	in_reqs   => "...",
176
	out_reqs  => [ "xmm", "none", "none" ],
177
178
179
180
181
182
183
	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",
184
	in_reqs   => "...",
185
	out_reqs  => [ "xmm", "none", "none" ],
186
187
188
189
190
191
192
	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",
193
	in_reqs   => "...",
194
	out_reqs  => [ "gp", "none", "none" ],
195
196
197
198
199
200
201
	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",
202
	in_reqs   => "...",
203
	outs      => [ "res", "none", "M" ],
204
	out_reqs  => [ "xmm", "none", "none" ],
205
206
207
208
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_op_mode_t op_mode, amd64_addr_t addr",
};

209
%nodes = (
210
push_am => {
211
	op_flags  => [ "uses_memory" ],
212
	state     => "exc_pinned",
213
	in_reqs   => "...",
214
	out_reqs  => [ "rsp:I|S", "none" ],
215
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
216
217
218
	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
219
	emit      => "push%M %A",
220
221
},

222
push_reg => {
223
224
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
225
	in_reqs   => [ "rsp", "gp" ],
226
	out_reqs  => [ "rsp:I|S" ],
227
	ins       => [ "stack", "val" ],
228
229
	outs      => [ "stack" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
230
	emit      => "pushq %^S1",
231
232
},

233
pop_am => {
234
235
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
236
	in_reqs   => "...",
237
	out_reqs  => [ "rsp:I|S", "none" ],
238
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
239
240
241
	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
242
	emit      => "pop%M %A",
243
},
244

245
sub_sp => {
Tobias Rapp's avatar
Tobias Rapp committed
246
	state     => "pinned",
247
	in_reqs   => "...",
248
	out_reqs  => [ "rsp:I|S", "gp", "none" ],
Tobias Rapp's avatar
Tobias Rapp committed
249
250
251
252
253
254
255
256
	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,
},

257
leave => {
258
259
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
260
	in_reqs   => [ "rbp" ],
261
	out_reqs  => [ "rbp:I", "rsp:I|S" ],
262
263
264
265
266
	outs      => [ "frame", "stack" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
	emit      => "leave",
},

267
add => {
268
269
	template => $binop_commutative,
	emit     => "add%M %AM",
270
},
271

272
and => {
273
274
	template => $binop_commutative,
	emit     => "and%M %AM",
275
},
Matthias Braun's avatar
Matthias Braun committed
276

277
asm => {
278
	in_reqs   => "...",
279
	out_reqs  => "...",
280
281
282
	attr_type => "amd64_asm_attr_t",
	attr      => "const x86_asm_attr_t *asmattr",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
283
284
},

285
div => {
286
287
	template => $divop,
	emit     => "div%M %AM",
Matthias Braun's avatar
Matthias Braun committed
288
289
},

290
idiv => {
291
292
	template => $divop,
	emit     => "idiv%M %AM",
Matthias Braun's avatar
Matthias Braun committed
293
294
},

295
imul => {
296
297
	template => $binop_commutative,
	emit     => "imul%M %AM",
298
},
299

300
imul_1op => {
301
302
	template => $mulop,
	emit     => "imul%M %AM",
303
304
},

305
mul => {
306
307
	template => $mulop,
	emit     => "mul%M %AM",
308
309
},

310
or => {
311
312
	template => $binop_commutative,
	emit     => "or%M %AM",
313
314
},

315
shl => {
316
317
	template => $shiftop,
	emit     => "shl%MS %SO",
318
319
},

320
shr => {
321
322
	template => $shiftop,
	emit     => "shr%MS %SO",
323
324
},

325
sar => {
326
327
	template => $shiftop,
	emit     => "sar%MS %SO",
328
329
},

330
sub => {
331
	template  => $binop,
Matthias Braun's avatar
Matthias Braun committed
332
	irn_flags => [ "rematerializable" ],
333
	emit      => "sub%M %AM",
334
},
335

336
sbb => {
337
338
	template => $binop,
	emit     => "sbb%M %AM",
339
340
},

341
neg => {
342
343
	template => $unop,
	emit     => "neg%M %AM",
344
},
345

346
not => {
347
348
	template => $unop,
	emit     => "not%M %AM",
Christoph Mallon's avatar
Christoph Mallon committed
349
350
},

351
xor => {
352
353
	template => $binop_commutative,
	emit     => "xor%M %AM",
354
355
},

356
xor_0 => {
Matthias Braun's avatar
Matthias Braun committed
357
358
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
359
	out_reqs  => [ "gp", "flags" ],
360
	outs      => [ "res", "flags" ],
Matthias Braun's avatar
Matthias Braun committed
361
362
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
	emit      => "xorl %3D0, %3D0",
363
	modified_flags => $status_flags,
Matthias Braun's avatar
Matthias Braun committed
364
365
},

366
mov_imm => {
367
	op_flags  => [ "constlike" ],
368
	irn_flags => [ "rematerializable" ],
369
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
370
371
372
373
	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',
374
	mode      => $mode_gp,
375
},
376

377
movs => {
378
	state     => "exc_pinned",
379
	in_reqs   => "...",
380
	out_reqs  => [ "gp", "none", "none" ],
Matthias Braun's avatar
Matthias Braun committed
381
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
382
383
	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
384
385
386
	emit      => "movs%Mq %AM, %^D0",
},

387
mov_gp => {
Matthias Braun's avatar
Matthias Braun committed
388
	state     => "exc_pinned",
389
	in_reqs   => "...",
390
	out_reqs  => [ "gp", "none", "none" ],
Matthias Braun's avatar
Matthias Braun committed
391
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
392
393
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
394
},
395

396
ijmp => {
397
398
	state     => "pinned",
	op_flags  => [ "cfopcode", "unknown_jump" ],
399
	in_reqs   => "...",
400
	out_reqs  => [ "none", "none", "none" ],
401
	outs      => [ "X", "unused", "M" ],
402
	attr_type => "amd64_addr_attr_t",
403
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
404
	emit      => "jmp %*AM",
405
406
},

407
jmp => {
Matthias Braun's avatar
Matthias Braun committed
408
409
	state    => "pinned",
	op_flags => [ "cfopcode" ],
410
	out_reqs => [ "none" ],
Matthias Braun's avatar
Matthias Braun committed
411
412
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_IMM32;",
	mode     => "mode_X",
413
},
414

415
cmp => {
416
	irn_flags => [ "rematerializable" ],
417
	state     => "exc_pinned",
418
	in_reqs   => "...",
419
	out_reqs  => [ "none", "flags", "none" ],
Matthias Braun's avatar
Matthias Braun committed
420
	outs      => [ "dummy", "flags", "M" ],
Matthias Braun's avatar
Matthias Braun committed
421
422
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
Matthias Braun's avatar
Matthias Braun committed
423
	emit      => "cmp%M %AM",
424
	modified_flags => $status_flags,
425
},
426

427
lea => {
Matthias Braun's avatar
Matthias Braun committed
428
	irn_flags => [ "rematerializable" ],
429
	in_reqs   => "...",
430
	outs      => [ "res" ],
431
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
432
433
434
	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
435
	emit      => "lea%M %A, %D0",
436
	mode      => $mode_gp,
Matthias Braun's avatar
Matthias Braun committed
437
438
},

439
jcc => {
440
	state     => "pinned",
441
	op_flags  => [ "cfopcode", "forking" ],
442
443
	in_reqs   => [ "eflags" ],
	out_reqs  => [ "none", "none" ],
444
445
	ins       => [ "eflags" ],
	outs      => [ "false", "true" ],
446
	attr_type => "amd64_cc_attr_t",
Matthias Braun's avatar
Matthias Braun committed
447
448
	attr      => "x86_condition_code_t cc",
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
449
},
450

451
mov_store => {
452
	op_flags  => [ "uses_memory" ],
453
	state     => "exc_pinned",
454
	in_reqs   => "...",
455
	out_reqs  => [ "none" ],
456
	outs      => [ "M" ],
Matthias Braun's avatar
Matthias Braun committed
457
458
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
Matthias Braun's avatar
Matthias Braun committed
459
460
	mode      => "mode_M",
	emit      => "mov%M %S0, %A",
461
},
462

463
jmp_switch => {
Matthias Braun's avatar
Matthias Braun committed
464
465
	op_flags  => [ "cfopcode", "forking" ],
	state     => "pinned",
466
	in_reqs   => [ "gp" ],
467
	out_reqs  => "...",
Matthias Braun's avatar
Matthias Braun committed
468
469
470
	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",
471
472
},

473
call => {
474
	state     => "exc_pinned",
475
	in_reqs   => "...",
476
	out_reqs  => "...",
Matthias Braun's avatar
Matthias Braun committed
477
478
479
	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",
480
	emit      => "call %*AM",
481
	modified_flags => $all_flags,
482
483
},

484
start => {
485
	irn_flags => [ "schedule_first" ],
486
	state     => "pinned",
487
	out_reqs  => "...",
488
	ins       => [],
Matthias Braun's avatar
Matthias Braun committed
489
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
490
	emit      => "",
491
492
},

493
ret => {
Matthias Braun's avatar
Matthias Braun committed
494
	state    => "pinned",
495
	op_flags => [ "cfopcode" ],
496
	in_reqs  => "...",
497
	out_reqs => [ "none" ],
Matthias Braun's avatar
Matthias Braun committed
498
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
499
	mode     => "mode_X",
500
	emit     => "ret",
501
502
},

503
504
# SSE

505
adds => {
506
507
	template => $binopx_commutative,
	emit     => "adds%MX %AM",
508
509
},

510
divs => {
511
512
	template => $binopx,
	emit     => "divs%MX %AM",
513
514
},

515
movs_xmm => {
516
517
518
	template => $movopx,
	attr     => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	emit     => "movs%MX %AM, %D0",
519
520
},

521
muls => {
522
523
	template => $binopx_commutative,
	emit     => "muls%MX %AM",
Tobias Rapp's avatar
Tobias Rapp committed
524
525
},

526
movs_store_xmm => {
527
528
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
529
	in_reqs   => "...",
530
	out_reqs  => [ "none" ],
531
532
533
534
	outs      => [ "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	mode      => "mode_M",
535
	emit      => "movs%MX %^S0, %A",
536
537
},

538
subs => {
539
540
	template => $binopx,
	emit     => "subs%MX %AM",
541
542
},

543
ucomis => {
Tobias Rapp's avatar
Tobias Rapp committed
544
545
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
546
	in_reqs   => "...",
547
	out_reqs  => [ "none", "flags", "none" ],
Tobias Rapp's avatar
Tobias Rapp committed
548
549
550
551
552
553
554
	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,
},

555
xorpd_0 => {
556
557
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
558
	out_reqs  => [ "xmm" ],
559
560
	outs      => [ "res" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
561
	emit      => "xorpd %^D0, %^D0",
562
563
564
	mode      => $mode_xmm,
},

565
xorp  => {
566
567
	template => $binopx_commutative,
	emit     => "xorp%MX %AM",
568
569
},

570
571
# Conversion operations

572
cvtss2sd => {
573
574
	template => $cvtop2x,
	emit     => "cvtss2sd %AM, %^D0",
575
576
},

577
cvtsd2ss => {
578
579
580
581
	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",
582
583
},

584
cvttsd2si => {
585
586
	template => $cvtopx2i,
	emit     => "cvttsd2si %AM, %D0",
587
588
},

589
cvttss2si => {
590
591
	template => $cvtopx2i,
	emit     => "cvttss2si %AM, %D0",
592
593
},

594
cvtsi2ss => {
595
596
	template => $cvtop2x,
	emit     => "cvtsi2ss %AM, %^D0",
597
598
},

599
cvtsi2sd => {
600
601
	template => $cvtop2x,
	emit     => "cvtsi2sd %AM, %^D0",
602
603
},

604
movq => {
605
606
607
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_64;\n",
	emit     => "movq %AM, %D0",
608
609
},

610
movdqa => {
611
612
613
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqa %AM, %D0",
614
615
},

616
movdqu => {
617
618
619
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqu %AM, %D0",
620
621
622
623
624
},

movdqu_store => {
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
625
	in_reqs   => "...",
626
	out_reqs  => [ "none" ],
627
628
629
630
631
632
633
	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",
},

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
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 => {
659
660
	template => $binopx,
	emit     => "punpckldq %AM",
661
662
663
},

subpd => {
664
665
	template => $binopx,
	emit     => "subpd %AM",
666
667
668
},

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

673
);