Fix the disassembly of the X86 "crc32w %ax, %eax" instruction. Bug 10702.
authorKevin Enderby <enderby@apple.com>
Fri, 2 Sep 2011 18:03:03 +0000 (18:03 +0000)
committerKevin Enderby <enderby@apple.com>
Fri, 2 Sep 2011 18:03:03 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139014 91177308-0d34-0410-b5e6-96231b3b80d8

test/MC/Disassembler/X86/x86-32.txt
utils/TableGen/X86RecognizableInstr.cpp

index 7e93c63ba6e7349fb706c70e0fdebda01a48f404..38221f8d8417ba95d49ec3eb0000f529023e3bb8 100644 (file)
@@ -27,3 +27,6 @@
 
 # CHECK: crc32b %al, %eax
 0xf2 0x0f 0x38 0xf0 0xc0
+
+# CHECK: crc32w %ax, %eax
+0x66 0xf2 0x0f 0x38 0xf1 0xc0
index 1b37aa8fe8455025e80c917aa6016e3fd9f3f9a9..5f8fe6ee4ccbfb16d9ba2faf641ecd57713d1354 100644 (file)
@@ -225,7 +225,8 @@ RecognizableInstr::RecognizableInstr(DisassemblerTables &tables,
   
   Operands = &insn.Operands.OperandList;
   
-  IsSSE            = HasOpSizePrefix && (Name.find("16") == Name.npos);
+  IsSSE            = (HasOpSizePrefix && (Name.find("16") == Name.npos)) ||
+                     (Name.find("CRC32") != Name.npos);
   HasFROperands    = hasFROperands();
   HasVEX_LPrefix   = has256BitOperands() || Rec->getValueAsBit("hasVEX_L");
   
@@ -318,7 +319,9 @@ InstructionContext RecognizableInstr::insnContext() const {
     else
       insnContext = IC_64BIT;
   } else {
-    if (HasOpSizePrefix)
+    if (HasOpSizePrefix && Prefix == X86Local::TF)
+      insnContext = IC_XD;
+    else if (HasOpSizePrefix)
       insnContext = IC_OPSIZE;
     else if (Prefix == X86Local::XD)
       insnContext = IC_XD;