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

3
4
5
$mode_gp    = "mode_Lu";
$mode_flags = "mode_Iu";
$mode_xmm   = "amd64_mode_xmm";
6

7
8
%reg_classes = (
	gp => [
9
10
11
12
13
14
15
		{ 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 },
16
		{ name => "rsp", dwarf => 7 },
17
18
19
20
21
22
23
24
		{ 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 },
25
		{ mode => $mode_gp }
26
	],
27
	flags => [
28
		{ name => "eflags", dwarf => 49 },
29
		{ mode => $mode_flags, flags => "manual_ra" }
30
	],
31
	xmm => [
Matthias Braun's avatar
Matthias Braun committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
		{ 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 },
48
49
		{ mode => $mode_xmm }
	]
50
51
);

52
53
54
55
%custom_irn_flags = (
	commutative => "(arch_irn_flags_t)amd64_arch_irn_flag_commutative_binop",
);

56
57
$default_copy_attr = "amd64_copy_attr";

58
%init_attr = (
Matthias Braun's avatar
Matthias Braun committed
59
	amd64_attr_t =>
60
		"init_amd64_attributes(res, irn_flags, in_reqs, n_res, op_mode);",
Matthias Braun's avatar
Matthias Braun committed
61
	amd64_addr_attr_t =>
62
		"init_amd64_attributes(res, irn_flags, in_reqs, n_res, op_mode);\n"
Matthias Braun's avatar
Matthias Braun committed
63
64
65
		."\tattr->insn_mode = insn_mode;\n"
		."\tattr->addr = addr;",
	amd64_binop_addr_attr_t =>
66
		"be_info_init_irn(res, irn_flags, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
67
		."\t*attr = *attr_init;",
68
	amd64_switch_jmp_attr_t =>
69
		"init_amd64_attributes(res, irn_flags, in_reqs, n_res, AMD64_OP_NONE);\n"
Matthias Braun's avatar
Matthias Braun committed
70
		."\tinit_amd64_switch_attributes(res, table, table_entity);",
71
	amd64_cc_attr_t =>
72
		"init_amd64_attributes(res, irn_flags, in_reqs, n_res, AMD64_OP_NONE);\n"
Matthias Braun's avatar
Matthias Braun committed
73
		."\tinit_amd64_cc_attributes(res, cc);",
74
	amd64_movimm_attr_t =>
75
		"init_amd64_attributes(res, irn_flags, in_reqs, n_res, AMD64_OP_IMM64);\n"
Matthias Braun's avatar
Matthias Braun committed
76
		."\tinit_amd64_movimm_attributes(res, insn_mode, imm);",
Matthias Braun's avatar
Matthias Braun committed
77
	amd64_shift_attr_t =>
78
		"be_info_init_irn(res, irn_flags, in_reqs, n_res);\n"
Matthias Braun's avatar
Matthias Braun committed
79
		."\t*attr = *attr_init;\n",
80
81
);

82
my $binop = {
83
84
85
	irn_flags => [ "modify_flags" ],
	state     => "exc_pinned",
	in_reqs   => "...",
86
	out_reqs  => [ "gp", "flags", "mem" ],
87
88
89
	outs      => [ "res", "flags", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
90
91
92
};

my $binop_commutative = {
93
94
95
	irn_flags => [ "modify_flags", "rematerializable", "commutative" ],
	state     => "exc_pinned",
	in_reqs   => "...",
96
	out_reqs  => [ "gp", "flags", "mem" ],
97
98
99
	outs      => [ "res", "flags", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
100
101
102
};

my $divop = {
103
104
105
	irn_flags => [ "modify_flags" ],
	state     => "pinned",
	in_reqs   => "...",
106
	out_reqs  => [ "rax", "flags", "mem", "rdx" ],
107
108
109
110
111
	outs      => [ "res_div", "flags", "M", "res_mod" ],
	attr_type => "amd64_addr_attr_t",
	fixed     => "amd64_addr_t addr = { { NULL, 0, X86_IMM_VALUE }, 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",
112
113
114
115
116
117
118
};

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
119
120
121
	irn_flags => [ "modify_flags" ],
	state     => "exc_pinned",
	in_reqs   => "...",
122
	out_reqs  => [ "rax", "flags", "mem", "rdx" ],
123
124
125
	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",
126
127
128
};

my $shiftop = {
129
130
131
132
133
134
	irn_flags => [ "modify_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",
135
136
137
};

my $unop = {
138
139
140
141
142
143
144
145
146
	irn_flags => [ "modify_flags", "rematerializable" ],
	in_reqs   => [ "gp" ],
	out_reqs  => [ "in_r1", "flags" ],
	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, X86_IMM_VALUE }, NO_INPUT, NO_INPUT, NO_INPUT, 0, AMD64_SEGMENT_DEFAULT };",
147
148
149
150
151
};

