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

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

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

my $divop = {
101
102
103
	irn_flags => [ "modify_flags" ],
	state     => "pinned",
	in_reqs   => "...",
104
	out_reqs  => [ "rax", "flags", "mem", "rdx" ],
105
106
107
	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"
108
	            ."amd64_op_mode_t op_mode = AMD64_OP_REG;\n",
109
	attr      => "amd64_insn_mode_t insn_mode",
110
111
112
113
114
115
116
};

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

my $shiftop = {
127
128
129
130
131
132
	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",
133
134
135
};

my $unop = {
136
137
	irn_flags => [ "modify_flags", "rematerializable" ],
	in_reqs   => [ "gp" ],
138
	out_reqs  => [ "in_r0", "flags" ],
139
140
141
142
	ins       => [ "val" ],
	outs      => [ "res", "flags" ],
	attr_type => "amd64_addr_attr_t",
	attr      => "amd64_insn_mode_t insn_mode",
143
	fixed     => "amd64_op_mode_t op_mode = AMD64_OP_REG;\n"
144
	            ."amd64_addr_t addr = { { NULL, 0, X86_IMM_VALUE }, NO_INPUT, NO_INPUT, NO_INPUT, 0, AMD64_SEGMENT_DEFAULT };",
145
146
147
148
149
};

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

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

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

218
pop_am => {
219
220
	op_flags  => [ "uses_memory" ],
	state     => "exc_pinned",
221
	in_reqs   => "...",
222
	out_reqs  => [ "rsp:I", "mem" ],
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      => "pop%M %A",
228
},
229

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

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

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

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

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

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

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

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

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

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

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

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

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

307
sub => {
308
	template  => $binop,
yb9976's avatar
yb9976 committed
309
	irn_flags => [ "modify_flags", "rematerializable" ],
310
	emit      => "sub%M %AM",
311
},
312

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

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

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

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

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

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

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

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

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

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

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

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

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

421
mov_store => {
422
	op_flags  => [ "uses_memory" ],
423
	state     => "exc_pinned",
424
	in_reqs   => "...",
425
	out_reqs  => [ "mem" ],
426
	outs      => [ "M" ],
Matthias Braun's avatar
Matthias Braun committed
427
428
	attr_type => "amd64_binop_addr_attr_t",
	attr      => "const amd64_binop_addr_attr_t *attr_init",
429
	emit      => "mov%M %AM",
430
},
431

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

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

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

463
464
# SSE

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

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

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

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

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

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

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

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

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

527
528
529
530
movd_xmm_gp => {
	state     => "exc_pinned",
	ins       => [ "operand" ],
	outs      => [ "res" ],
531
	in_reqs   => [ "xmm" ],
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
	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"
},

549
550
# Conversion operations

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

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

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

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

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

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

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

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

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

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

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

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

haddpd => {
647
648
	template => $binopx,
	emit     => "haddpd %AM",
649
650
},

651
);