Invalid used of 'w' suffix on push and pop using 64-bit register.
authorAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Mon, 30 Oct 2017 12:02:06 +0000 (12:02 +0000)
committerAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Mon, 30 Oct 2017 12:02:06 +0000 (12:02 +0000)
Differential Revision: https://reviews.llvm.org/D38626

llvm-svn: 316898

llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
llvm/test/MC/Disassembler/X86/x86-64.txt

index 709fc63..843d037 100644 (file)
@@ -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
index dbc49eb..97690f5 100644 (file)
 # 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