2013-08-31 05:19:48 +08:00
|
|
|
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s
|
|
|
|
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep insb %dx, %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0x6c #rep ins
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep insl %dx, %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0x6d #rep ins
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep movsb (%rsi), %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xa4 #rep movs
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep movsl (%rsi), %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xa5 #rep movs
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep outsb (%rsi), %dx
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0x6e #rep outs
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep outsl (%rsi), %dx
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0x6f #rep outs
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep lodsb (%rsi), %al
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xac #rep lods
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep lodsl (%rsi), %eax
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xad #rep lods
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep stosb %al, %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xaa #rep stos
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep stosl %eax, %es:(%rdi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xab #rep stos
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep cmpsb %es:(%rdi), (%rsi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xa6 #rep cmps
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep cmpsl %es:(%rdi), (%rsi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xa7 #repe cmps
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep scasb %es:(%rdi), %al
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xae #repe scas
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep scasl %es:(%rdi), %eax
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf3 0xaf #repe scas
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: repne cmpsb %es:(%rdi), (%rsi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf2 0xa6 #repne cmps
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: repne cmpsl %es:(%rdi), (%rsi)
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf2 0xa7 #repne cmps
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: repne scasb %es:(%rdi), %al
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf2 0xae #repne scas
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: repne scasl %es:(%rdi), %eax
|
2017-10-16 19:14:29 +08:00
|
|
|
0xf2 0xaf #repne scas
|
|
|
|
|
2017-11-19 07:23:25 +08:00
|
|
|
# CHECK: repne scasw %es:(%rdi), %ax
|
|
|
|
# CHECK: repne scasw %es:(%rdi), %ax
|
|
|
|
0x66 0xF2 0xAF 0xF2 0x66 0xAF
|
|
|
|
|
2013-08-31 05:19:48 +08:00
|
|
|
# CHECK: lock
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK-NEXT: orl $16, %fs:776
|
2013-08-31 05:19:48 +08:00
|
|
|
0xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x10
|
|
|
|
|
|
|
|
# CHECK: movq %fs:768, %rdi
|
|
|
|
0x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x00
|
|
|
|
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep stosq %rax, %es:(%rdi)
|
2013-08-31 05:19:48 +08:00
|
|
|
0xf3 0x48 0xab
|
|
|
|
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep stosq %rax, %es:(%edi)
|
2013-08-31 05:19:48 +08:00
|
|
|
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
|
|
|
|
|
2014-04-23 15:21:04 +08:00
|
|
|
# Test that immediate is printed correctly within opsize prefix
|
|
|
|
# CHECK: addw $-12, %ax
|
|
|
|
0x66,0x83,0xc0,0xf4
|
|
|
|
|
2013-08-31 05:19:48 +08:00
|
|
|
# Test that multiple redundant prefixes work (redundant, but valid x86).
|
2017-11-03 23:25:13 +08:00
|
|
|
# CHECK: rep stosq
|
2013-08-31 05:19:48 +08:00
|
|
|
0xf3 0xf3 0x48 0xab
|
|
|
|
|
2014-12-27 02:19:44 +08:00
|
|
|
# Test that we can disassembler control registers above CR8
|
|
|
|
# CHECK: movq %cr15, %rax
|
|
|
|
0x44 0x0f 0x20 0xf8
|
2014-12-27 02:20:05 +08:00
|
|
|
# CHECK: movq %dr15, %rax
|
|
|
|
0x44 0x0f 0x21 0xf8
|
2014-12-27 02:19:44 +08:00
|
|
|
|
|
|
|
# Test that MMX ignore REX.R and REX.B.
|
|
|
|
# CHECK: movq %mm0, %mm1
|
|
|
|
0x46 0x0f 0x7f 0xc1
|
|
|
|
|
2013-08-31 05:19:48 +08:00
|
|
|
# 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 ***
|