[PATCH] D38626: Invalid used of 'w' suffix on push and pop using 64-bit register

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 05:02:44 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316898: Invalid used of 'w' suffix on push and pop using 64-bit register. (authored by avt77).

Changed prior to commit:
  https://reviews.llvm.org/D38626?vs=120567&id=120801#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38626

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


Index: llvm/trunk/test/MC/Disassembler/X86/x86-64.txt
===================================================================
--- llvm/trunk/test/MC/Disassembler/X86/x86-64.txt
+++ llvm/trunk/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
Index: llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
@@ -949,8 +949,10 @@
     }
   }
 
-  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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38626.120801.patch
Type: text/x-patch
Size: 1097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171030/271b5fd1/attachment.bin>


More information about the llvm-commits mailing list