my $binopx = {
	irn_flags => [ "rematerializable" ],
	state     => "exc_pinned",
152
	in_reqs   => "...",
153
	out_reqs  => [ "xmm", "none", "mem" ],
154
155
156
157
158
159
160
161
	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",
162
	in_reqs   => "...",
163
	out_reqs  => [ "xmm", "none", "mem" ],
164
165
166
167
168
169
170
	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",
171
	in_reqs   => "...",
172
	out_reqs  => [ "xmm", "none", "mem" ],
173
174
175
176
177
178
179
	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",
180
	in_reqs   => "...",
181
	out_reqs  => [ "gp", "none", "mem" ],
182
183
184
185
186
187
188
	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",
189
	in_reqs   => "...",
190
	outs      => [ "res", "none", "M" ],
191
	out_reqs  => [ "xmm", "none", "mem" ],
192
193
194
195
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_op_mode_t op_mode, amd64_addr_t addr",
};

196
%nodes = (
197
push_am => {
198
	op_flags  => [ "uses_memory" ],
199
	state     => "exc_pinned",
200
	in_reqs   => "...",
201
	out_reqs  => [ "rsp:I", "mem" ],
202
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
203
204
205
	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
206
	emit      => "push%M %A",
207
208
},

209
push_reg => {
210
211
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
212
213
214
215
	in_reqs   => [ "rsp",   "mem", "gp"  ],
	ins       => [ "stack", "mem", "val" ],
	out_reqs  => [ "rsp:I", "mem" ],
	outs      => [ "stack", "M"   ],
216
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
217
	emit      => "pushq %^S2",
218
219
},

220
pop_am => {
221
222
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
223
	in_reqs   => "...",
224
	out_reqs  => [ "rsp:I", "mem" ],
225
	outs      => [ "stack", "M" ],
Matthias Braun's avatar
Matthias Braun committed
226
227
228
	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
229
	emit      => "pop%M %A",
230
},
231

232
sub_sp => {
233
	irn_flags => [ "modify_flags" ],
Tobias Rapp's avatar
Tobias Rapp committed
234
	state     => "pinned",
235
	in_reqs   => "...",
236
	out_reqs  => [ "rsp:I", "gp", "mem" ],
Tobias Rapp's avatar
Tobias Rapp committed
237
238
239
240
241
242
243
	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",
},

244
leave => {
245
246
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
247
248
249
	in_reqs   => [ "rbp", "mem" ],
	out_reqs  => [ "rbp:I", "mem", "rsp:I" ],
	outs      => [ "frame", "M",   "stack" ],
250
251
252
253
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
	emit      => "leave",
},

254
add => {
255
256
	template => $binop_commutative,
	emit     => "add%M %AM",
257
},
258

259
and => {
260
261
	template => $binop_commutative,
	emit     => "and%M %AM",
262
},
Matthias Braun's avatar
Matthias Braun committed
263

264
div => {
265
266
	template => $divop,
	emit     => "div%M %AM",
Matthias Braun's avatar
Matthias Braun committed
267
268
},

269
idiv => {
270
271
	template => $divop,
	emit     => "idiv%M %AM",
Matthias Braun's avatar
Matthias Braun committed
272
273
},

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

279
imul_1op => {
280
281
	template => $mulop,
	emit     => "imul%M %AM",
282
283
},

284
mul => {
285
286
	template => $mulop,
	emit     => "mul%M %AM",
287
288
},

289
or => {
290
291
	template => $binop_commutative,
	emit     => "or%M %AM",
292
293
},

294
shl => {
295
296
	template => $shiftop,
	emit     => "shl%MS %SO",
297
298
},

299
shr => {
300
301
	template => $shiftop,
	emit     => "shr%MS %SO",
302
303
},

304
sar => {
305
306
	template => $shiftop,
	emit     => "sar%MS %SO",
307
308
},

309
sub => {
310
	template  => $binop,
Matthias Braun's avatar
Matthias Braun committed
311
	irn_flags => [ "rematerializable" ],
312
	emit      => "sub%M %AM",
313
},
314

315
sbb => {
316
317
	template => $binop,
	emit     => "sbb%M %AM",
318
319
},

320
neg => {
321
322
	template => $unop,
	emit     => "neg%M %AM",
323
},
324

325
not => {
326
327
	template => $unop,
	emit     => "not%M %AM",
Christoph Mallon's avatar
Christoph Mallon committed
328
329
},

330
xor => {
331
332
	template => $binop_commutative,
	emit     => "xor%M %AM",
333
334
},

335
xor_0 => {
Matthias Braun's avatar
Matthias Braun committed
336
	op_flags  => [ "constlike" ],
337
	irn_flags => [ "modify_flags", "rematerializable" ],
338
	out_reqs  => [ "gp", "flags" ],
339
	outs      => [ "res", "flags" ],
Matthias Braun's avatar
Matthias Braun committed
340
341
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
	emit      => "xorl %3D0, %3D0",
Matthias Braun's avatar
Matthias Braun committed
342
343
},

344
mov_imm => {
345
	op_flags  => [ "constlike" ],
346
	irn_flags => [ "rematerializable" ],
347
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
348
	attr_type => "amd64_movimm_attr_t",
Matthias Braun's avatar
Matthias Braun committed
349
	attr      => "amd64_insn_mode_t insn_mode, const amd64_imm64_t *imm",
Matthias Braun's avatar
Matthias Braun committed
350
	emit      => 'mov%MM $%C, %D0',
351
},
352

353
movs => {
354
	state     => "exc_pinned",
355
	in_reqs   => "...",
356
	out_reqs  => [ "gp", "none", "mem" ],
Matthias Braun's avatar
Matthias Braun committed
357
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
358
359
	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
360
361
362
	emit      => "movs%Mq %AM, %^D0",
},

363
mov_gp => {
Matthias Braun's avatar
Matthias Braun committed
364
	state     => "exc_pinned",
365
	in_reqs   => "...",
366
	out_reqs  => [ "gp", "none", "mem" ],
Matthias Braun's avatar
Matthias Braun committed
367
	outs      => [ "res", "unused", "M" ],
Matthias Braun's avatar
Matthias Braun committed
368
369
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
370
},
371

372
ijmp => {
373
374
	state     => "pinned",
	op_flags  => [ "cfopcode", "unknown_jump" ],
375
	in_reqs   => "...",
376
	out_reqs  => [ "exec", "none", "mem" ],
377
	outs      => [ "X", "unused", "M" ],
378
	attr_type => "amd64_addr_attr_t",
379
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
380
	emit      => "jmp %*AM",
381
382
},

383
jmp => {
Matthias Braun's avatar
Matthias Braun committed
384
385
	state    => "pinned",
	op_flags => [ "cfopcode" ],
386
	out_reqs => [ "exec" ],
Matthias Braun's avatar
Matthias Braun committed
387
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_IMM32;",
388
},
389

390
cmp => {
391
	irn_flags => [ "modify_flags", "rematerializable" ],
392
	state     => "exc_pinned",
393
	in_reqs   => "...",
394
	out_reqs  => [ "none", "flags", "mem" ],
Matthias Braun's avatar
Matthias Braun committed
395
	outs      => [ "dummy", "flags", "M" ],
Matthias Braun's avatar
Matthias Braun committed
396
397
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
Matthias Braun's avatar
Matthias Braun committed
398
	emit      => "cmp%M %AM",
399
},
400

401
lea => {
Matthias Braun's avatar
Matthias Braun committed
402
	irn_flags => [ "rematerializable" ],
403
	in_reqs   => "...",
404
	outs      => [ "res" ],
405
	out_reqs  => [ "gp" ],
Matthias Braun's avatar
Matthias Braun committed
406
407
408
	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
409
	emit      => "lea%M %A, %D0",
Matthias Braun's avatar
Matthias Braun committed
410
411
},

412
jcc => {
413
	state     => "pinned",
414
	op_flags  => [ "cfopcode", "forking" ],
415
	in_reqs   => [ "eflags" ],
416
	out_reqs  => [ "exec", "exec" ],
417
418
	ins       => [ "eflags" ],
	outs      => [ "false", "true" ],
419
	attr_type => "amd64_cc_attr_t",
Matthias Braun's avatar
Matthias Braun committed
420
	attr      => "x86_condition_code_t cc",
421
},
422

423
mov_store => {
424
	op_flags  => [ "uses_memory" ],
425
	state     => "exc_pinned",
426
	in_reqs   => "...",
427
	out_reqs  => [ "mem" ],
428
	outs      => [ "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",
431
	emit      => "mov%M %AM",
432
},
433

434
jmp_switch => {
Matthias Braun's avatar
Matthias Braun committed
435
436
	op_flags  => [ "cfopcode", "forking" ],
	state     => "pinned",
437
	in_reqs   => [ "gp" ],
438
	out_reqs  => "...",
Matthias Braun's avatar
Matthias Braun committed
439
440
	attr_type => "amd64_switch_jmp_attr_t",
	attr      => "const ir_switch_table *table, ir_entity *table_entity",
441
442
},

443
call => {
444
	irn_flags => [ "modify_flags" ],
445
	state     => "exc_pinned",
446
	in_reqs   => "...",
447
	out_reqs  => "...",
448
	outs      => [ "M", "stack", "flags", "first_result" ],
Matthias Braun's avatar
Matthias Braun committed
449
450
451
	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",
452
	emit      => "call %*AM",
453
454
},

455
ret => {
Matthias Braun's avatar
Matthias Braun committed
456
	state    => "pinned",
457
	op_flags => [ "cfopcode" ],
458
	in_reqs  => "...",
459
	out_reqs => [ "exec" ],
460
	ins      => [ "mem", "stack", "first_result" ],
Matthias Braun's avatar
Matthias Braun committed
461
	fixed    => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
462
	emit     => "ret",
463
464
},

465
466
# SSE

467
adds => {
468
469
	template => $binopx_commutative,
	emit     => "adds%MX %AM",
470
471
},

472
divs => {
473
474
	template => $binopx,
	emit     => "divs%MX %AM",
475
476
},

477
movs_xmm => {
478
479
480
	template => $movopx,
	attr     => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	emit     => "movs%MX %AM, %D0",
481
482
},

483
muls => {
484
485
	template => $binopx_commutative,
	emit     => "muls%MX %AM",
Tobias Rapp's avatar
Tobias Rapp committed
486
487
},

488
movs_store_xmm => {
489
490
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
491
	in_reqs   => "...",
492
	out_reqs  => [ "mem" ],
493
494
495
	outs      => [ "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
496
	emit      => "movs%MX %^S0, %A",
497
498
},

499
subs => {
500
501
	template => $binopx,
	emit     => "subs%MX %AM",
502
503
},

504
ucomis => {
505
	irn_flags => [ "modify_flags", "rematerializable" ],
Tobias Rapp's avatar
Tobias Rapp committed
506
	state     => "exc_pinned",
507
	in_reqs   => "...",
508
	out_reqs  => [ "none", "flags", "mem" ],
Tobias Rapp's avatar
Tobias Rapp committed
509
510
511
512
513
514
	outs      => [ "dummy", "flags", "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	emit      => "ucomis%MX %AM",
},

515
xorpd_0 => {
516
517
	op_flags  => [ "constlike" ],
	irn_flags => [ "rematerializable" ],
518
	out_reqs  => [ "xmm" ],
519
520
	outs      => [ "res" ],
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG_REG;",
521
	emit      => "xorpd %^D0, %^D0",
522
523
},

524
xorp => {
525
526
	template => $binopx_commutative,
	emit     => "xorp%MX %AM",
527
528
},

529
530
531
532
movd_xmm_gp => {
	state     => "exc_pinned",
	ins       => [ "operand" ],
	outs      => [ "res" ],
533
	in_reqs   => [ "xmm" ],
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
	out_reqs  => [ "gp" ],
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	emit      => "movd %S0, %D0"
},

movd_gp_xmm => {
	state     => "exc_pinned",
	ins       => [ "operand" ],
	outs      => [ "res" ],
	in_reqs   => [ "gp" ],
	out_reqs  => [ "xmm" ],
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
	emit      => "movd %S0, %D0"
},

551
552
# Conversion operations

553
cvtss2sd => {
554
555
	template => $cvtop2x,
	emit     => "cvtss2sd %AM, %^D0",
556
557
},

558
cvtsd2ss => {
559
560
561
562
	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",
563
564
},

565
cvttsd2si => {
566
567
	template => $cvtopx2i,
	emit     => "cvttsd2si %AM, %D0",
568
569
},

570
cvttss2si => {
571
572
	template => $cvtopx2i,
	emit     => "cvttss2si %AM, %D0",
573
574
},

575
cvtsi2ss => {
576
577
	template => $cvtop2x,
	emit     => "cvtsi2ss %AM, %^D0",
578
579
},

580
cvtsi2sd => {
581
582
	template => $cvtop2x,
	emit     => "cvtsi2sd %AM, %^D0",
583
584
},

585
movq => {
586
587
588
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_64;\n",
	emit     => "movq %AM, %D0",
589
590
},

591
movdqa => {
592
593
594
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqa %AM, %D0",
595
596
},

597
movdqu => {
598
599
600
	template => $movopx,
	fixed    => "amd64_insn_mode_t insn_mode = INSN_MODE_128;\n",
	emit     => "movdqu %AM, %D0",
601
602
603
604
605
},

movdqu_store => {
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
606
	in_reqs   => "...",
607
	out_reqs  => [ "mem" ],
608
609
610
611
612
613
	outs      => [ "M" ],
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
	emit      => "movdqu %^S0, %A",
},

614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
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 => {
639
640
	template => $binopx,
	emit     => "punpckldq %AM",
641
642
643
},

subpd => {
644
645
	template => $binopx,
	emit     => "subpd %AM",
646
647
648
},

haddpd => {
649
650
	template => $binopx,
	emit     => "haddpd %AM",
651
652
},

653
);