• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple x86_64-unknown-unknown -show-encoding %s > %t 2> %t.err
2// RUN: FileCheck < %t %s
3// RUN: FileCheck --check-prefix=CHECK-STDERR < %t.err %s
4
5	monitor
6// CHECK: monitor
7// CHECK: encoding: [0x0f,0x01,0xc8]
8	monitor %rax, %rcx, %rdx
9// CHECK: monitor
10// CHECK: encoding: [0x0f,0x01,0xc8]
11	mwait
12// CHECK: mwait
13// CHECK: encoding: [0x0f,0x01,0xc9]
14	mwait %rax, %rcx
15// CHECK: mwait
16// CHECK: encoding: [0x0f,0x01,0xc9]
17
18// Suffix inference:
19
20// CHECK: addl $0, %eax
21        add $0, %eax
22// CHECK: addb $255, %al
23        add $0xFF, %al
24// CHECK: orq %rax, %rdx
25        or %rax, %rdx
26// CHECK: shlq $3, %rax
27        shl $3, %rax
28
29
30// CHECK: subb %al, %al
31        subb %al, %al
32
33// CHECK: addl $24, %eax
34        addl $24, %eax
35
36// CHECK: movl %eax, 10(%ebp)
37        movl %eax, 10(%ebp)
38// CHECK: movl %eax, 10(%ebp,%ebx)
39        movl %eax, 10(%ebp, %ebx)
40// CHECK: movl %eax, 10(%ebp,%ebx,4)
41        movl %eax, 10(%ebp, %ebx, 4)
42// CHECK: movl %eax, 10(,%ebx,4)
43        movl %eax, 10(, %ebx, 4)
44
45// CHECK: movl 0, %eax
46        movl 0, %eax
47// CHECK: movl $0, %eax
48        movl $0, %eax
49
50// CHECK: ret
51        ret
52
53// CHECK: retw
54        retw
55
56// FIXME: Check that this matches SUB32ri8
57// CHECK: subl $1, %eax
58        subl $1, %eax
59
60// FIXME: Check that this matches SUB32ri8
61// CHECK: subl $-1, %eax
62        subl $-1, %eax
63
64// FIXME: Check that this matches SUB32ri
65// CHECK: subl $256, %eax
66        subl $256, %eax
67
68// FIXME: Check that this matches XOR64ri8
69// CHECK: xorq $1, %rax
70        xorq $1, %rax
71
72// FIXME: Check that this matches XOR64ri32
73// CHECK: xorq $256, %rax
74        xorq $256, %rax
75
76// FIXME: Check that this matches SUB8rr
77// CHECK: subb %al, %bl
78        subb %al, %bl
79
80// FIXME: Check that this matches SUB16rr
81// CHECK: subw %ax, %bx
82        subw %ax, %bx
83
84// FIXME: Check that this matches SUB32rr
85// CHECK: subl %eax, %ebx
86        subl %eax, %ebx
87
88// FIXME: Check that this matches the correct instruction.
89// CHECK: callq *%rax
90        call *%rax
91
92// FIXME: Check that this matches the correct instruction.
93// CHECK: shldl %cl, %eax, %ebx
94        shldl %cl, %eax, %ebx
95
96// CHECK: shll $2, %eax
97        shll $2, %eax
98
99// CHECK: shll $2, %eax
100        sall $2, %eax
101
102// CHECK: rep
103// CHECK: insb
104        rep;insb
105
106// CHECK: rep
107// CHECK: outsb
108        rep;outsb
109
110// CHECK: rep
111// CHECK: movsb
112        rep;movsb
113
114
115// rdar://8470918
116smovb // CHECK: movsb
117smovw // CHECK: movsw
118smovl // CHECK: movsl
119smovq // CHECK: movsq
120
121// rdar://8456361
122// CHECK: rep
123// CHECK: movsl
124        rep movsd
125
126// CHECK: rep
127// CHECK: lodsb
128        rep;lodsb
129
130// CHECK: rep
131// CHECK: stosb
132        rep;stosb
133
134// NOTE: repz and repe have the same opcode as rep
135// CHECK: rep
136// CHECK: cmpsb
137        repz;cmpsb
138
139// NOTE: repnz has the same opcode as repne
140// CHECK: repne
141// CHECK: cmpsb
142        repnz;cmpsb
143
144// NOTE: repe and repz have the same opcode as rep
145// CHECK: rep
146// CHECK: scasb
147        repe;scasb
148
149// CHECK: repne
150// CHECK: scasb
151        repne;scasb
152
153// CHECK: lock
154// CHECK: cmpxchgb %al, (%ebx)
155        lock;cmpxchgb %al, 0(%ebx)
156
157// CHECK: cs
158// CHECK: movb (%eax), %al
159        cs;movb 0(%eax), %al
160
161// CHECK: ss
162// CHECK: movb (%eax), %al
163        ss;movb 0(%eax), %al
164
165// CHECK: ds
166// CHECK: movb (%eax), %al
167        ds;movb 0(%eax), %al
168
169// CHECK: es
170// CHECK: movb (%eax), %al
171        es;movb 0(%eax), %al
172
173// CHECK: fs
174// CHECK: movb (%eax), %al
175        fs;movb 0(%eax), %al
176
177// CHECK: gs
178// CHECK: movb (%eax), %al
179        gs;movb 0(%eax), %al
180
181// CHECK: fadd %st(0)
182// CHECK: fadd %st(1)
183// CHECK: fadd %st(7)
184
185fadd %st(0)
186fadd %st(1)
187fadd %st(7)
188
189// CHECK: leal 0, %eax
190        leal 0, %eax
191
192// rdar://7986634 - Insensitivity on opcodes.
193// CHECK: int3
194INT3
195
196// rdar://8735979 - int $3 -> int3
197// CHECK: int3
198int	$3
199
200
201// Allow scale factor without index register.
202// CHECK: movaps	%xmm3, (%esi)
203// CHECK-STDERR: warning: scale factor without index register is ignored
204movaps %xmm3, (%esi, 2)
205
206// CHECK: imull $12, %eax
207imul $12, %eax
208
209// CHECK: imull %ecx, %eax
210imull %ecx, %eax
211
212
213// rdar://8208481
214// CHECK: outb	%al, $161
215outb	%al, $161
216// CHECK: outw	%ax, $128
217outw	%ax, $128
218// CHECK: inb	$161, %al
219inb	$161, %al
220
221// rdar://8017621
222// CHECK: pushq	$1
223push $1
224
225// rdar://9716860
226pushq $1
227// CHECK: encoding: [0x6a,0x01]
228pushq $1111111
229// CHECK: encoding: [0x68,0x47,0xf4,0x10,0x00]
230
231// rdar://8017530
232// CHECK: sldtw	4
233sldt	4
234
235// rdar://8208499
236// CHECK: cmovnew	%bx, %ax
237cmovnz %bx, %ax
238// CHECK: cmovneq	%rbx, %rax
239cmovnzq %rbx, %rax
240
241
242// rdar://8407928
243// CHECK: inb	$127, %al
244// CHECK: inw	%dx, %ax
245// CHECK: outb	%al, $127
246// CHECK: outw	%ax, %dx
247// CHECK: inl	%dx, %eax
248inb	$0x7f
249inw	%dx
250outb	$0x7f
251outw	%dx
252inl	%dx
253
254
255// PR8114
256// CHECK: outb	%al, %dx
257// CHECK: outb	%al, %dx
258// CHECK: outw	%ax, %dx
259// CHECK: outw	%ax, %dx
260// CHECK: outl	%eax, %dx
261// CHECK: outl	%eax, %dx
262
263out	%al, (%dx)
264outb	%al, (%dx)
265out	%ax, (%dx)
266outw	%ax, (%dx)
267out	%eax, (%dx)
268outl	%eax, (%dx)
269
270// CHECK: inb	%dx, %al
271// CHECK: inb	%dx, %al
272// CHECK: inw	%dx, %ax
273// CHECK: inw	%dx, %ax
274// CHECK: inl	%dx, %eax
275// CHECK: inl	%dx, %eax
276
277in	(%dx), %al
278inb	(%dx), %al
279in	(%dx), %ax
280inw	(%dx), %ax
281in	(%dx), %eax
282inl	(%dx), %eax
283
284//PR15455
285
286// permitted invalid memory forms
287outs	(%rsi), (%dx)
288// CHECK: outsw	(%rsi), %dx
289outsb	(%rsi), (%dx)
290// CHECK: outsb	(%rsi), %dx
291outsw	(%rsi), (%dx)
292// CHECK: outsw	(%rsi), %dx
293outsl	(%rsi), (%dx)
294// CHECK: outsl	(%rsi), %dx
295
296ins	(%dx), %es:(%rdi)
297// CHECK: insw	%dx, %es:(%rdi)
298insb	(%dx), %es:(%rdi)
299// CHECK: insb	%dx, %es:(%rdi)
300insw	(%dx), %es:(%rdi)
301// CHECK: insw	%dx, %es:(%rdi)
302insl	(%dx), %es:(%rdi)
303// CHECK: insl	%dx, %es:(%rdi)
304
305// rdar://8431422
306
307// CHECK: fxch %st(1)
308// CHECK: fucom %st(1)
309// CHECK: fucomp %st(1)
310// CHECK: faddp %st(1)
311// CHECK: faddp	%st(0)
312// CHECK: fsubp %st(1)
313// CHECK: fsubrp %st(1)
314// CHECK: fmulp %st(1)
315// CHECK: fdivp %st(1)
316// CHECK: fdivrp %st(1)
317
318fxch
319fucom
320fucomp
321faddp
322faddp %st
323fsubp
324fsubrp
325fmulp
326fdivp
327fdivrp
328
329// CHECK: fcomi %st(1)
330// CHECK: fcomi	%st(2)
331// CHECK: fucomi %st(1)
332// CHECK: fucomi %st(2)
333// CHECK: fucomi %st(2)
334
335fcomi
336fcomi	%st(2)
337fucomi
338fucomi	%st(2)
339fucomi	%st(2), %st
340
341// CHECK: fnstsw %ax
342// CHECK: fnstsw %ax
343// CHECK: fnstsw %ax
344// CHECK: fnstsw %ax
345
346fnstsw
347fnstsw %ax
348fnstsw %eax
349fnstsw %al
350
351// rdar://8431880
352// CHECK: rclb	%bl
353// CHECK: rcll	3735928559(%ebx,%ecx,8)
354// CHECK: rcrl	%ecx
355// CHECK: rcrl	305419896
356rcl	%bl
357rcll	0xdeadbeef(%ebx,%ecx,8)
358rcr	%ecx
359rcrl	0x12345678
360
361rclb	%bl       // CHECK: rclb %bl     # encoding: [0xd0,0xd3]
362rclb	$1, %bl   // CHECK: rclb %bl     # encoding: [0xd0,0xd3]
363rclb	$2, %bl   // CHECK: rclb $2, %bl # encoding: [0xc0,0xd3,0x02]
364
365// rdar://8418316
366// PR12173
367// CHECK: shldw	%cl, %bx, %dx
368// CHECK: shldw	%cl, %bx, %dx
369// CHECK: shldw	$1, %bx, %dx
370// CHECK: shldw	%cl, %bx, (%rax)
371// CHECK: shldw	%cl, %bx, (%rax)
372// CHECK: shrdw	%cl, %bx, %dx
373// CHECK: shrdw	%cl, %bx, %dx
374// CHECK: shrdw	$1, %bx, %dx
375// CHECK: shrdw	%cl, %bx, (%rax)
376// CHECK: shrdw	%cl, %bx, (%rax)
377
378shld  %bx, %dx
379shld  %cl, %bx, %dx
380shld  $1, %bx, %dx
381shld  %bx, (%rax)
382shld  %cl, %bx, (%rax)
383shrd  %bx, %dx
384shrd  %cl, %bx, %dx
385shrd  $1, %bx, %dx
386shrd  %bx, (%rax)
387shrd  %cl, %bx, (%rax)
388
389// CHECK: sldtl	%ecx
390// CHECK: encoding: [0x0f,0x00,0xc1]
391// CHECK: sldtw	%cx
392// CHECK: encoding: [0x66,0x0f,0x00,0xc1]
393
394sldt	%ecx
395sldt	%cx
396
397// CHECK: lcalll	*3135175374
398// CHECK: ljmpl	*3135175374
399lcall	*0xbadeface
400ljmp	*0xbadeface
401
402
403// rdar://8444631
404// CHECK: enter	$31438, $0
405// CHECK: encoding: [0xc8,0xce,0x7a,0x00]
406// CHECK: enter	$31438, $1
407// CHECK: encoding: [0xc8,0xce,0x7a,0x01]
408// CHECK: enter	$31438, $127
409// CHECK: encoding: [0xc8,0xce,0x7a,0x7f]
410enter $0x7ace,$0
411enter $0x7ace,$1
412enter $0x7ace,$0x7f
413
414
415// rdar://8456364
416// CHECK: movw	%cs, %ax
417mov %CS, %ax
418
419// rdar://8456391
420fcmovb %st(1), %st(0)   // CHECK: fcmovb	%st(1), %st(0)
421fcmove %st(1), %st(0)   // CHECK: fcmove	%st(1), %st(0)
422fcmovbe %st(1), %st(0)  // CHECK: fcmovbe	%st(1), %st(0)
423fcmovu %st(1), %st(0)   // CHECK: fcmovu	 %st(1), %st(0)
424
425fcmovnb %st(1), %st(0)  // CHECK: fcmovnb	%st(1), %st(0)
426fcmovne %st(1), %st(0)  // CHECK: fcmovne	%st(1), %st(0)
427fcmovnbe %st(1), %st(0) // CHECK: fcmovnbe	%st(1), %st(0)
428fcmovnu %st(1), %st(0)  // CHECK: fcmovnu	%st(1), %st(0)
429
430fcmovnae %st(1), %st(0) // CHECK: fcmovb	%st(1), %st(0)
431fcmovna %st(1), %st(0)  // CHECK: fcmovbe	%st(1), %st(0)
432
433fcmovae %st(1), %st(0)  // CHECK: fcmovnb	%st(1), %st(0)
434fcmova %st(1), %st(0)   // CHECK: fcmovnbe	%st(1), %st(0)
435
436// rdar://8456417
437.byte (88 + 1) & 15  // CHECK: .byte	9
438
439// rdar://8456412
440mov %rdx, %cr0
441// CHECK: movq	%rdx, %cr0
442// CHECK: encoding: [0x0f,0x22,0xc2]
443mov %rdx, %cr4
444// CHECK: movq	%rdx, %cr4
445// CHECK: encoding: [0x0f,0x22,0xe2]
446mov %rdx, %cr8
447// CHECK: movq	%rdx, %cr8
448// CHECK: encoding: [0x44,0x0f,0x22,0xc2]
449mov %rdx, %cr15
450// CHECK: movq	%rdx, %cr15
451// CHECK: encoding: [0x44,0x0f,0x22,0xfa]
452
453// rdar://8456371 - Handle commutable instructions written backward.
454// CHECK: 	faddp	%st(1)
455// CHECK:	fmulp	%st(2)
456faddp %st, %st(1)
457fmulp %st, %st(2)
458
459// rdar://8468087 - Encode these accurately, they are not synonyms.
460// CHECK: fmul	%st(0), %st(1)
461// CHECK: encoding: [0xdc,0xc9]
462// CHECK: fmul	%st(1)
463// CHECK: encoding: [0xd8,0xc9]
464fmul %st, %st(1)
465fmul %st(1), %st
466
467// CHECK: fadd	%st(0), %st(1)
468// CHECK: encoding: [0xdc,0xc1]
469// CHECK: fadd	%st(1)
470// CHECK: encoding: [0xd8,0xc1]
471fadd %st, %st(1)
472fadd %st(1), %st
473
474
475// rdar://8416805
476// CHECK: xorb	%al, %al
477// CHECK: encoding: [0x30,0xc0]
478// CHECK: xorw	%di, %di
479// CHECK: encoding: [0x66,0x31,0xff]
480// CHECK: xorl	%esi, %esi
481// CHECK: encoding: [0x31,0xf6]
482// CHECK: xorq	%rsi, %rsi
483// CHECK: encoding: [0x48,0x31,0xf6]
484clrb    %al
485clr    %di
486clr    %esi
487clr    %rsi
488
489// rdar://8456378
490cltq  // CHECK: cltq
491cdqe  // CHECK: cltq
492cwde  // CHECK: cwtl
493cwtl  // CHECK: cwtl
494
495// rdar://8416805
496cbw   // CHECK: cbtw
497cwd   // CHECK: cwtd
498cdq   // CHECK: cltd
499cqo   // CHECK: cqto
500
501// rdar://8456378 and PR7557 - fstsw
502fstsw %ax
503// CHECK: wait
504// CHECK: fnstsw
505fstsw (%rax)
506// CHECK: wait
507// CHECK: fnstsw (%rax)
508
509// PR8259
510fstcw (%rsp)
511// CHECK: wait
512// CHECK: fnstcw (%rsp)
513
514// PR8259
515fstcw (%rsp)
516// CHECK: wait
517// CHECK: fnstcw (%rsp)
518
519// PR8258
520finit
521// CHECK: wait
522// CHECK: fninit
523
524fsave	32493
525// CHECK: wait
526// CHECK: fnsave 32493
527
528
529// rdar://8456382 - cvtsd2si support.
530cvtsd2si	%xmm1, %rax
531// CHECK: cvtsd2si	%xmm1, %rax
532// CHECK: encoding: [0xf2,0x48,0x0f,0x2d,0xc1]
533cvtsd2si	%xmm1, %eax
534// CHECK: cvtsd2si	%xmm1, %eax
535// CHECK: encoding: [0xf2,0x0f,0x2d,0xc1]
536
537cvtsd2siq %xmm0, %rax // CHECK: cvtsd2si	%xmm0, %rax
538cvtsd2sil %xmm0, %eax // CHECK: cvtsd2si	%xmm0, %eax
539cvtsd2si %xmm0, %rax  // CHECK: cvtsd2si	%xmm0, %rax
540
541
542cvttpd2dq %xmm1, %xmm0  // CHECK: cvttpd2dq %xmm1, %xmm0
543cvttpd2dq (%rax), %xmm0 // CHECK: cvttpd2dq (%rax), %xmm0
544
545cvttps2dq %xmm1, %xmm0  // CHECK: cvttps2dq %xmm1, %xmm0
546cvttps2dq (%rax), %xmm0 // CHECK: cvttps2dq (%rax), %xmm0
547
548// rdar://8456376 - llvm-mc rejects 'roundss'
549roundss $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x0a,0xc0,0x0e]
550roundps $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x08,0xc0,0x0e]
551roundsd $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x0b,0xc0,0x0e]
552roundpd $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x09,0xc0,0x0e]
553
554
555// rdar://8482675 - 32-bit mem operand support in 64-bit mode (0x67 prefix)
556leal	8(%eax), %esi
557// CHECK: leal	8(%eax), %esi
558// CHECK: encoding: [0x67,0x8d,0x70,0x08]
559leaq	8(%eax), %rsi
560// CHECK: leaq	8(%eax), %rsi
561// CHECK: encoding: [0x67,0x48,0x8d,0x70,0x08]
562leaq	8(%rax), %rsi
563// CHECK: leaq	8(%rax), %rsi
564// CHECK: encoding: [0x48,0x8d,0x70,0x08]
565
566
567cvttpd2dq	0xdeadbeef(%ebx,%ecx,8),%xmm5
568// CHECK: cvttpd2dq	3735928559(%ebx,%ecx,8), %xmm5
569// CHECK: encoding: [0x67,0x66,0x0f,0xe6,0xac,0xcb,0xef,0xbe,0xad,0xde]
570
571// rdar://8490728 - llvm-mc rejects 'movmskpd'
572movmskpd	%xmm6, %rax
573// CHECK: movmskpd	%xmm6, %eax
574// CHECK: encoding: [0x66,0x0f,0x50,0xc6]
575movmskpd	%xmm6, %eax
576// CHECK: movmskpd	%xmm6, %eax
577// CHECK: encoding: [0x66,0x0f,0x50,0xc6]
578
579// rdar://8491845 - Gas supports commuted forms of non-commutable instructions.
580fdivrp %st(0), %st(1) // CHECK: encoding: [0xde,0xf9]
581fdivrp %st(1), %st(0) // CHECK: encoding: [0xde,0xf9]
582
583fsubrp %ST(0), %ST(1) // CHECK: encoding: [0xde,0xe9]
584fsubrp %ST(1), %ST(0) // CHECK: encoding: [0xde,0xe9]
585
586// also PR8861
587fdivp %st(0), %st(1) // CHECK: encoding: [0xde,0xf1]
588fdivp %st(1), %st(0) // CHECK: encoding: [0xde,0xf1]
589
590
591movl	foo(%rip), %eax
592// CHECK: movl	foo(%rip), %eax
593// CHECK: encoding: [0x8b,0x05,A,A,A,A]
594// CHECK: fixup A - offset: 2, value: foo-4, kind: reloc_riprel_4byte
595
596movb	$12, foo(%rip)
597// CHECK: movb	$12, foo(%rip)
598// CHECK: encoding: [0xc6,0x05,A,A,A,A,0x0c]
599// CHECK:    fixup A - offset: 2, value: foo-5, kind: reloc_riprel_4byte
600
601movw	$12, foo(%rip)
602// CHECK: movw	$12, foo(%rip)
603// CHECK: encoding: [0x66,0xc7,0x05,A,A,A,A,0x0c,0x00]
604// CHECK:    fixup A - offset: 3, value: foo-6, kind: reloc_riprel_4byte
605
606movl	$12, foo(%rip)
607// CHECK: movl	$12, foo(%rip)
608// CHECK: encoding: [0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
609// CHECK:    fixup A - offset: 2, value: foo-8, kind: reloc_riprel_4byte
610
611movq	$12, foo(%rip)
612// CHECK:  movq	$12, foo(%rip)
613// CHECK: encoding: [0x48,0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
614// CHECK:    fixup A - offset: 3, value: foo-8, kind: reloc_riprel_4byte
615
616movl	foo(%eip), %eax
617// CHECK: movl	foo(%eip), %eax
618// CHECK: encoding: [0x67,0x8b,0x05,A,A,A,A]
619// CHECK: fixup A - offset: 3, value: foo-4, kind: reloc_riprel_4byte
620
621movb	$12, foo(%eip)
622// CHECK: movb	$12, foo(%eip)
623// CHECK: encoding: [0x67,0xc6,0x05,A,A,A,A,0x0c]
624// CHECK:    fixup A - offset: 3, value: foo-5, kind: reloc_riprel_4byte
625
626movw	$12, foo(%eip)
627// CHECK: movw	$12, foo(%eip)
628// CHECK: encoding: [0x67,0x66,0xc7,0x05,A,A,A,A,0x0c,0x00]
629// CHECK:    fixup A - offset: 4, value: foo-6, kind: reloc_riprel_4byte
630
631movl	$12, foo(%eip)
632// CHECK: movl	$12, foo(%eip)
633// CHECK: encoding: [0x67,0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
634// CHECK:    fixup A - offset: 3, value: foo-8, kind: reloc_riprel_4byte
635
636movq	$12, foo(%eip)
637// CHECK:  movq	$12, foo(%eip)
638// CHECK: encoding: [0x67,0x48,0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
639// CHECK:    fixup A - offset: 4, value: foo-8, kind: reloc_riprel_4byte
640
641// CHECK: addq	$-424, %rax
642// CHECK: encoding: [0x48,0x05,0x58,0xfe,0xff,0xff]
643addq $-424, %rax
644
645
646// CHECK: movq	_foo@GOTPCREL(%rip), %rax
647// CHECK:  encoding: [0x48,0x8b,0x05,A,A,A,A]
648// CHECK:  fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
649movq _foo@GOTPCREL(%rip), %rax
650
651// CHECK: movq	_foo@GOTPCREL(%rip), %r14
652// CHECK:  encoding: [0x4c,0x8b,0x35,A,A,A,A]
653// CHECK:  fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
654movq _foo@GOTPCREL(%rip), %r14
655
656// CHECK: movq	_foo@GOTPCREL(%eip), %rax
657// CHECK:  encoding: [0x67,0x48,0x8b,0x05,A,A,A,A]
658// CHECK:  fixup A - offset: 4, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
659movq _foo@GOTPCREL(%eip), %rax
660
661// CHECK: movq	_foo@GOTPCREL(%eip), %r14
662// CHECK:  encoding: [0x67,0x4c,0x8b,0x35,A,A,A,A]
663// CHECK:  fixup A - offset: 4, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
664movq _foo@GOTPCREL(%eip), %r14
665
666// CHECK: movq	(%r13,%rax,8), %r13
667// CHECK:  encoding: [0x4d,0x8b,0x6c,0xc5,0x00]
668movq 0x00(%r13,%rax,8),%r13
669
670// CHECK: testq	%rax, %rbx
671// CHECK:  encoding: [0x48,0x85,0xc3]
672testq %rax, %rbx
673
674// CHECK: cmpq	%rbx, %r14
675// CHECK:   encoding: [0x49,0x39,0xde]
676        cmpq %rbx, %r14
677
678// rdar://7947167
679
680movsq
681// CHECK: movsq
682// CHECK:   encoding: [0x48,0xa5]
683
684movsl
685// CHECK: movsl
686// CHECK:   encoding: [0xa5]
687
688stosq
689// CHECK: stosq
690// CHECK:   encoding: [0x48,0xab]
691stosl
692// CHECK: stosl
693// CHECK:   encoding: [0xab]
694
695
696// Not moffset forms of moves, they are x86-32 only! rdar://7947184
697movb	0, %al    // CHECK: movb 0, %al # encoding: [0x8a,0x04,0x25,0x00,0x00,0x00,0x00]
698movw	0, %ax    // CHECK: movw 0, %ax # encoding: [0x66,0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
699movl	0, %eax   // CHECK: movl 0, %eax # encoding: [0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
700
701// CHECK: pushfq	# encoding: [0x9c]
702        pushf
703// CHECK: pushfq	# encoding: [0x9c]
704        pushfq
705// CHECK: popfq	        # encoding: [0x9d]
706        popf
707// CHECK: popfq	        # encoding: [0x9d]
708        popfq
709
710// CHECK: movabsq $-281474976710654, %rax
711// CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
712        movabsq $0xFFFF000000000002, %rax
713
714// CHECK: movabsq $-281474976710654, %rax
715// CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
716        movq $0xFFFF000000000002, %rax
717
718// CHECK: movq $-65536, %rax
719// CHECK: encoding: [0x48,0xc7,0xc0,0x00,0x00,0xff,0xff]
720        movq $0xFFFFFFFFFFFF0000, %rax
721
722// CHECK: movq $-256, %rax
723// CHECK: encoding: [0x48,0xc7,0xc0,0x00,0xff,0xff,0xff]
724        movq $0xFFFFFFFFFFFFFF00, %rax
725
726// CHECK: movq $10, %rax
727// CHECK: encoding: [0x48,0xc7,0xc0,0x0a,0x00,0x00,0x00]
728        movq $10, %rax
729
730// CHECK: movabsb -6066930261531658096, %al
731// CHECK: encoding: [0xa0,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
732        movabsb 0xabcdef1234567890,%al
733
734// CHECK: movabsw -6066930261531658096, %ax
735// CHECK: encoding: [0x66,0xa1,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
736        movabsw 0xabcdef1234567890,%ax
737
738// CHECK: movabsl -6066930261531658096, %eax
739// CHECK: encoding: [0xa1,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
740        movabsl 0xabcdef1234567890,%eax
741
742// CHECK: movabsq -6066930261531658096, %rax
743// CHECK: encoding: [0x48,0xa1,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
744        movabsq 0xabcdef1234567890, %rax
745
746// CHECK: movabsb %al, -6066930261531658096
747// CHECK: encoding: [0xa2,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
748        movabsb %al,0xabcdef1234567890
749
750// CHECK: movabsw %ax, -6066930261531658096
751// CHECK: encoding: [0x66,0xa3,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
752        movabsw %ax,0xabcdef1234567890
753
754// CHECK: movabsl %eax, -6066930261531658096
755// CHECK: encoding: [0xa3,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
756        movabsl %eax,0xabcdef1234567890
757
758// CHECK: movabsq %rax, -6066930261531658096
759// CHECK: encoding: [0x48,0xa3,0x90,0x78,0x56,0x34,0x12,0xef,0xcd,0xab]
760        movabsq %rax,0xabcdef1234567890
761
762// rdar://8014869
763//
764// CHECK: ret
765// CHECK:  encoding: [0xc3]
766        retq
767
768// CHECK: sete %al
769// CHECK: encoding: [0x0f,0x94,0xc0]
770        setz %al
771
772// CHECK: setne %al
773// CHECK: encoding: [0x0f,0x95,0xc0]
774        setnz %al
775
776// CHECK: je 0
777// CHECK: encoding: [0x74,A]
778        jz 0
779
780// CHECK: jne
781// CHECK: encoding: [0x75,A]
782        jnz 0
783
784// PR9264
785btl	$1, 0 // CHECK: btl $1, 0 # encoding: [0x0f,0xba,0x24,0x25,0x00,0x00,0x00,0x00,0x01]
786bt	$1, 0 // CHECK: btl $1, 0 # encoding: [0x0f,0xba,0x24,0x25,0x00,0x00,0x00,0x00,0x01]
787
788// rdar://8017515
789btq $0x01,%rdx
790// CHECK: btq	$1, %rdx
791// CHECK:  encoding: [0x48,0x0f,0xba,0xe2,0x01]
792
793//rdar://8017633
794// CHECK: movzbl	%al, %esi
795// CHECK:  encoding: [0x0f,0xb6,0xf0]
796        movzx %al, %esi
797
798// CHECK: movzbq	%al, %rsi
799// CHECK:  encoding: [0x48,0x0f,0xb6,0xf0]
800        movzx %al, %rsi
801
802// CHECK: movsbw	%al, %ax
803// CHECK: encoding: [0x66,0x0f,0xbe,0xc0]
804movsx %al, %ax
805
806// CHECK: movsbl	%al, %eax
807// CHECK: encoding: [0x0f,0xbe,0xc0]
808movsx %al, %eax
809
810// CHECK: movswl	%ax, %eax
811// CHECK: encoding: [0x0f,0xbf,0xc0]
812movsx %ax, %eax
813
814// CHECK: movsbq	%bl, %rax
815// CHECK: encoding: [0x48,0x0f,0xbe,0xc3]
816movsx %bl, %rax
817
818// CHECK: movswq %cx, %rax
819// CHECK: encoding: [0x48,0x0f,0xbf,0xc1]
820movsx %cx, %rax
821
822// CHECK: movslq	%edi, %rax
823// CHECK: encoding: [0x48,0x63,0xc7]
824movsx %edi, %rax
825
826// CHECK: movzbw	%al, %ax
827// CHECK: encoding: [0x66,0x0f,0xb6,0xc0]
828movzx %al, %ax
829
830// CHECK: movzbl	%al, %eax
831// CHECK: encoding: [0x0f,0xb6,0xc0]
832movzx %al, %eax
833
834// CHECK: movzwl	%ax, %eax
835// CHECK: encoding: [0x0f,0xb7,0xc0]
836movzx %ax, %eax
837
838// CHECK: movzbq	%bl, %rax
839// CHECK: encoding: [0x48,0x0f,0xb6,0xc3]
840movzx %bl, %rax
841
842// CHECK: movzwq	%cx, %rax
843// CHECK: encoding: [0x48,0x0f,0xb7,0xc1]
844movzx %cx, %rax
845
846// CHECK: movsbw	(%rax), %ax
847// CHECK: encoding: [0x66,0x0f,0xbe,0x00]
848movsx (%rax), %ax
849
850// CHECK: movzbw	(%rax), %ax
851// CHECK: encoding: [0x66,0x0f,0xb6,0x00]
852movzx (%rax), %ax
853
854
855// rdar://7873482
856// CHECK: [0x65,0x8b,0x04,0x25,0x7c,0x00,0x00,0x00]
857        movl	%gs:124, %eax
858
859// CHECK: jmpq *8(%rax)
860// CHECK:   encoding: [0xff,0x60,0x08]
861	jmp	*8(%rax)
862
863// CHECK: btq $61, -216(%rbp)
864// CHECK:   encoding: [0x48,0x0f,0xba,0xa5,0x28,0xff,0xff,0xff,0x3d]
865	btq	$61, -216(%rbp)
866
867
868// rdar://8061602
869L1:
870  jecxz L1
871// CHECK: jecxz L1
872// CHECK:   encoding: [0x67,0xe3,A]
873  jrcxz L1
874// CHECK: jrcxz L1
875// CHECK:   encoding: [0xe3,A]
876
877// PR8061
878xchgl   368(%rax),%ecx
879// CHECK: xchgl	%ecx, 368(%rax)
880xchgl   %ecx, 368(%rax)
881// CHECK: xchgl	%ecx, 368(%rax)
882
883// rdar://8407548
884xchg	0xdeadbeef(%rbx,%rcx,8),%bl
885// CHECK: xchgb	%bl, 3735928559(%rbx,%rcx,8)
886
887
888
889// PR7254
890lock  incl 1(%rsp)
891// CHECK: lock
892// CHECK: incl 1(%rsp)
893
894// rdar://8741045
895lock/incl 1(%rsp)
896// CHECK: lock
897// CHECK: incl 1(%rsp)
898
899
900lock addq %rsi, (%rdi)
901// CHECK: lock
902// CHECK: encoding: [0xf0]
903// CHECK: addq %rsi, (%rdi)
904// CHECK: encoding: [0x48,0x01,0x37]
905
906lock subq %rsi, (%rdi)
907// CHECK: lock
908// CHECK: encoding: [0xf0]
909// CHECK: subq %rsi, (%rdi)
910// CHECK: encoding: [0x48,0x29,0x37]
911
912lock andq %rsi, (%rdi)
913// CHECK: lock
914// CHECK: encoding: [0xf0]
915// CHECK: andq %rsi, (%rdi)
916// CHECK: encoding: [0x48,0x21,0x37]
917
918lock orq %rsi, (%rdi)
919// CHECK: lock
920// CHECK: encoding: [0xf0]
921// CHECK: orq %rsi, (%rdi)
922// CHECK: encoding: [0x48,0x09,0x37]
923
924lock xorq %rsi, (%rdi)
925// CHECK: lock
926// CHECK: encoding: [0xf0]
927// CHECK: xorq %rsi, (%rdi)
928// CHECK: encoding: [0x48,0x31,0x37]
929
930
931// rdar://8033482
932rep movsl
933// CHECK: rep
934// CHECK: encoding: [0xf3]
935// CHECK: movsl
936// CHECK: encoding: [0xa5]
937
938
939// rdar://8403974
940iret
941// CHECK: iretl
942// CHECK: encoding: [0xcf]
943iretw
944// CHECK: iretw
945// CHECK: encoding: [0x66,0xcf]
946iretl
947// CHECK: iretl
948// CHECK: encoding: [0xcf]
949iretq
950// CHECK: iretq
951// CHECK: encoding: [0x48,0xcf]
952
953// rdar://8416805
954// CHECK: retw	$31438
955// CHECK:  encoding: [0x66,0xc2,0xce,0x7a]
956        	retw	$0x7ace
957
958// CHECK: lretw	$31438
959// CHECK:  encoding: [0x66,0xca,0xce,0x7a]
960        	lretw	$0x7ace
961
962// PR8592
963lretq  // CHECK: lretq # encoding: [0x48,0xcb]
964lretl  // CHECK: lretl # encoding: [0xcb]
965lret   // CHECK: lretl # encoding: [0xcb]
966lretw  // CHECK: lretw # encoding: [0x66,0xcb]
967
968// rdar://8403907
969sysret
970// CHECK: sysretl
971// CHECK: encoding: [0x0f,0x07]
972sysretl
973// CHECK: sysretl
974// CHECK: encoding: [0x0f,0x07]
975sysretq
976// CHECK: sysretq
977// CHECK: encoding: [0x48,0x0f,0x07]
978
979// rdar://8407242
980push %fs
981// CHECK: pushq	%fs
982// CHECK: encoding: [0x0f,0xa0]
983push %gs
984// CHECK: pushq	%gs
985// CHECK: encoding: [0x0f,0xa8]
986
987pushw %fs
988// CHECK: pushw	%fs
989// CHECK: encoding: [0x66,0x0f,0xa0]
990pushw %gs
991// CHECK: pushw	%gs
992// CHECK: encoding: [0x66,0x0f,0xa8]
993
994
995pop %fs
996// CHECK: popq	%fs
997// CHECK: encoding: [0x0f,0xa1]
998pop %gs
999// CHECK: popq	%gs
1000// CHECK: encoding: [0x0f,0xa9]
1001
1002popw %fs
1003// CHECK: popw	%fs
1004// CHECK: encoding: [0x66,0x0f,0xa1]
1005popw %gs
1006// CHECK: popw	%gs
1007// CHECK: encoding: [0x66,0x0f,0xa9]
1008
1009// rdar://8438816
1010fildq -8(%rsp)
1011fildll -8(%rsp)
1012// CHECK: fildll	-8(%rsp)
1013// CHECK: encoding: [0xdf,0x6c,0x24,0xf8]
1014// CHECK: fildll	-8(%rsp)
1015// CHECK: encoding: [0xdf,0x6c,0x24,0xf8]
1016
1017// CHECK: callq a
1018        callq a
1019
1020// CHECK: leaq	-40(%rbp), %r15
1021	leaq	-40(%rbp), %r15
1022
1023
1024
1025// rdar://8013734 - Alias dr6=db6
1026mov %dr6, %rax
1027mov %db6, %rax
1028// CHECK: movq	%dr6, %rax
1029// CHECK: movq	%dr6, %rax
1030
1031
1032// INC/DEC encodings.
1033incb %al  // CHECK:	incb	%al # encoding: [0xfe,0xc0]
1034incw %ax  // CHECK:	incw	%ax # encoding: [0x66,0xff,0xc0]
1035incl %eax // CHECK:	incl	%eax # encoding: [0xff,0xc0]
1036decb %al  // CHECK:	decb	%al # encoding: [0xfe,0xc8]
1037decw %ax  // CHECK:	decw	%ax # encoding: [0x66,0xff,0xc8]
1038decl %eax // CHECK:	decl	%eax # encoding: [0xff,0xc8]
1039
1040// rdar://8416805
1041// CHECK: lgdtq	4(%rax)
1042// CHECK:  encoding: [0x0f,0x01,0x50,0x04]
1043        	lgdt	4(%rax)
1044
1045// CHECK: lgdtq	4(%rax)
1046// CHECK:  encoding: [0x0f,0x01,0x50,0x04]
1047        	lgdtq	4(%rax)
1048
1049// CHECK: lidtq	4(%rax)
1050// CHECK:  encoding: [0x0f,0x01,0x58,0x04]
1051        	lidt	4(%rax)
1052
1053// CHECK: lidtq	4(%rax)
1054// CHECK:  encoding: [0x0f,0x01,0x58,0x04]
1055        	lidtq	4(%rax)
1056
1057// CHECK: sgdtq	4(%rax)
1058// CHECK:  encoding: [0x0f,0x01,0x40,0x04]
1059        	sgdt	4(%rax)
1060
1061// CHECK: sgdtq	4(%rax)
1062// CHECK:  encoding: [0x0f,0x01,0x40,0x04]
1063        	sgdtq	4(%rax)
1064
1065// CHECK: sidtq	4(%rax)
1066// CHECK:  encoding: [0x0f,0x01,0x48,0x04]
1067        	sidt	4(%rax)
1068
1069// CHECK: sidtq	4(%rax)
1070// CHECK:  encoding: [0x0f,0x01,0x48,0x04]
1071        	sidtq	4(%rax)
1072
1073
1074// rdar://8208615
1075mov (%rsi), %gs  // CHECK: movl	(%rsi), %gs # encoding: [0x8e,0x2e]
1076mov %gs, (%rsi)  // CHECK: movl	%gs, (%rsi) # encoding: [0x8c,0x2e]
1077
1078
1079// rdar://8431864
1080//CHECK: divb	%bl
1081//CHECK: divw	%bx
1082//CHECK: divl	%ecx
1083//CHECK: divl	3735928559(%ebx,%ecx,8)
1084//CHECK: divl	69
1085//CHECK: divl	32493
1086//CHECK: divl	3133065982
1087//CHECK: divl	305419896
1088//CHECK: idivb	%bl
1089//CHECK: idivw	%bx
1090//CHECK: idivl	%ecx
1091//CHECK: idivl	3735928559(%ebx,%ecx,8)
1092//CHECK: idivl	69
1093//CHECK: idivl	32493
1094//CHECK: idivl	3133065982
1095//CHECK: idivl	305419896
1096	div	%bl,%al
1097	div	%bx,%ax
1098	div	%ecx,%eax
1099	div	0xdeadbeef(%ebx,%ecx,8),%eax
1100	div	0x45,%eax
1101	div	0x7eed,%eax
1102	div	0xbabecafe,%eax
1103	div	0x12345678,%eax
1104	idiv	%bl,%al
1105	idiv	%bx,%ax
1106	idiv	%ecx,%eax
1107	idiv	0xdeadbeef(%ebx,%ecx,8),%eax
1108	idiv	0x45,%eax
1109	idiv	0x7eed,%eax
1110	idiv	0xbabecafe,%eax
1111	idiv	0x12345678,%eax
1112
1113// PR8524
1114movd	%rax, %mm5 // CHECK: movd %rax, %mm5 # encoding: [0x48,0x0f,0x6e,0xe8]
1115movd	%mm5, %rbx // CHECK: movd %mm5, %rbx # encoding: [0x48,0x0f,0x7e,0xeb]
1116movq	%rax, %mm5 // CHECK: movd %rax, %mm5 # encoding: [0x48,0x0f,0x6e,0xe8]
1117movq	%mm5, %rbx // CHECK: movd %mm5, %rbx # encoding: [0x48,0x0f,0x7e,0xeb]
1118
1119rex64 // CHECK: rex64 # encoding: [0x48]
1120data16 // CHECK: data16 # encoding: [0x66]
1121
1122// PR8855
1123movq 18446744073709551615,%rbx   // CHECK: movq	-1, %rbx
1124
1125// PR8946
1126movdqu	%xmm0, %xmm1 // CHECK: movdqu	%xmm0, %xmm1 # encoding: [0xf3,0x0f,0x6f,0xc8]
1127
1128// PR8935
1129xgetbv // CHECK: xgetbv # encoding: [0x0f,0x01,0xd0]
1130xsetbv // CHECK: xsetbv # encoding: [0x0f,0x01,0xd1]
1131
1132// CHECK: loope 0
1133// CHECK: encoding: [0xe1,A]
1134	loopz 0
1135
1136// CHECK: loopne 0
1137// CHECK: encoding: [0xe0,A]
1138	loopnz 0
1139
1140// CHECK: outsb (%rsi), %dx # encoding: [0x6e]
1141// CHECK: outsb
1142// CHECK: outsb
1143	outsb
1144	outsb	%ds:(%rsi), %dx
1145	outsb	(%rsi), %dx
1146
1147// CHECK: outsw (%rsi), %dx # encoding: [0x66,0x6f]
1148// CHECK: outsw
1149// CHECK: outsw
1150	outsw
1151	outsw	%ds:(%rsi), %dx
1152	outsw	(%rsi), %dx
1153
1154// CHECK: outsl (%rsi), %dx # encoding: [0x6f]
1155// CHECK: outsl
1156	outsl
1157	outsl	%ds:(%rsi), %dx
1158	outsl	(%rsi), %dx
1159
1160// CHECK: insb  %dx, %es:(%rdi) # encoding: [0x6c]
1161// CHECK: insb
1162	insb
1163	insb	%dx, %es:(%rdi)
1164
1165// CHECK: insw  %dx, %es:(%rdi) # encoding: [0x66,0x6d]
1166// CHECK: insw
1167	insw
1168	insw	%dx, %es:(%rdi)
1169
1170// CHECK: insl %dx, %es:(%rdi) # encoding: [0x6d]
1171// CHECK: insl
1172	insl
1173	insl	%dx, %es:(%rdi)
1174
1175// CHECK: movsb (%rsi), %es:(%rdi) # encoding: [0xa4]
1176// CHECK: movsb
1177// CHECK: movsb
1178	movsb
1179	movsb	%ds:(%rsi), %es:(%rdi)
1180	movsb	(%rsi), %es:(%rdi)
1181
1182// CHECK: movsw (%rsi), %es:(%rdi) # encoding: [0x66,0xa5]
1183// CHECK: movsw
1184// CHECK: movsw
1185	movsw
1186	movsw	%ds:(%rsi), %es:(%rdi)
1187	movsw	(%rsi), %es:(%rdi)
1188
1189// CHECK: movsl (%rsi), %es:(%rdi) # encoding: [0xa5]
1190// CHECK: movsl
1191// CHECK: movsl
1192	movsl
1193	movsl	%ds:(%rsi), %es:(%rdi)
1194	movsl	(%rsi), %es:(%rdi)
1195// rdar://10883092
1196// CHECK: movsl
1197	movsl	(%rsi), (%rdi)
1198
1199// CHECK: movsq (%rsi), %es:(%rdi) # encoding: [0x48,0xa5]
1200// CHECK: movsq
1201// CHECK: movsq
1202	movsq
1203	movsq	%ds:(%rsi), %es:(%rdi)
1204	movsq	(%rsi), %es:(%rdi)
1205
1206// CHECK: lodsb (%rsi), %al # encoding: [0xac]
1207// CHECK: lodsb
1208// CHECK: lodsb
1209// CHECK: lodsb
1210// CHECK: lodsb
1211	lodsb
1212	lodsb	%ds:(%rsi), %al
1213	lodsb	(%rsi), %al
1214	lods	%ds:(%rsi), %al
1215	lods	(%rsi), %al
1216
1217// CHECK: lodsw (%rsi), %ax # encoding: [0x66,0xad]
1218// CHECK: lodsw
1219// CHECK: lodsw
1220// CHECK: lodsw
1221// CHECK: lodsw
1222	lodsw
1223	lodsw	%ds:(%rsi), %ax
1224	lodsw	(%rsi), %ax
1225	lods	%ds:(%rsi), %ax
1226	lods	(%rsi), %ax
1227
1228// CHECK: lodsl (%rsi), %eax # encoding: [0xad]
1229// CHECK: lodsl
1230// CHECK: lodsl
1231// CHECK: lodsl
1232// CHECK: lodsl
1233	lodsl
1234	lodsl	%ds:(%rsi), %eax
1235	lodsl	(%rsi), %eax
1236	lods	%ds:(%rsi), %eax
1237	lods	(%rsi), %eax
1238
1239// CHECK: lodsq (%rsi), %rax # encoding: [0x48,0xad]
1240// CHECK: lodsq
1241// CHECK: lodsq
1242// CHECK: lodsq
1243// CHECK: lodsq
1244	lodsq
1245	lodsq	%ds:(%rsi), %rax
1246	lodsq	(%rsi), %rax
1247	lods	%ds:(%rsi), %rax
1248	lods	(%rsi), %rax
1249
1250// CHECK: stosb %al, %es:(%rdi) # encoding: [0xaa]
1251// CHECK: stosb
1252// CHECK: stosb
1253	stosb
1254	stosb	%al, %es:(%rdi)
1255	stos	%al, %es:(%rdi)
1256
1257// CHECK: stosw %ax, %es:(%rdi) # encoding: [0x66,0xab]
1258// CHECK: stosw
1259// CHECK: stosw
1260	stosw
1261	stosw	%ax, %es:(%rdi)
1262	stos	%ax, %es:(%rdi)
1263
1264// CHECK: stosl %eax, %es:(%rdi) # encoding: [0xab]
1265// CHECK: stosl
1266// CHECK: stosl
1267	stosl
1268	stosl	%eax, %es:(%rdi)
1269	stos	%eax, %es:(%rdi)
1270
1271// CHECK: stosq %rax, %es:(%rdi) # encoding: [0x48,0xab]
1272// CHECK: stosq
1273// CHECK: stosq
1274	stosq
1275	stosq	%rax, %es:(%rdi)
1276	stos	%rax, %es:(%rdi)
1277
1278// CHECK: strw
1279// CHECK: encoding: [0x66,0x0f,0x00,0xc8]
1280	str %ax
1281
1282// CHECK: strl
1283// CHECK: encoding: [0x0f,0x00,0xc8]
1284	str %eax
1285
1286// CHECK: strw
1287// CHECK: encoding: [0x66,0x0f,0x00,0xc8]
1288	str %ax
1289
1290// CHECK: strq
1291// CHECK: encoding: [0x48,0x0f,0x00,0xc8]
1292	str %rax
1293
1294// CHECK: movd %rdi, %xmm0
1295// CHECK: encoding: [0x66,0x48,0x0f,0x6e,0xc7]
1296	movq %rdi,%xmm0
1297
1298// CHECK: movd %rdi, %xmm0
1299// CHECK: encoding: [0x66,0x48,0x0f,0x6e,0xc7]
1300	movd %rdi,%xmm0
1301
1302// CHECK: movd  %xmm0, %rax
1303// CHECK: encoding: [0x66,0x48,0x0f,0x7e,0xc0]
1304        movd  %xmm0, %rax
1305
1306// CHECK: movntil %eax, (%rdi)
1307// CHECK: encoding: [0x0f,0xc3,0x07]
1308// CHECK: movntil
1309movntil %eax, (%rdi)
1310movnti %eax, (%rdi)
1311
1312// CHECK: movntiq %rax, (%rdi)
1313// CHECK: encoding: [0x48,0x0f,0xc3,0x07]
1314// CHECK: movntiq
1315movntiq %rax, (%rdi)
1316movnti %rax, (%rdi)
1317
1318// CHECK: pclmulqdq	$17, %xmm0, %xmm1
1319// CHECK: encoding: [0x66,0x0f,0x3a,0x44,0xc8,0x11]
1320pclmulhqhqdq %xmm0, %xmm1
1321
1322// CHECK: pclmulqdq	$1, %xmm0, %xmm1
1323// CHECK: encoding: [0x66,0x0f,0x3a,0x44,0xc8,0x01]
1324pclmulqdq $1, %xmm0, %xmm1
1325
1326// CHECK: pclmulqdq	$16, (%rdi), %xmm1
1327// CHECK: encoding: [0x66,0x0f,0x3a,0x44,0x0f,0x10]
1328pclmullqhqdq (%rdi), %xmm1
1329
1330// CHECK: pclmulqdq	$0, (%rdi), %xmm1
1331// CHECK: encoding: [0x66,0x0f,0x3a,0x44,0x0f,0x00]
1332pclmulqdq $0, (%rdi), %xmm1
1333
1334// PR10345
1335// CHECK: xchgq %rax, %rax
1336// CHECK: encoding: [0x48,0x90]
1337xchgq %rax, %rax
1338
1339// CHECK: xchgl %eax, %eax
1340// CHECK: encoding: [0x87,0xc0]
1341xchgl %eax, %eax
1342
1343// CHECK: xchgw %ax, %ax
1344// CHECK: encoding: [0x66,0x90]
1345xchgw %ax, %ax
1346
1347// CHECK: xchgl %ecx, %eax
1348// CHECK: encoding: [0x91]
1349xchgl %ecx, %eax
1350
1351// CHECK: xchgl %ecx, %eax
1352// CHECK: encoding: [0x91]
1353xchgl %eax, %ecx
1354
1355// CHECK: sysexit
1356// CHECK: encoding: [0x0f,0x35]
1357sysexit
1358
1359// CHECK: sysexitl
1360// CHECK: encoding: [0x0f,0x35]
1361sysexitl
1362
1363// CHECK: sysexitq
1364// CHECK: encoding: [0x48,0x0f,0x35]
1365sysexitq
1366
1367// CHECK: clac
1368// CHECK: encoding: [0x0f,0x01,0xca]
1369clac
1370
1371// CHECK: stac
1372// CHECK: encoding: [0x0f,0x01,0xcb]
1373stac
1374
1375// CHECK: faddp %st(1)
1376// CHECK: fmulp %st(1)
1377// CHECK: fsubp %st(1)
1378// CHECK: fsubrp %st(1)
1379// CHECK: fdivp %st(1)
1380// CHECK: fdivrp %st(1)
1381faddp %st(0), %st(1)
1382fmulp %st(0), %st(1)
1383fsubp %st(0), %st(1)
1384fsubrp %st(0), %st(1)
1385fdivp %st(0), %st(1)
1386fdivrp %st(0), %st(1)
1387
1388// CHECK: faddp %st(1)
1389// CHECK: fmulp %st(1)
1390// CHECK: fsubp %st(1)
1391// CHECK: fsubrp %st(1)
1392// CHECK: fdivp %st(1)
1393// CHECK: fdivrp %st(1)
1394faddp %st(1), %st(0)
1395fmulp %st(1), %st(0)
1396fsubp %st(1), %st(0)
1397fsubrp %st(1), %st(0)
1398fdivp %st(1), %st(0)
1399fdivrp %st(1), %st(0)
1400
1401// CHECK: faddp %st(1)
1402// CHECK: fmulp %st(1)
1403// CHECK: fsubp %st(1)
1404// CHECK: fsubrp %st(1)
1405// CHECK: fdivp %st(1)
1406// CHECK: fdivrp %st(1)
1407faddp %st(1)
1408fmulp %st(1)
1409fsubp %st(1)
1410fsubrp %st(1)
1411fdivp %st(1)
1412fdivrp %st(1)
1413
1414// CHECK: faddp %st(1)
1415// CHECK: fmulp %st(1)
1416// CHECK: fsubp %st(1)
1417// CHECK: fsubrp %st(1)
1418// CHECK: fdivp %st(1)
1419// CHECK: fdivrp %st(1)
1420faddp
1421fmulp
1422fsubp
1423fsubrp
1424fdivp
1425fdivrp
1426
1427// CHECK: fadd %st(1)
1428// CHECK: fmul %st(1)
1429// CHECK: fsub %st(1)
1430// CHECK: fsubr %st(1)
1431// CHECK: fdiv %st(1)
1432// CHECK: fdivr %st(1)
1433fadd %st(1), %st(0)
1434fmul %st(1), %st(0)
1435fsub %st(1), %st(0)
1436fsubr %st(1), %st(0)
1437fdiv %st(1), %st(0)
1438fdivr %st(1), %st(0)
1439
1440// CHECK: fadd %st(0), %st(1)
1441// CHECK: fmul %st(0), %st(1)
1442// CHECK: fsub %st(0), %st(1)
1443// CHECK: fsubr %st(0), %st(1)
1444// CHECK: fdiv %st(0), %st(1)
1445// CHECK: fdivr %st(0), %st(1)
1446fadd %st(0), %st(1)
1447fmul %st(0), %st(1)
1448fsub %st(0), %st(1)
1449fsubr %st(0), %st(1)
1450fdiv %st(0), %st(1)
1451fdivr %st(0), %st(1)
1452
1453// CHECK: fadd %st(1)
1454// CHECK: fmul %st(1)
1455// CHECK: fsub %st(1)
1456// CHECK: fsubr %st(1)
1457// CHECK: fdiv %st(1)
1458// CHECK: fdivr %st(1)
1459fadd %st(1)
1460fmul %st(1)
1461fsub %st(1)
1462fsubr %st(1)
1463fdiv %st(1)
1464fdivr %st(1)
1465
1466// CHECK: movd %xmm0, %eax
1467// CHECK: movd %xmm0, %rax
1468// CHECK: movd %xmm0, %rax
1469// CHECK: vmovd %xmm0, %eax
1470// CHECK: vmovq %xmm0, %rax
1471// CHECK: vmovq %xmm0, %rax
1472movd %xmm0, %eax
1473movd %xmm0, %rax
1474movq %xmm0, %rax
1475vmovd %xmm0, %eax
1476vmovd %xmm0, %rax
1477vmovq %xmm0, %rax
1478
1479// CHECK: seto 3735928559(%r10,%r9,8)
1480// CHECK:  encoding: [0x43,0x0f,0x90,0x84,0xca,0xef,0xbe,0xad,0xde]
1481	seto 0xdeadbeef(%r10,%r9,8)
1482
1483// CHECK: 	monitorx
1484// CHECK:  encoding: [0x0f,0x01,0xfa]
1485        	monitorx
1486
1487// CHECK: 	monitorx
1488// CHECK:  encoding: [0x0f,0x01,0xfa]
1489        	monitorx %rax, %rcx, %rdx
1490
1491// CHECK: 	mwaitx
1492// CHECK:  encoding: [0x0f,0x01,0xfb]
1493        	mwaitx
1494
1495// CHECK: 	mwaitx
1496// CHECK:  encoding: [0x0f,0x01,0xfb]
1497        	mwaitx %rax, %rcx, %rbx
1498
1499// CHECK: 	movl %r15d, (%r15,%r15)
1500// CHECK:  encoding: [0x47,0x89,0x3c,0x3f]
1501movl %r15d, (%r15,%r15)
1502