[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
Wed Oct 25 02:13:28 PDT 2017


avt77 updated this revision to Diff 120213.
avt77 added a comment.

The fix was refactored accordingly to Simon's suggest.
Could somebody give me LGTM?


https://reviews.llvm.org/D38626

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


Index: test/MC/Disassembler/X86/x86-64.txt
===================================================================
--- test/MC/Disassembler/X86/x86-64.txt
+++ test/MC/Disassembler/X86/x86-64.txt
@@ -486,3 +486,9 @@
 
 # CHECK: nopq %rax
 0x48 0x0f 0x1f 0xC0
+
+# CHECK: popq    %r14
+0x67 0x49 0x5e
+
+# CHECK: pushq    %r14
+0x67 0x49 0x56
Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
===================================================================
--- lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+++ lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
@@ -961,8 +961,10 @@
       attrMask |= ATTR_XD;
   }
 
-  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.120213.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171025/bb74bb8a/attachment.bin>


More information about the llvm-commits mailing list