[llvm] r198226 - Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilter and ExactFilter. No functional change.

Craig Topper craig.topper at gmail.com
Mon Dec 30 09:37:10 PST 2013


Author: ctopper
Date: Mon Dec 30 11:37:10 2013
New Revision: 198226

URL: http://llvm.org/viewvc/llvm-project?rev=198226&view=rev
Log:
Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilter and ExactFilter. No functional change.

Modified:
    llvm/trunk/utils/TableGen/X86ModRMFilters.cpp
    llvm/trunk/utils/TableGen/X86ModRMFilters.h
    llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp

Modified: llvm/trunk/utils/TableGen/X86ModRMFilters.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86ModRMFilters.cpp?rev=198226&r1=198225&r2=198226&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86ModRMFilters.cpp (original)
+++ llvm/trunk/utils/TableGen/X86ModRMFilters.cpp Mon Dec 30 11:37:10 2013
@@ -17,8 +17,6 @@ void DumbFilter::anchor() { }
 
 void ModFilter::anchor() { }
 
-void EscapeFilter::anchor() { }
-
 void AddRegEscapeFilter::anchor() { }
 
 void ExtendedFilter::anchor() { }

Modified: llvm/trunk/utils/TableGen/X86ModRMFilters.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86ModRMFilters.h?rev=198226&r1=198225&r2=198226&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86ModRMFilters.h (original)
+++ llvm/trunk/utils/TableGen/X86ModRMFilters.h Mon Dec 30 11:37:10 2013
@@ -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

Modified: llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp?rev=198226&r1=198225&r2=198226&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp (original)
+++ llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp Mon Dec 30 11:37:10 2013
@@ -1081,7 +1081,7 @@ void RecognizableInstr::emitDecodePath(D
       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(D
     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))





More information about the llvm-commits mailing list