[LLVMdev] X86 disassembler 0x66 prefix

Olivier Meurant meurant.olivier at gmail.com
Wed Dec 22 08:31:31 PST 2010


There is a problem on X86 disassembler for instructions beginning with x86
prefix :

$ echo "0x66 0x0f 0x6f 0x8f 0x00 0x00 0x00 0x00" | llvm-mc --disassemble
        movdqa  (%edi), %xmm1

$ echo "0x53 0x66 0x0f 0x6f 0x8f 0x00 0x00 0x00 0x00" | llvm-mc
--disassemble
        pushl   %ebx
<stdin>:1:6: warning: invalid instruction encoding
0x53 0x66 0x0f 0x6f 0x8f 0x00 0x00 0x00 0x00
     ^


I attach a patch, but I'm not really familiar with this code, so if someone
can review/correct, it would be great.

The problem is between readPrefixes and getId : prefixLocation depends on
buffer position, but necessaryPrefixLocation is never updated to match
buffer position.

Cheers,
Olivier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101222/4e629a89/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86_disassembler_66_prefix.patch
Type: text/x-patch
Size: 688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101222/4e629a89/attachment.bin>


More information about the llvm-dev mailing list