From: Andrew V. Tischenko Date: Mon, 30 Oct 2017 12:02:06 +0000 (+0000) Subject: Invalid used of 'w' suffix on push and pop using 64-bit register. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1172d65aaf1196fe47d66318a65afa524e8a2ab7;p=llvm Invalid used of 'w' suffix on push and pop using 64-bit register. Differential Revision: https://reviews.llvm.org/D38626 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316898 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp index 709fc630633..843d037ad3c 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp @@ -949,8 +949,10 @@ static int getID(struct InternalInstruction* insn, const void *miiArg) { } } - if (insn->rexPrefix & 0x08) + if (insn->rexPrefix & 0x08) { attrMask |= ATTR_REXW; + attrMask &= ~ATTR_ADSIZE; + } /* * JCXZ/JECXZ need special handling for 16-bit mode because the meaning diff --git a/test/MC/Disassembler/X86/x86-64.txt b/test/MC/Disassembler/X86/x86-64.txt index dbc49eb3f68..97690f5613e 100644 --- a/test/MC/Disassembler/X86/x86-64.txt +++ b/test/MC/Disassembler/X86/x86-64.txt @@ -479,12 +479,10 @@ # CHECK: nopq %rax 0x48 0x0f 0x1f 0xC0 -# TODO: wrong dissassembler with 0x67 prefix: expected popq -# CHECK: popw %r14 +# CHECK: popq %r14 0x67 0x49 0x5e -# TODO: wrong dissassembler with 0x67 prefix: expected pushq -# CHECK: pushw %r14 +# CHECK: pushq %r14 0x67 0x49 0x56 # CHECK: xchgw %di, %ax