aboutsummaryrefslogtreecommitdiff
path: root/test/MC/Disassembler/X86/prefixes.txt
blob: 983e09670d6814557bfd0a3824988b5fdbd2bc16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s

# CHECK: rep
# CHECK-NEXT: insb    %dx, %es:(%rdi)
0xf3 0x6c #rep ins
# CHECK: rep
# CHECK-NEXT: insl    %dx, %es:(%rdi)
0xf3 0x6d #rep ins
# CHECK: rep
# CHECK-NEXT: movsb   (%rsi), %es:(%rdi)
0xf3 0xa4 #rep movs
# CHECK: rep
# CHECK-NEXT: movsl   (%rsi), %es:(%rdi)
0xf3 0xa5 #rep movs
# CHECK: rep
# CHECK-NEXT: outsb   (%rsi), %dx
0xf3 0x6e #rep outs
# CHECK: rep
# CHECK-NEXT: outsl   (%rsi), %dx
0xf3 0x6f #rep outs
# CHECK: rep
# CHECK-NEXT: lodsb   (%rsi), %al
0xf3 0xac #rep lods
# CHECK: rep
# CHECK-NEXT: lodsl   (%rsi), %eax
0xf3 0xad #rep lods
# CHECK: rep
# CHECK-NEXT: stosb   %al, %es:(%rdi)
0xf3 0xaa #rep stos
# CHECK: rep
# CHECK-NEXT: stosl   %eax, %es:(%rdi)
0xf3 0xab #rep stos
# CHECK: rep
# CHECK-NEXT: cmpsb   %es:(%rdi), (%rsi)
0xf3 0xa6 #rep cmps
# CHECK: rep
# CHECK-NEXT: cmpsl   %es:(%rdi), (%rsi)
0xf3 0xa7 #repe cmps
# CHECK: rep
# CHECK-NEXT: scasb   %es:(%rdi), %al
0xf3 0xae #repe scas
# CHECK: rep
# CHECK-NEXT: scasl   %es:(%rdi), %eax
0xf3 0xaf #repe scas
# CHECK: repne
# CHECK-NEXT: cmpsb   %es:(%rdi), (%rsi)
0xf2 0xa6 #repne cmps
# CHECK: repne
# CHECK-NEXT: cmpsl   %es:(%rdi), (%rsi)
0xf2 0xa7 #repne cmps
# CHECK: repne
# CHECK-NEXT: scasb   %es:(%rdi), %al
0xf2 0xae #repne scas
# CHECK: repne
# CHECK-NEXT: scasl   %es:(%rdi), %eax
0xf2 0xaf #repne scas

# CHECK: lock
# CHECK-NEXT:	orl	$16, %fs:776
0xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x10

# CHECK: movq	%fs:768, %rdi
0x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x00

# CHECK: rep
# CHECK-NEXT:		stosq %rax, %es:(%rdi)
0xf3 0x48 0xab

# CHECK: rep
# CHECK-NEXT:		stosq %rax, %es:(%edi)
0xf3 0x67 0x48 0xab

# CHECK: movl 32(%rbp), %eax
0x8b 0x45 0x20

# CHECK: movl %es:32(%rbp), %eax
0x26 0x8b 0x45 0x20

# CHECK: movl %es:32(%rbp), %eax
0x2e 0x26 0x8b 0x45 0x20

# Test that multiple prefixes stack.
#    (todo- the correct disassembly is actually more like "es movl %cs:32(%rbp), %eax"
#    but we don't support that)
# CHECK: movl %cs:32(%rbp), %eax
0x26 0x2e 0x8b 0x45 0x20

# Test that 0xf3 as part of the opcode works.
# CHECK: cvtdq2pd	(%rax), %xmm0
0xf3 0x0f 0xe6 0x00

# CHECK: pause
0xf3 0x90

# CHECK: nop
0x90

# CHECK: 		lock
# CHECK-NEXT:	nop
0xf0 0x90

# Test that immediate is printed correctly within opsize prefix
# CHECK: addw    $-12, %ax
0x66,0x83,0xc0,0xf4

# Test that multiple redundant prefixes work (redundant, but valid x86).
# CHECK: rep
# CHECK-NEXT: stosq
0xf3 0xf3 0x48 0xab


# Test that we can disassembler control registers above CR8
# CHECK: movq %cr15, %rax
0x44 0x0f 0x20 0xf8
# CHECK: movq %dr15, %rax
0x44 0x0f 0x21 0xf8

# Test that MMX ignore REX.R and REX.B.
# CHECK: movq %mm0, %mm1
0x46 0x0f 0x7f 0xc1

# Test that a prefix on it's own works. It's debatable as to if this is 
# something that is considered valid, but however as LLVM's own disassembler
# has decided to disassemble prefixes as being separate opcodes, it therefore 
# should be capable of re-consuming it's own output.
# CHECK: rep
0xf3
# ***IMPORTANT ^-- this must be at the end of the file to be a valid test ***