[llvm] b94e9b7 - [X86] Remove MODRM_SPLITREGM from the disassembler tables.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 00:17:17 PDT 2020


Author: Craig Topper
Date: 2020-07-03T00:16:20-07:00
New Revision: b94e9b7f053875bf3f1c1c61e0c0fa9336a2b2c1

URL: https://github.com/llvm/llvm-project/commit/b94e9b7f053875bf3f1c1c61e0c0fa9336a2b2c1
DIFF: https://github.com/llvm/llvm-project/commit/b94e9b7f053875bf3f1c1c61e0c0fa9336a2b2c1.diff

LOG: [X86] Remove MODRM_SPLITREGM from the disassembler tables.

This offers a very minor table size reduction due to only being
used for one AMX opcode.

Added: 
    

Modified: 
    llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
    llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
    llvm/utils/TableGen/X86DisassemblerTables.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
index b03b0dd1a87f..5697ff9a01dc 100644
--- a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
+++ b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
@@ -323,7 +323,6 @@ typedef uint16_t InstrUID;
   ENUM_ENTRY(MODRM_SPLITRM)   \
   ENUM_ENTRY(MODRM_SPLITMISC)  \
   ENUM_ENTRY(MODRM_SPLITREG)  \
-  ENUM_ENTRY(MODRM_SPLITREGM) \
   ENUM_ENTRY(MODRM_FULL)
 
 #define ENUM_ENTRY(n) n,

diff  --git a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp b/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
index befdb2c608cf..a7fa1eb9a5ee 100644
--- a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
+++ b/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
@@ -166,9 +166,6 @@ static InstrUID decode(OpcodeType type, InstructionContext insnContext,
     if (modFromModRM(modRM) == 0x3)
       return modRMTable[dec->instructionIDs + ((modRM & 0x38) >> 3) + 8];
     return modRMTable[dec->instructionIDs + ((modRM & 0x38) >> 3)];
-  case MODRM_SPLITREGM:
-    assert(modFromModRM(modRM) == 0x3);
-    return modRMTable[dec->instructionIDs+(modRM & 0x7)];
   case MODRM_SPLITMISC:
     if (modFromModRM(modRM) == 0x3)
       return modRMTable[dec->instructionIDs + (modRM & 0x3f) + 8];

diff  --git a/llvm/utils/TableGen/X86DisassemblerTables.cpp b/llvm/utils/TableGen/X86DisassemblerTables.cpp
index 3a95df23f420..76e4fd9a13ee 100644
--- a/llvm/utils/TableGen/X86DisassemblerTables.cpp
+++ b/llvm/utils/TableGen/X86DisassemblerTables.cpp
@@ -595,7 +595,6 @@ static ModRMDecisionType getDecisionType(ModRMDecision &decision) {
   bool satisfiesOneEntry = true;
   bool satisfiesSplitRM = true;
   bool satisfiesSplitReg = true;
-  bool satisfiesSplitRegM = true;
   bool satisfiesSplitMisc = true;
 
   for (unsigned index = 0; index < 256; ++index) {
@@ -617,10 +616,6 @@ static ModRMDecisionType getDecisionType(ModRMDecision &decision) {
     if (((index & 0xc0) != 0xc0) &&
        (decision.instructionIDs[index] != decision.instructionIDs[index&0x38]))
       satisfiesSplitMisc = false;
-
-    if (((index & 0xc0) == 0xc0) &&
-       (decision.instructionIDs[index] != decision.instructionIDs[index&0xc7]))
-      satisfiesSplitRegM = false;
   }
 
   if (satisfiesOneEntry)
@@ -632,9 +627,6 @@ static ModRMDecisionType getDecisionType(ModRMDecision &decision) {
   if (satisfiesSplitReg && satisfiesSplitMisc)
     return MODRM_SPLITREG;
 
-  if (satisfiesSplitRegM)
-    return MODRM_SPLITREGM;
-
   if (satisfiesSplitMisc)
     return MODRM_SPLITMISC;
 
@@ -699,10 +691,6 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
       for (unsigned index = 0xc0; index < 256; index += 8)
         ModRMDecision.push_back(decision.instructionIDs[index]);
       break;
-    case MODRM_SPLITREGM:
-      for (unsigned index = 0xc0; index < 256; index += 8)
-        ModRMDecision.push_back(decision.instructionIDs[index]);
-      break;
     case MODRM_SPLITMISC:
       for (unsigned index = 0; index < 64; index += 8)
         ModRMDecision.push_back(decision.instructionIDs[index]);
@@ -744,9 +732,6 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
     case MODRM_SPLITREG:
       sEntryNumber += 16;
       break;
-    case MODRM_SPLITREGM:
-      sEntryNumber += 8;
-      break;
     case MODRM_SPLITMISC:
       sEntryNumber += 8 + 64;
       break;


        


More information about the llvm-commits mailing list