Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilt...
authorCraig Topper <craig.topper@gmail.com>
Mon, 30 Dec 2013 17:37:10 +0000 (17:37 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 30 Dec 2013 17:37:10 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198226 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/X86ModRMFilters.cpp
utils/TableGen/X86ModRMFilters.h
utils/TableGen/X86RecognizableInstr.cpp

index 7166fe02d8901278161a0ab36db2eabc69f5941b..a311603df9d5a38e039515482f579ee967a18e01 100644 (file)
@@ -17,8 +17,6 @@ void DumbFilter::anchor() { }
 
 void ModFilter::anchor() { }
 
-void EscapeFilter::anchor() { }
-
 void AddRegEscapeFilter::anchor() { }
 
 void ExtendedFilter::anchor() { }
index 497915fe33458248341f6d719da95e14bcb6b04e..5ab1a48846bbb0cbea27f55a56384d95bad18784 100644 (file)
@@ -84,35 +84,6 @@ public:
   }
 };
 
-/// EscapeFilter - Filters escape opcodes, which are classified in two ways.  If
-///   the ModR/M byte is between 0xc0 and 0xff, then there is one slot for each
-///   possible value.  Otherwise, there is one instruction for each value of the
-///   nnn field [bits 5-3], known elsewhere as the reg field.
-class EscapeFilter : public ModRMFilter {
-  virtual void anchor();
-  bool C0_FF;
-  uint8_t NNN_or_ModRM;
-public:
-  /// Constructor
-  ///
-  /// \param c0_ff True if the ModR/M byte must fall between 0xc0 and 0xff;
-  ///              false otherwise.
-  ///
-  /// \param nnn_or_modRM If c0_ff is true, the required value of the entire
-  ///                     ModR/M byte.  If c0_ff is false, the required value
-  ///                     of the nnn field.
-  EscapeFilter(bool c0_ff, uint8_t nnn_or_modRM) :
-    ModRMFilter(),
-    C0_FF(c0_ff),
-    NNN_or_ModRM(nnn_or_modRM) {
-  }
-
-  bool accepts(uint8_t modRM) const {
-    return ((C0_FF && modRM >= 0xc0 && (modRM == NNN_or_ModRM)) ||
-            (!C0_FF && modRM < 0xc0  && ((modRM & 0x38) >> 3) == NNN_or_ModRM));
-  }
-};
-
 /// AddRegEscapeFilter - Some escape opcodes have one of the register operands
 ///   added to the ModR/M byte, meaning that a range of eight ModR/M values
 ///   maps to a single instruction.  Such instructions require the ModR/M byte
index 3472c8a046c0d6d8eb20c08aba66bd0ef44b1574..1eb579df3f5c2a8daaa83178803f3c87378c0c57 100644 (file)
@@ -1081,7 +1081,7 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
       Spec->modifierBase = Opcode;
       filter = new AddRegEscapeFilter(Opcode);
     } else {
-      filter = new EscapeFilter(true, Opcode);
+      filter = new ExactFilter(Opcode);
     }
     opcodeToSet = 0xd8 + (Prefix - X86Local::D8);
     break;
@@ -1127,7 +1127,20 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
     case 0xdd:
     case 0xde:
     case 0xdf:
-      filter = new EscapeFilter(false, Form - X86Local::MRM0m);
+      switch (Form) {
+      default:
+        llvm_unreachable("Unhandled escape opcode form");
+      case X86Local::MRM0m:
+      case X86Local::MRM1m:
+      case X86Local::MRM2m:
+      case X86Local::MRM3m:
+      case X86Local::MRM4m:
+      case X86Local::MRM5m:
+      case X86Local::MRM6m:
+      case X86Local::MRM7m:
+        filter = new ExtendedFilter(false, Form - X86Local::MRM0m);
+        break;
+      } // switch (Form)
       break;
     default:
       if (needsModRMForDecode(Form))