1 # RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s
3 # CHECK: rep insb %dx, %es:(%rdi)
5 # CHECK: rep insl %dx, %es:(%rdi)
7 # CHECK: rep movsb (%rsi), %es:(%rdi)
9 # CHECK: rep movsl (%rsi), %es:(%rdi)
11 # CHECK: rep outsb (%rsi), %dx
13 # CHECK: rep outsl (%rsi), %dx
15 # CHECK: rep lodsb (%rsi), %al
17 # CHECK: rep lodsl (%rsi), %eax
19 # CHECK: rep stosb %al, %es:(%rdi)
21 # CHECK: rep stosl %eax, %es:(%rdi)
23 # CHECK: rep cmpsb %es:(%rdi), (%rsi)
25 # CHECK: rep cmpsl %es:(%rdi), (%rsi)
27 # CHECK: rep scasb %es:(%rdi), %al
29 # CHECK: rep scasl %es:(%rdi), %eax
31 # CHECK: repne cmpsb %es:(%rdi), (%rsi)
33 # CHECK: repne cmpsl %es:(%rdi), (%rsi)
35 # CHECK: repne scasb %es:(%rdi), %al
37 # CHECK: repne scasl %es:(%rdi), %eax
40 # CHECK: repne scasw %es:(%rdi), %ax
41 # CHECK: repne scasw %es:(%rdi), %ax
42 0x66 0xF2 0xAF 0xF2 0x66 0xAF
45 # CHECK-NEXT: orl $16, %fs:776
46 0xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x10
48 # CHECK: movq %fs:768, %rdi
49 0x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x00
51 # CHECK: rep stosq %rax, %es:(%rdi)
54 # CHECK: rep stosq %rax, %es:(%edi)
57 # CHECK: movl 32(%rbp), %eax
60 # CHECK: movl %es:32(%rbp), %eax
63 # CHECK: movl %es:32(%rbp), %eax
64 0x2e 0x26 0x8b 0x45 0x20
66 # Test that multiple prefixes stack.
67 # (todo- the correct disassembly is actually more like "es movl %cs:32(%rbp), %eax"
68 # but we don't support that)
69 # CHECK: movl %cs:32(%rbp), %eax
70 0x26 0x2e 0x8b 0x45 0x20
72 # Test that 0xf3 as part of the opcode works.
73 # CHECK: cvtdq2pd (%rax), %xmm0
86 # Test that immediate is printed correctly within opsize prefix
87 # CHECK: addw $-12, %ax
90 # Test that multiple redundant prefixes work (redundant, but valid x86).
94 # Test that we can disassembler control registers above CR8
95 # CHECK: movq %cr15, %rax
97 # CHECK: movq %dr15, %rax
100 # Test that MMX ignore REX.R and REX.B.
101 # CHECK: movq %mm0, %mm1
104 # Test that lock prefix is not dropped if it's not the first prefix
105 # CHECK: lock cmpxchgw %di, (%rcx)
106 0x66 0xf0 0x0f 0xb1 0x39
108 # Test that a prefix on it's own works. It's debatable as to if this is
109 # something that is considered valid, but however as LLVM's own disassembler
110 # has decided to disassemble prefixes as being separate opcodes, it therefore
111 # should be capable of re-consuming it's own output.
114 # ***IMPORTANT ^-- this must be at the end of the file to be a valid test ***