Fixed some bugs.
[llvm/zpu.git] / test / MC / X86 / x86-64.s
blobd386facfa19b2f8451f4222759af93638fea501f
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
6 // Suffix inference:
8 // CHECK: addl $0, %eax
9 add $0, %eax
10 // CHECK: addb $255, %al
11 add $0xFF, %al
12 // CHECK: orq %rax, %rdx
13 or %rax, %rdx
14 // CHECK: shlq $3, %rax
15 shl $3, %rax
18 // CHECK: subb %al, %al
19 subb %al, %al
21 // CHECK: addl $24, %eax
22 addl $24, %eax
24 // CHECK: movl %eax, 10(%ebp)
25 movl %eax, 10(%ebp)
26 // CHECK: movl %eax, 10(%ebp,%ebx)
27 movl %eax, 10(%ebp, %ebx)
28 // CHECK: movl %eax, 10(%ebp,%ebx,4)
29 movl %eax, 10(%ebp, %ebx, 4)
30 // CHECK: movl %eax, 10(,%ebx,4)
31 movl %eax, 10(, %ebx, 4)
33 // CHECK: movl 0, %eax
34 movl 0, %eax
35 // CHECK: movl $0, %eax
36 movl $0, %eax
38 // CHECK: ret
39 ret
41 // FIXME: Check that this matches SUB32ri8
42 // CHECK: subl $1, %eax
43 subl $1, %eax
45 // FIXME: Check that this matches SUB32ri8
46 // CHECK: subl $-1, %eax
47 subl $-1, %eax
49 // FIXME: Check that this matches SUB32ri
50 // CHECK: subl $256, %eax
51 subl $256, %eax
53 // FIXME: Check that this matches XOR64ri8
54 // CHECK: xorq $1, %rax
55 xorq $1, %rax
57 // FIXME: Check that this matches XOR64ri32
58 // CHECK: xorq $256, %rax
59 xorq $256, %rax
61 // FIXME: Check that this matches SUB8rr
62 // CHECK: subb %al, %bl
63 subb %al, %bl
65 // FIXME: Check that this matches SUB16rr
66 // CHECK: subw %ax, %bx
67 subw %ax, %bx
69 // FIXME: Check that this matches SUB32rr
70 // CHECK: subl %eax, %ebx
71 subl %eax, %ebx
73 // FIXME: Check that this matches the correct instruction.
74 // CHECK: callq *%rax
75 call *%rax
77 // FIXME: Check that this matches the correct instruction.
78 // CHECK: shldl %cl, %eax, %ebx
79 shldl %cl, %eax, %ebx
81 // CHECK: shll $2, %eax
82 shll $2, %eax
84 // CHECK: shll $2, %eax
85 sall $2, %eax
87 // CHECK: rep
88 // CHECK: insb
89 rep;insb
91 // CHECK: rep
92 // CHECK: outsb
93 rep;outsb
95 // CHECK: rep
96 // CHECK: movsb
97 rep;movsb
100 // rdar://8470918
101 smovb // CHECK: movsb
102 smovw // CHECK: movsw
103 smovl // CHECK: movsl
104 smovq // CHECK: movsq
106 // rdar://8456361
107 // CHECK: rep
108 // CHECK: movsl
109 rep movsd
111 // CHECK: rep
112 // CHECK: lodsb
113 rep;lodsb
115 // CHECK: rep
116 // CHECK: stosb
117 rep;stosb
119 // NOTE: repz and repe have the same opcode as rep
120 // CHECK: rep
121 // CHECK: cmpsb
122 repz;cmpsb
124 // NOTE: repnz has the same opcode as repne
125 // CHECK: repne
126 // CHECK: cmpsb
127 repnz;cmpsb
129 // NOTE: repe and repz have the same opcode as rep
130 // CHECK: rep
131 // CHECK: scasb
132 repe;scasb
134 // CHECK: repne
135 // CHECK: scasb
136 repne;scasb
138 // CHECK: lock
139 // CHECK: cmpxchgb %al, (%ebx)
140 lock;cmpxchgb %al, 0(%ebx)
142 // CHECK: cs
143 // CHECK: movb (%eax), %al
144 cs;movb 0(%eax), %al
146 // CHECK: ss
147 // CHECK: movb (%eax), %al
148 ss;movb 0(%eax), %al
150 // CHECK: ds
151 // CHECK: movb (%eax), %al
152 ds;movb 0(%eax), %al
154 // CHECK: es
155 // CHECK: movb (%eax), %al
156 es;movb 0(%eax), %al
158 // CHECK: fs
159 // CHECK: movb (%eax), %al
160 fs;movb 0(%eax), %al
162 // CHECK: gs
163 // CHECK: movb (%eax), %al
164 gs;movb 0(%eax), %al
166 // CHECK: fadd %st(0)
167 // CHECK: fadd %st(1)
168 // CHECK: fadd %st(7)
170 fadd %st(0)
171 fadd %st(1)
172 fadd %st(7)
174 // CHECK: leal 0, %eax
175 leal 0, %eax
177 // rdar://7986634 - Insensitivity on opcodes.
178 // CHECK: int3
179 INT3
182 // Allow scale factor without index register.
183 // CHECK: movaps %xmm3, (%esi)
184 // CHECK-STDERR: warning: scale factor without index register is ignored
185 movaps %xmm3, (%esi, 2)
187 // CHECK: imull $12, %eax, %eax
188 imul $12, %eax
190 // CHECK: imull %ecx, %eax
191 imull %ecx, %eax
194 // rdar://8208481
195 // CHECK: outb %al, $161
196 outb %al, $161
197 // CHECK: outw %ax, $128
198 outw %ax, $128
199 // CHECK: inb $161, %al
200 inb $161, %al
202 // rdar://8017621
203 // CHECK: pushq $1
204 push $1
206 // rdar://8017530
207 // CHECK: sldtw 4
208 sldt 4
210 // rdar://8208499
211 // CHECK: cmovnew %bx, %ax
212 cmovnz %bx, %ax
213 // CHECK: cmovneq %rbx, %rax
214 cmovnzq %rbx, %rax
217 // rdar://8407928
218 // CHECK: inb $127, %al
219 // CHECK: inw %dx, %ax
220 // CHECK: outb %al, $127
221 // CHECK: outw %ax, %dx
222 // CHECK: inl %dx, %eax
223 inb $0x7f
224 inw %dx
225 outb $0x7f
226 outw %dx
227 inl %dx
230 // PR8114
231 // CHECK: outb %al, %dx
232 // CHECK: outw %ax, %dx
233 // CHECK: outl %eax, %dx
235 out %al, (%dx)
236 out %ax, (%dx)
237 outl %eax, (%dx)
240 // rdar://8431422
242 // CHECK: fxch %st(1)
243 // CHECK: fucom %st(1)
244 // CHECK: fucomp %st(1)
245 // CHECK: faddp %st(1)
246 // CHECK: faddp %st(0)
247 // CHECK: fsubp %st(1)
248 // CHECK: fsubrp %st(1)
249 // CHECK: fmulp %st(1)
250 // CHECK: fdivp %st(1)
251 // CHECK: fdivrp %st(1)
253 fxch
254 fucom
255 fucomp
256 faddp
257 faddp %st
258 fsubp
259 fsubrp
260 fmulp
261 fdivp
262 fdivrp
264 // CHECK: fcomi %st(1), %st(0)
265 // CHECK: fcomi %st(2), %st(0)
266 // CHECK: fucomi %st(1), %st(0)
267 // CHECK: fucomi %st(2), %st(0)
268 // CHECK: fucomi %st(2), %st(0)
270 fcomi
271 fcomi %st(2)
272 fucomi
273 fucomi %st(2)
274 fucomi %st(2), %st
276 // CHECK: fnstsw %ax
277 // CHECK: fnstsw %ax
278 // CHECK: fnstsw %ax
279 // CHECK: fnstsw %ax
281 fnstsw
282 fnstsw %ax
283 fnstsw %eax
284 fnstsw %al
286 // rdar://8431880
287 // CHECK: rclb $1, %bl
288 // CHECK: rcll $1, 3735928559(%ebx,%ecx,8)
289 // CHECK: rcrl $1, %ecx
290 // CHECK: rcrl $1, 305419896
292 rcl %bl
293 rcll 0xdeadbeef(%ebx,%ecx,8)
294 rcr %ecx
295 rcrl 0x12345678
297 // rdar://8418316
298 // CHECK: shldw $1, %bx, %bx
299 // CHECK: shldw $1, %bx, %bx
300 // CHECK: shrdw $1, %bx, %bx
301 // CHECK: shrdw $1, %bx, %bx
303 shld %bx,%bx
304 shld $1, %bx,%bx
305 shrd %bx,%bx
306 shrd $1, %bx,%bx
308 // CHECK: sldtl %ecx
309 // CHECK: encoding: [0x0f,0x00,0xc1]
310 // CHECK: sldtw %cx
311 // CHECK: encoding: [0x66,0x0f,0x00,0xc1]
313 sldt %ecx
314 sldt %cx
316 // CHECK: lcalll *3135175374
317 // CHECK: ljmpl *3135175374
318 lcall *0xbadeface
319 ljmp *0xbadeface
322 // rdar://8444631
323 // CHECK: enter $31438, $0
324 // CHECK: encoding: [0xc8,0xce,0x7a,0x00]
325 // CHECK: enter $31438, $1
326 // CHECK: encoding: [0xc8,0xce,0x7a,0x01]
327 // CHECK: enter $31438, $127
328 // CHECK: encoding: [0xc8,0xce,0x7a,0x7f]
329 enter $0x7ace,$0
330 enter $0x7ace,$1
331 enter $0x7ace,$0x7f
334 // rdar://8456389
335 // CHECK: fstps (%eax)
336 // CHECK: encoding: [0x67,0xd9,0x18]
337 fstp (%eax)
339 // rdar://8456364
340 // CHECK: movw %cs, %ax
341 mov %CS, %ax
343 // rdar://8456391
344 fcmovb %st(1), %st(0) // CHECK: fcmovb %st(1), %st(0)
345 fcmove %st(1), %st(0) // CHECK: fcmove %st(1), %st(0)
346 fcmovbe %st(1), %st(0) // CHECK: fcmovbe %st(1), %st(0)
347 fcmovu %st(1), %st(0) // CHECK: fcmovu %st(1), %st(0)
349 fcmovnb %st(1), %st(0) // CHECK: fcmovnb %st(1), %st(0)
350 fcmovne %st(1), %st(0) // CHECK: fcmovne %st(1), %st(0)
351 fcmovnbe %st(1), %st(0) // CHECK: fcmovnbe %st(1), %st(0)
352 fcmovnu %st(1), %st(0) // CHECK: fcmovnu %st(1), %st(0)
354 fcmovnae %st(1), %st(0) // CHECK: fcmovb %st(1), %st(0)
355 fcmovna %st(1), %st(0) // CHECK: fcmovbe %st(1), %st(0)
357 fcmovae %st(1), %st(0) // CHECK: fcmovnb %st(1), %st(0)
358 fcmova %st(1), %st(0) // CHECK: fcmovnbe %st(1), %st(0)
360 // rdar://8456417
361 .byte 88 + 1 & 15 // CHECK: .byte 9
363 // rdar://8456412
364 mov %rdx, %cr0
365 // CHECK: movq %rdx, %cr0
366 // CHECK: encoding: [0x0f,0x22,0xc2]
367 mov %rdx, %cr4
368 // CHECK: movq %rdx, %cr4
369 // CHECK: encoding: [0x0f,0x22,0xe2]
370 mov %rdx, %cr8
371 // CHECK: movq %rdx, %cr8
372 // CHECK: encoding: [0x44,0x0f,0x22,0xc2]
373 mov %rdx, %cr15
374 // CHECK: movq %rdx, %cr15
375 // CHECK: encoding: [0x44,0x0f,0x22,0xfa]
377 // rdar://8456371 - Handle commutable instructions written backward.
378 // CHECK: faddp %st(1)
379 // CHECK: fmulp %st(2)
380 faddp %st, %st(1)
381 fmulp %st, %st(2)
383 // rdar://8468087 - Encode these accurately, they are not synonyms.
384 // CHECK: fmul %st(0), %st(1)
385 // CHECK: encoding: [0xdc,0xc9]
386 // CHECK: fmul %st(1)
387 // CHECK: encoding: [0xd8,0xc9]
388 fmul %st, %st(1)
389 fmul %st(1), %st
391 // CHECK: fadd %st(0), %st(1)
392 // CHECK: encoding: [0xdc,0xc1]
393 // CHECK: fadd %st(1)
394 // CHECK: encoding: [0xd8,0xc1]
395 fadd %st, %st(1)
396 fadd %st(1), %st
399 // rdar://8416805
400 // CHECK: xorb %al, %al
401 // CHECK: encoding: [0x30,0xc0]
402 // CHECK: xorw %di, %di
403 // CHECK: encoding: [0x66,0x31,0xff]
404 // CHECK: xorl %esi, %esi
405 // CHECK: encoding: [0x31,0xf6]
406 // CHECK: xorq %rsi, %rsi
407 // CHECK: encoding: [0x48,0x31,0xf6]
408 clrb %al
409 clr %di
410 clr %esi
411 clr %rsi
413 // rdar://8456378
414 cltq // CHECK: cltq
415 cdqe // CHECK: cltq
416 cwde // CHECK: cwtl
417 cwtl // CHECK: cwtl
419 // rdar://8416805
420 cbw // CHECK: cbtw
421 cwd // CHECK: cwtd
422 cdq // CHECK: cltd
424 // rdar://8456378 and PR7557 - fstsw
425 fstsw %ax
426 // CHECK: wait
427 // CHECK: fnstsw %ax
428 fstsw (%rax)
429 // CHECK: wait
430 // CHECK: fnstsw (%rax)
432 // PR8259
433 fstcw (%rsp)
434 // CHECK: wait
435 // CHECK: fnstcw (%rsp)
437 // PR8259
438 fstcw (%rsp)
439 // CHECK: wait
440 // CHECK: fnstcw (%rsp)
442 // PR8258
443 finit
444 // CHECK: wait
445 // CHECK: fninit
447 fsave 32493
448 // CHECK: wait
449 // CHECK: fnsave 32493
452 // rdar://8456382 - cvtsd2si support.
453 cvtsd2si %xmm1, %rax
454 // CHECK: cvtsd2siq %xmm1, %rax
455 // CHECK: encoding: [0xf2,0x48,0x0f,0x2d,0xc1]
456 cvtsd2si %xmm1, %eax
457 // CHECK: cvtsd2sil %xmm1, %eax
458 // CHECK: encoding: [0xf2,0x0f,0x2d,0xc1]
460 cvtsd2siq %xmm0, %rax // CHECK: cvtsd2siq %xmm0, %rax
461 cvtsd2sil %xmm0, %eax // CHECK: cvtsd2sil %xmm0, %eax
462 cvtsd2si %xmm0, %rax // CHECK: cvtsd2siq %xmm0, %rax
465 cvttpd2dq %xmm1, %xmm0 // CHECK: cvttpd2dq %xmm1, %xmm0
466 cvttpd2dq (%rax), %xmm0 // CHECK: cvttpd2dq (%rax), %xmm0
468 cvttps2dq %xmm1, %xmm0 // CHECK: cvttps2dq %xmm1, %xmm0
469 cvttps2dq (%rax), %xmm0 // CHECK: cvttps2dq (%rax), %xmm0
471 // rdar://8456376 - llvm-mc rejects 'roundss'
472 roundss $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x0a,0xc0,0x0e]
473 roundps $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x08,0xc0,0x0e]
474 roundsd $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x0b,0xc0,0x0e]
475 roundpd $0xE, %xmm0, %xmm0 // CHECK: encoding: [0x66,0x0f,0x3a,0x09,0xc0,0x0e]
478 // rdar://8482675 - 32-bit mem operand support in 64-bit mode (0x67 prefix)
479 leal 8(%eax), %esi
480 // CHECK: leal 8(%eax), %esi
481 // CHECK: encoding: [0x67,0x8d,0x70,0x08]
482 leaq 8(%eax), %rsi
483 // CHECK: leaq 8(%eax), %rsi
484 // CHECK: encoding: [0x67,0x48,0x8d,0x70,0x08]
485 leaq 8(%rax), %rsi
486 // CHECK: leaq 8(%rax), %rsi
487 // CHECK: encoding: [0x48,0x8d,0x70,0x08]
490 cvttpd2dq 0xdeadbeef(%ebx,%ecx,8),%xmm5
491 // CHECK: cvttpd2dq 3735928559(%ebx,%ecx,8), %xmm5
492 // CHECK: encoding: [0x67,0x66,0x0f,0xe6,0xac,0xcb,0xef,0xbe,0xad,0xde]
494 // rdar://8490728 - llvm-mc rejects 'movmskpd'
495 movmskpd %xmm6, %rax
496 // CHECK: movmskpd %xmm6, %rax
497 // CHECK: encoding: [0x66,0x48,0x0f,0x50,0xc6]
498 movmskpd %xmm6, %eax
499 // CHECK: movmskpd %xmm6, %eax
500 // CHECK: encoding: [0x66,0x0f,0x50,0xc6]
502 // rdar://8491845 - Gas supports commuted forms of non-commutable instructions.
503 fdivrp %st(0), %st(1) // CHECK: encoding: [0xde,0xf9]
504 fdivrp %st(1), %st(0) // CHECK: encoding: [0xde,0xf9]
506 fsubrp %ST(0), %ST(1) // CHECK: encoding: [0xde,0xe9]
507 fsubrp %ST(1), %ST(0) // CHECK: encoding: [0xde,0xe9]
510 movl foo(%rip), %eax
511 // CHECK: movl foo(%rip), %eax
512 // CHECK: encoding: [0x8b,0x05,A,A,A,A]
513 // CHECK: fixup A - offset: 2, value: foo-4, kind: reloc_riprel_4byte
515 movb $12, foo(%rip)
516 // CHECK: movb $12, foo(%rip)
517 // CHECK: encoding: [0xc6,0x05,A,A,A,A,0x0c]
518 // CHECK: fixup A - offset: 2, value: foo-5, kind: reloc_riprel_4byte
520 movw $12, foo(%rip)
521 // CHECK: movw $12, foo(%rip)
522 // CHECK: encoding: [0x66,0xc7,0x05,A,A,A,A,0x0c,0x00]
523 // CHECK: fixup A - offset: 3, value: foo-6, kind: reloc_riprel_4byte
525 movl $12, foo(%rip)
526 // CHECK: movl $12, foo(%rip)
527 // CHECK: encoding: [0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
528 // CHECK: fixup A - offset: 2, value: foo-8, kind: reloc_riprel_4byte
530 movq $12, foo(%rip)
531 // CHECK: movq $12, foo(%rip)
532 // CHECK: encoding: [0x48,0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
533 // CHECK: fixup A - offset: 3, value: foo-8, kind: reloc_riprel_4byte
535 // CHECK: addq $-424, %rax
536 // CHECK: encoding: [0x48,0x05,0x58,0xfe,0xff,0xff]
537 addq $-424, %rax
540 // CHECK: movq _foo@GOTPCREL(%rip), %rax
541 // CHECK: encoding: [0x48,0x8b,0x05,A,A,A,A]
542 // CHECK: fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
543 movq _foo@GOTPCREL(%rip), %rax
545 // CHECK: movq _foo@GOTPCREL(%rip), %r14
546 // CHECK: encoding: [0x4c,0x8b,0x35,A,A,A,A]
547 // CHECK: fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
548 movq _foo@GOTPCREL(%rip), %r14
551 // CHECK: movq (%r13,%rax,8), %r13
552 // CHECK: encoding: [0x4d,0x8b,0x6c,0xc5,0x00]
553 movq 0x00(%r13,%rax,8),%r13
555 // CHECK: testq %rax, %rbx
556 // CHECK: encoding: [0x48,0x85,0xd8]
557 testq %rax, %rbx
559 // CHECK: cmpq %rbx, %r14
560 // CHECK: encoding: [0x49,0x39,0xde]
561 cmpq %rbx, %r14
563 // rdar://7947167
565 movsq
566 // CHECK: movsq
567 // CHECK: encoding: [0x48,0xa5]
569 movsl
570 // CHECK: movsl
571 // CHECK: encoding: [0xa5]
573 stosq
574 // CHECK: stosq
575 // CHECK: encoding: [0x48,0xab]
576 stosl
577 // CHECK: stosl
578 // CHECK: encoding: [0xab]
581 // Not moffset forms of moves, they are x86-32 only! rdar://7947184
582 movb 0, %al // CHECK: movb 0, %al # encoding: [0x8a,0x04,0x25,0x00,0x00,0x00,0x00]
583 movw 0, %ax // CHECK: movw 0, %ax # encoding: [0x66,0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
584 movl 0, %eax // CHECK: movl 0, %eax # encoding: [0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
586 // CHECK: pushfq # encoding: [0x9c]
587 pushf
588 // CHECK: pushfq # encoding: [0x9c]
589 pushfq
590 // CHECK: popfq # encoding: [0x9d]
591 popf
592 // CHECK: popfq # encoding: [0x9d]
593 popfq
595 // CHECK: movabsq $-281474976710654, %rax
596 // CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
597 movabsq $0xFFFF000000000002, %rax
599 // CHECK: movabsq $-281474976710654, %rax
600 // CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
601 movq $0xFFFF000000000002, %rax
603 // CHECK: movq $-65536, %rax
604 // CHECK: encoding: [0x48,0xc7,0xc0,0x00,0x00,0xff,0xff]
605 movq $0xFFFFFFFFFFFF0000, %rax
607 // CHECK: movq $-256, %rax
608 // CHECK: encoding: [0x48,0xc7,0xc0,0x00,0xff,0xff,0xff]
609 movq $0xFFFFFFFFFFFFFF00, %rax
611 // CHECK: movq $10, %rax
612 // CHECK: encoding: [0x48,0xc7,0xc0,0x0a,0x00,0x00,0x00]
613 movq $10, %rax
615 // rdar://8014869
617 // CHECK: ret
618 // CHECK: encoding: [0xc3]
619 retq
621 // CHECK: sete %al
622 // CHECK: encoding: [0x0f,0x94,0xc0]
623 setz %al
625 // CHECK: setne %al
626 // CHECK: encoding: [0x0f,0x95,0xc0]
627 setnz %al
629 // CHECK: je 0
630 // CHECK: encoding: [0x74,A]
631 jz 0
633 // CHECK: jne
634 // CHECK: encoding: [0x75,A]
635 jnz 0
637 // rdar://8017515
638 btq $0x01,%rdx
639 // CHECK: btq $1, %rdx
640 // CHECK: encoding: [0x48,0x0f,0xba,0xe2,0x01]
642 //rdar://8017633
643 // CHECK: movzbl %al, %esi
644 // CHECK: encoding: [0x0f,0xb6,0xf0]
645 movzx %al, %esi
647 // CHECK: movzbq %al, %rsi
648 // CHECK: encoding: [0x48,0x0f,0xb6,0xf0]
649 movzx %al, %rsi
651 // CHECK: movsbw %al, %ax
652 // CHECK: encoding: [0x66,0x0f,0xbe,0xc0]
653 movsx %al, %ax
655 // CHECK: movsbl %al, %eax
656 // CHECK: encoding: [0x0f,0xbe,0xc0]
657 movsx %al, %eax
659 // CHECK: movswl %ax, %eax
660 // CHECK: encoding: [0x0f,0xbf,0xc0]
661 movsx %ax, %eax
663 // CHECK: movsbq %bl, %rax
664 // CHECK: encoding: [0x48,0x0f,0xbe,0xc3]
665 movsx %bl, %rax
667 // CHECK: movswq %cx, %rax
668 // CHECK: encoding: [0x48,0x0f,0xbf,0xc1]
669 movsx %cx, %rax
671 // CHECK: movslq %edi, %rax
672 // CHECK: encoding: [0x48,0x63,0xc7]
673 movsx %edi, %rax
675 // CHECK: movzbw %al, %ax
676 // CHECK: encoding: [0x66,0x0f,0xb6,0xc0]
677 movzx %al, %ax
679 // CHECK: movzbl %al, %eax
680 // CHECK: encoding: [0x0f,0xb6,0xc0]
681 movzx %al, %eax
683 // CHECK: movzwl %ax, %eax
684 // CHECK: encoding: [0x0f,0xb7,0xc0]
685 movzx %ax, %eax
687 // CHECK: movzbq %bl, %rax
688 // CHECK: encoding: [0x48,0x0f,0xb6,0xc3]
689 movzx %bl, %rax
691 // CHECK: movzwq %cx, %rax
692 // CHECK: encoding: [0x48,0x0f,0xb7,0xc1]
693 movzx %cx, %rax
695 // CHECK: movsbw (%rax), %ax
696 // CHECK: encoding: [0x66,0x0f,0xbe,0x00]
697 movsx (%rax), %ax
699 // CHECK: movzbw (%rax), %ax
700 // CHECK: encoding: [0x66,0x0f,0xb6,0x00]
701 movzx (%rax), %ax
704 // rdar://7873482
705 // CHECK: [0x65,0x8b,0x04,0x25,0x7c,0x00,0x00,0x00]
706 movl %gs:124, %eax
708 // CHECK: jmpq *8(%rax)
709 // CHECK: encoding: [0xff,0x60,0x08]
710 jmp *8(%rax)
712 // CHECK: btq $61, -216(%rbp)
713 // CHECK: encoding: [0x48,0x0f,0xba,0xa5,0x28,0xff,0xff,0xff,0x3d]
714 btq $61, -216(%rbp)
717 // rdar://8061602
719 jecxz L1
720 // CHECK: jecxz L1
721 // CHECK: encoding: [0x67,0xe3,A]
722 jrcxz L1
723 // CHECK: jrcxz L1
724 // CHECK: encoding: [0xe3,A]
726 // PR8061
727 xchgl 368(%rax),%ecx
728 // CHECK: xchgl %ecx, 368(%rax)
729 xchgl %ecx, 368(%rax)
730 // CHECK: xchgl %ecx, 368(%rax)
732 // rdar://8407548
733 xchg 0xdeadbeef(%rbx,%rcx,8),%bl
734 // CHECK: xchgb %bl, 3735928559(%rbx,%rcx,8)
738 // PR7254
739 lock incl 1(%rsp)
740 // CHECK: lock
741 // CHECK: incl 1(%rsp)
743 // rdar://8033482
744 rep movsl
745 // CHECK: rep
746 // CHECK: encoding: [0xf3]
747 // CHECK: movsl
748 // CHECK: encoding: [0xa5]
751 // rdar://8403974
752 iret
753 // CHECK: iretl
754 // CHECK: encoding: [0xcf]
755 iretw
756 // CHECK: iretw
757 // CHECK: encoding: [0x66,0xcf]
758 iretl
759 // CHECK: iretl
760 // CHECK: encoding: [0xcf]
761 iretq
762 // CHECK: iretq
763 // CHECK: encoding: [0x48,0xcf]
765 // rdar://8416805
766 // CHECK: retw $31438
767 // CHECK: encoding: [0x66,0xc2,0xce,0x7a]
768 retw $0x7ace
770 // CHECK: lretw $31438
771 // CHECK: encoding: [0x66,0xca,0xce,0x7a]
772 lretw $0x7ace
774 // rdar://8403907
775 sysret
776 // CHECK: sysretl
777 // CHECK: encoding: [0x0f,0x07]
778 sysretl
779 // CHECK: sysretl
780 // CHECK: encoding: [0x0f,0x07]
781 sysretq
782 // CHECK: sysretq
783 // CHECK: encoding: [0x48,0x0f,0x07]
785 // rdar://8407242
786 push %fs
787 // CHECK: pushq %fs
788 // CHECK: encoding: [0x0f,0xa0]
789 push %gs
790 // CHECK: pushq %gs
791 // CHECK: encoding: [0x0f,0xa8]
793 pushw %fs
794 // CHECK: pushw %fs
795 // CHECK: encoding: [0x66,0x0f,0xa0]
796 pushw %gs
797 // CHECK: pushw %gs
798 // CHECK: encoding: [0x66,0x0f,0xa8]
801 pop %fs
802 // CHECK: popq %fs
803 // CHECK: encoding: [0x0f,0xa1]
804 pop %gs
805 // CHECK: popq %gs
806 // CHECK: encoding: [0x0f,0xa9]
808 popw %fs
809 // CHECK: popw %fs
810 // CHECK: encoding: [0x66,0x0f,0xa1]
811 popw %gs
812 // CHECK: popw %gs
813 // CHECK: encoding: [0x66,0x0f,0xa9]
815 // rdar://8438816
816 fildq -8(%rsp)
817 fildll -8(%rsp)
818 // CHECK: fildll -8(%rsp)
819 // CHECK: encoding: [0xdf,0x6c,0x24,0xf8]
820 // CHECK: fildll -8(%rsp)
821 // CHECK: encoding: [0xdf,0x6c,0x24,0xf8]
823 // CHECK: callq a
824 callq a
826 // CHECK: leaq -40(%rbp), %r15
827 leaq -40(%rbp), %r15
831 // rdar://8013734 - Alias dr6=db6
832 mov %dr6, %rax
833 mov %db6, %rax
834 // CHECK: movq %dr6, %rax
835 // CHECK: movq %dr6, %rax
838 // INC/DEC encodings.
839 incb %al // CHECK: incb %al # encoding: [0xfe,0xc0]
840 incw %ax // CHECK: incw %ax # encoding: [0x66,0xff,0xc0]
841 incl %eax // CHECK: incl %eax # encoding: [0xff,0xc0]
842 decb %al // CHECK: decb %al # encoding: [0xfe,0xc8]
843 decw %ax // CHECK: decw %ax # encoding: [0x66,0xff,0xc8]
844 decl %eax // CHECK: decl %eax # encoding: [0xff,0xc8]
846 // rdar://8416805
847 // CHECK: lgdt 4(%rax)
848 // CHECK: encoding: [0x0f,0x01,0x50,0x04]
849 lgdt 4(%rax)
851 // CHECK: lgdt 4(%rax)
852 // CHECK: encoding: [0x0f,0x01,0x50,0x04]
853 lgdtq 4(%rax)
855 // CHECK: lidt 4(%rax)
856 // CHECK: encoding: [0x0f,0x01,0x58,0x04]
857 lidt 4(%rax)
859 // CHECK: lidt 4(%rax)
860 // CHECK: encoding: [0x0f,0x01,0x58,0x04]
861 lidtq 4(%rax)
863 // CHECK: sgdt 4(%rax)
864 // CHECK: encoding: [0x0f,0x01,0x40,0x04]
865 sgdt 4(%rax)
867 // CHECK: sgdt 4(%rax)
868 // CHECK: encoding: [0x0f,0x01,0x40,0x04]
869 sgdtq 4(%rax)
871 // CHECK: sidt 4(%rax)
872 // CHECK: encoding: [0x0f,0x01,0x48,0x04]
873 sidt 4(%rax)
875 // CHECK: sidt 4(%rax)
876 // CHECK: encoding: [0x0f,0x01,0x48,0x04]
877 sidtq 4(%rax)