[llvm-commits] [llvm] r117084 - in /llvm/trunk: lib/Target/X86/Disassembler/X86DisassemblerDecoder.c test/MC/Disassembler/simple-tests.txt
Sean Callanan
scallanan at apple.com
Thu Oct 21 18:24:11 PDT 2010
Author: spyffe
Date: Thu Oct 21 20:24:11 2010
New Revision: 117084
URL: http://llvm.org/viewvc/llvm-project?rev=117084&view=rev
Log:
Fixed handling of immediate operand sizes, which
weren't properly reflecting the OperandSize attribute
of the instruction leading to improper decoding of
certain instructions with the 66H prefix. Also added
a test case for this.
Modified:
llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
llvm/trunk/test/MC/Disassembler/simple-tests.txt
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c?rev=117084&r1=117083&r2=117084&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c Thu Oct 21 20:24:11 2010
@@ -405,7 +405,7 @@
insn->registerSize = (hasOpSize ? 2 : 4);
insn->addressSize = (hasAdSize ? 2 : 4);
insn->displacementSize = (hasAdSize ? 2 : 4);
- insn->immediateSize = (hasAdSize ? 2 : 4);
+ insn->immediateSize = (hasOpSize ? 2 : 4);
} else if (insn->mode == MODE_64BIT) {
if (insn->rexPrefix && wFromREX(insn->rexPrefix)) {
insn->registerSize = 8;
Modified: llvm/trunk/test/MC/Disassembler/simple-tests.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/simple-tests.txt?rev=117084&r1=117083&r2=117084&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/simple-tests.txt (original)
+++ llvm/trunk/test/MC/Disassembler/simple-tests.txt Thu Oct 21 20:24:11 2010
@@ -63,3 +63,6 @@
# CHECK: enter $1, $2
0xc8 0x01 0x00 0x02
+
+# CHECK: movw $47416, -66(%rbp)
+0x66 0xc7 0x45 0xbe 0x38 0xb9
More information about the llvm-commits
mailing list