Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp =================================================================== --- lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp +++ lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp @@ -961,8 +961,13 @@ attrMask |= ATTR_XD; } - if (insn->rexPrefix & 0x08) + if (insn->rexPrefix & 0x08) { attrMask |= ATTR_REXW; + if (attrMask & ATTR_ADSIZE) { + attrMask &= ~ATTR_ADSIZE; + attrMask |= ATTR_XS; + } + } /* * JCXZ/JECXZ need special handling for 16-bit mode because the meaning Index: test/MC/Disassembler/X86/x86-64.txt =================================================================== --- test/MC/Disassembler/X86/x86-64.txt +++ test/MC/Disassembler/X86/x86-64.txt @@ -293,13 +293,13 @@ # CHECK: movabsq 6510615555426900570, %rax 0x48 0xa1 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a -# CHECK: movq 1515870810, %rax +# CHECK: movabsq 1515870810, %rax 0x67, 0x48 0xa1 0x5a 0x5a 0x5a 0x5a # CHECK: movabsq %rax, 6510615555426900570 0x48 0xa3 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a -# CHECK: movq %rax, 1515870810 +# CHECK: movabsq %rax, 1515870810 0x67, 0x48 0xa3 0x5a 0x5a 0x5a 0x5a # CHECK: callq -32769 @@ -486,3 +486,9 @@ # CHECK: nopq %rax 0x48 0x0f 0x1f 0xC0 + +# CHECK: popq %r14 +0x67 0x49 0x5e + +# CHECK: pushq %r14 +0x67 0x49 0x56