115 lines · plain
1# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s2 3# CHECK: rep insb %dx, %es:(%rdi)40xf3 0x6c #rep ins5# CHECK: rep insl %dx, %es:(%rdi)60xf3 0x6d #rep ins7# CHECK: rep movsb (%rsi), %es:(%rdi)80xf3 0xa4 #rep movs9# CHECK: rep movsl (%rsi), %es:(%rdi)100xf3 0xa5 #rep movs11# CHECK: rep outsb (%rsi), %dx120xf3 0x6e #rep outs13# CHECK: rep outsl (%rsi), %dx140xf3 0x6f #rep outs15# CHECK: rep lodsb (%rsi), %al160xf3 0xac #rep lods17# CHECK: rep lodsl (%rsi), %eax180xf3 0xad #rep lods19# CHECK: rep stosb %al, %es:(%rdi)200xf3 0xaa #rep stos21# CHECK: rep stosl %eax, %es:(%rdi)220xf3 0xab #rep stos23# CHECK: rep cmpsb %es:(%rdi), (%rsi)240xf3 0xa6 #rep cmps25# CHECK: rep cmpsl %es:(%rdi), (%rsi)260xf3 0xa7 #repe cmps27# CHECK: rep scasb %es:(%rdi), %al280xf3 0xae #repe scas29# CHECK: rep scasl %es:(%rdi), %eax300xf3 0xaf #repe scas31# CHECK: repne cmpsb %es:(%rdi), (%rsi)320xf2 0xa6 #repne cmps33# CHECK: repne cmpsl %es:(%rdi), (%rsi)340xf2 0xa7 #repne cmps35# CHECK: repne scasb %es:(%rdi), %al360xf2 0xae #repne scas37# CHECK: repne scasl %es:(%rdi), %eax380xf2 0xaf #repne scas39 40# CHECK: repne scasw %es:(%rdi), %ax41# CHECK: repne scasw %es:(%rdi), %ax420x66 0xF2 0xAF 0xF2 0x66 0xAF43 44# CHECK: lock45# CHECK-NEXT: orl $16, %fs:776460xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x1047 48# CHECK: movq %fs:768, %rdi490x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x0050 51# CHECK: rep stosq %rax, %es:(%rdi)520xf3 0x48 0xab53 54# CHECK: rep stosq %rax, %es:(%edi)550xf3 0x67 0x48 0xab56 57# CHECK: movl 32(%rbp), %eax580x8b 0x45 0x2059 60# CHECK: movl %es:32(%rbp), %eax610x26 0x8b 0x45 0x2062 63# CHECK: movl %es:32(%rbp), %eax640x2e 0x26 0x8b 0x45 0x2065 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), %eax700x26 0x2e 0x8b 0x45 0x2071 72# Test that 0xf3 as part of the opcode works.73# CHECK: cvtdq2pd (%rax), %xmm0740xf3 0x0f 0xe6 0x0075 76# CHECK: pause770xf3 0x9078 79# CHECK: nop800x9081 82# CHECK: lock83# CHECK-NEXT: nop840xf0 0x9085 86# Test that immediate is printed correctly within opsize prefix87# CHECK: addw $-12, %ax880x66,0x83,0xc0,0xf489 90# Test that multiple redundant prefixes work (redundant, but valid x86).91# CHECK: rep stosq920xf3 0xf3 0x48 0xab93 94# Test that we can disassembler control registers above CR895# CHECK: movq %cr15, %rax960x44 0x0f 0x20 0xf897# CHECK: movq %dr15, %rax980x44 0x0f 0x21 0xf899 100# Test that MMX ignore REX.R and REX.B.101# CHECK: movq %mm0, %mm11020x46 0x0f 0x7f 0xc1103 104# Test that lock prefix is not dropped if it's not the first prefix105# CHECK: lock cmpxchgw %di, (%rcx)1060x66 0xf0 0x0f 0xb1 0x39107 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 disassembler110# has decided to disassemble prefixes as being separate opcodes, it therefore 111# should be capable of re-consuming it's own output.112# CHECK: rep1130xf3114# ***IMPORTANT ^-- this must be at the end of the file to be a valid test *** 115