1# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s 2 3# CHECK: rep insb %dx, %es:(%rdi) 40xf3 0x6c #rep ins 5# CHECK: rep insl %dx, %es:(%rdi) 60xf3 0x6d #rep ins 7# CHECK: rep movsb (%rsi), %es:(%rdi) 80xf3 0xa4 #rep movs 9# CHECK: rep movsl (%rsi), %es:(%rdi) 100xf3 0xa5 #rep movs 11# CHECK: rep outsb (%rsi), %dx 120xf3 0x6e #rep outs 13# CHECK: rep outsl (%rsi), %dx 140xf3 0x6f #rep outs 15# CHECK: rep lodsb (%rsi), %al 160xf3 0xac #rep lods 17# CHECK: rep lodsl (%rsi), %eax 180xf3 0xad #rep lods 19# CHECK: rep stosb %al, %es:(%rdi) 200xf3 0xaa #rep stos 21# CHECK: rep stosl %eax, %es:(%rdi) 220xf3 0xab #rep stos 23# CHECK: rep cmpsb %es:(%rdi), (%rsi) 240xf3 0xa6 #rep cmps 25# CHECK: rep cmpsl %es:(%rdi), (%rsi) 260xf3 0xa7 #repe cmps 27# CHECK: rep scasb %es:(%rdi), %al 280xf3 0xae #repe scas 29# CHECK: rep scasl %es:(%rdi), %eax 300xf3 0xaf #repe scas 31# CHECK: repne cmpsb %es:(%rdi), (%rsi) 320xf2 0xa6 #repne cmps 33# CHECK: repne cmpsl %es:(%rdi), (%rsi) 340xf2 0xa7 #repne cmps 35# CHECK: repne scasb %es:(%rdi), %al 360xf2 0xae #repne scas 37# CHECK: repne scasl %es:(%rdi), %eax 380xf2 0xaf #repne scas 39 40# CHECK: repne scasw %es:(%rdi), %ax 41# CHECK: repne scasw %es:(%rdi), %ax 420x66 0xF2 0xAF 0xF2 0x66 0xAF 43 44# CHECK: lock 45# CHECK-NEXT: orl $16, %fs:776 460xf0 0x64 0x83 0x0c 0x25 0x08 0x03 0x00 0x00 0x10 47 48# CHECK: movq %fs:768, %rdi 490x64 0x48 0x8b 0x3c 0x25 0x00 0x03 0x00 0x00 50 51# CHECK: rep stosq %rax, %es:(%rdi) 520xf3 0x48 0xab 53 54# CHECK: rep stosq %rax, %es:(%edi) 550xf3 0x67 0x48 0xab 56 57# CHECK: movl 32(%rbp), %eax 580x8b 0x45 0x20 59 60# CHECK: movl %es:32(%rbp), %eax 610x26 0x8b 0x45 0x20 62 63# CHECK: movl %es:32(%rbp), %eax 640x2e 0x26 0x8b 0x45 0x20 65 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 700x26 0x2e 0x8b 0x45 0x20 71 72# Test that 0xf3 as part of the opcode works. 73# CHECK: cvtdq2pd (%rax), %xmm0 740xf3 0x0f 0xe6 0x00 75 76# CHECK: pause 770xf3 0x90 78 79# CHECK: nop 800x90 81 82# CHECK: lock 83# CHECK-NEXT: nop 840xf0 0x90 85 86# Test that immediate is printed correctly within opsize prefix 87# CHECK: addw $-12, %ax 880x66,0x83,0xc0,0xf4 89 90# Test that multiple redundant prefixes work (redundant, but valid x86). 91# CHECK: rep stosq 920xf3 0xf3 0x48 0xab 93 94# Test that we can disassembler control registers above CR8 95# CHECK: movq %cr15, %rax 960x44 0x0f 0x20 0xf8 97# CHECK: movq %dr15, %rax 980x44 0x0f 0x21 0xf8 99 100# Test that MMX ignore REX.R and REX.B. 101# CHECK: movq %mm0, %mm1 1020x46 0x0f 0x7f 0xc1 103 104# Test that lock prefix is not dropped if it's not the first prefix 105# CHECK: lock cmpxchgw %di, (%rcx) 1060x66 0xf0 0x0f 0xb1 0x39 107 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. 112# CHECK: rep 1130xf3 114# ***IMPORTANT ^-- this must be at the end of the file to be a valid test *** 115