xref: /aosp_15_r20/external/llvm/test/MC/Disassembler/X86/prefixes.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker# CHECK: lock
4*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:	orl	$16, %fs:776
5*9880d681SAndroid Build Coastguard Worker0xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x10
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker# CHECK: movq	%fs:768, %rdi
8*9880d681SAndroid Build Coastguard Worker0x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x00
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker# CHECK: rep
11*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:		stosq %rax, %es:(%rdi)
12*9880d681SAndroid Build Coastguard Worker0xf3 0x48 0xab
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker# CHECK: rep
15*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:		stosq %rax, %es:(%edi)
16*9880d681SAndroid Build Coastguard Worker0xf3 0x67 0x48 0xab
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker# CHECK: movl 32(%rbp), %eax
19*9880d681SAndroid Build Coastguard Worker0x8b 0x45 0x20
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker# CHECK: movl %es:32(%rbp), %eax
22*9880d681SAndroid Build Coastguard Worker0x26 0x8b 0x45 0x20
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker# CHECK: movl %es:32(%rbp), %eax
25*9880d681SAndroid Build Coastguard Worker0x2e 0x26 0x8b 0x45 0x20
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker# Test that multiple prefixes stack.
28*9880d681SAndroid Build Coastguard Worker#    (todo- the correct disassembly is actually more like "es movl %cs:32(%rbp), %eax"
29*9880d681SAndroid Build Coastguard Worker#    but we don't support that)
30*9880d681SAndroid Build Coastguard Worker# CHECK: movl %cs:32(%rbp), %eax
31*9880d681SAndroid Build Coastguard Worker0x26 0x2e 0x8b 0x45 0x20
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker# Test that 0xf3 as part of the opcode works.
34*9880d681SAndroid Build Coastguard Worker# CHECK: cvtdq2pd	(%rax), %xmm0
35*9880d681SAndroid Build Coastguard Worker0xf3 0x0f 0xe6 0x00
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker# CHECK: pause
38*9880d681SAndroid Build Coastguard Worker0xf3 0x90
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Worker# CHECK: nop
41*9880d681SAndroid Build Coastguard Worker0x90
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Worker# CHECK: 		lock
44*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:	nop
45*9880d681SAndroid Build Coastguard Worker0xf0 0x90
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker# Test that immediate is printed correctly within opsize prefix
48*9880d681SAndroid Build Coastguard Worker# CHECK: addw    $-12, %ax
49*9880d681SAndroid Build Coastguard Worker0x66,0x83,0xc0,0xf4
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker# Test that multiple redundant prefixes work (redundant, but valid x86).
52*9880d681SAndroid Build Coastguard Worker# CHECK: rep
53*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: rep
54*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: stosq
55*9880d681SAndroid Build Coastguard Worker0xf3 0xf3 0x48 0xab
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker# Test that we can disassembler control registers above CR8
59*9880d681SAndroid Build Coastguard Worker# CHECK: movq %cr15, %rax
60*9880d681SAndroid Build Coastguard Worker0x44 0x0f 0x20 0xf8
61*9880d681SAndroid Build Coastguard Worker# CHECK: movq %dr15, %rax
62*9880d681SAndroid Build Coastguard Worker0x44 0x0f 0x21 0xf8
63*9880d681SAndroid Build Coastguard Worker
64*9880d681SAndroid Build Coastguard Worker# Test that MMX ignore REX.R and REX.B.
65*9880d681SAndroid Build Coastguard Worker# CHECK: movq %mm0, %mm1
66*9880d681SAndroid Build Coastguard Worker0x46 0x0f 0x7f 0xc1
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Worker# Test that a prefix on it's own works. It's debatable as to if this is
69*9880d681SAndroid Build Coastguard Worker# something that is considered valid, but however as LLVM's own disassembler
70*9880d681SAndroid Build Coastguard Worker# has decided to disassemble prefixes as being separate opcodes, it therefore
71*9880d681SAndroid Build Coastguard Worker# should be capable of re-consuming it's own output.
72*9880d681SAndroid Build Coastguard Worker# CHECK: rep
73*9880d681SAndroid Build Coastguard Worker0xf3
74*9880d681SAndroid Build Coastguard Worker# ***IMPORTANT ^-- this must be at the end of the file to be a valid test ***
75