Fix disassembling of PAUSE instruction. Fixes PR10900. Also fixed NOP disassembling...
authorCraig Topper <craig.topper@gmail.com>
Sun, 11 Sep 2011 20:23:20 +0000 (20:23 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 11 Sep 2011 20:23:20 +0000 (20:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139484 91177308-0d34-0410-b5e6-96231b3b80d8

test/MC/Disassembler/X86/simple-tests.txt
utils/TableGen/X86DisassemblerTables.cpp
utils/TableGen/X86RecognizableInstr.cpp

index ef36a6b80d00e711f7bd034e3683e2a78d921c4f..62f3464d830fa722c4577a1cc39a589014e58b0a 100644 (file)
 
 # CHECK: vinsertps $129, %xmm3, %xmm2, %xmm1
 0xc4 0xe3 0x69 0x21 0xcb 0x81
+
+# CHECK: pause
+0xf3 0x90
index e0cbb18a4b8e1a36d8e7d51b45b9b09bdd9d8348..aed27279a51bca36d3178a13b5e14234af02f48e 100644 (file)
@@ -613,8 +613,10 @@ void DisassemblerTables::setTableFields(ModRMDecision     &decision,
         if(newInfo.filtered)
           continue; // filtered instructions get lowest priority
         
-        if(previousInfo.name == "NOOP")
-          continue; // special case for XCHG32ar and NOOP
+        if(previousInfo.name == "NOOP" && (newInfo.name == "XCHG16ar" ||
+                                           newInfo.name == "XCHG32ar" ||
+                                           newInfo.name == "XCHG64ar"))
+          continue; // special case for XCHG*ar and NOOP
 
         if (outranks(previousInfo.insnContext, newInfo.insnContext))
           continue;
index 5f8fe6ee4ccbfb16d9ba2faf641ecd57713d1354..f43a93938bbd859014ba4bd2b180000d422693f3 100644 (file)
@@ -325,7 +325,7 @@ InstructionContext RecognizableInstr::insnContext() const {
       insnContext = IC_OPSIZE;
     else if (Prefix == X86Local::XD)
       insnContext = IC_XD;
-    else if (Prefix == X86Local::XS)
+    else if (Prefix == X86Local::XS || Prefix == X86Local::REP)
       insnContext = IC_XS;
     else
       insnContext = IC;
@@ -882,6 +882,7 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
     }
     opcodeToSet = 0xd8 + (Prefix - X86Local::D8);
     break;
+  case X86Local::REP:
   default:
     opcodeType = ONEBYTE;
     switch (Opcode) {