summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-12-30 17:37:10 +0000
committerCraig Topper <craig.topper@gmail.com>2013-12-30 17:37:10 +0000
commitd7109840cdb5dc0caef3a561e5f36a24844bd1d0 (patch)
tree11c82ae5023a1df27bdd4bd481166fb24e10b731 /utils
parent5be77762a3aa434ee877b0a03b98b5c3a7571918 (diff)
downloadllvm-d7109840cdb5dc0caef3a561e5f36a24844bd1d0.tar.gz
llvm-d7109840cdb5dc0caef3a561e5f36a24844bd1d0.tar.bz2
llvm-d7109840cdb5dc0caef3a561e5f36a24844bd1d0.tar.xz
Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilter and ExactFilter. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/X86ModRMFilters.cpp2
-rw-r--r--utils/TableGen/X86ModRMFilters.h29
-rw-r--r--utils/TableGen/X86RecognizableInstr.cpp17
3 files changed, 15 insertions, 33 deletions
diff --git a/utils/TableGen/X86ModRMFilters.cpp b/utils/TableGen/X86ModRMFilters.cpp
index 7166fe02d8..a311603df9 100644
--- a/utils/TableGen/X86ModRMFilters.cpp
+++ b/utils/TableGen/X86ModRMFilters.cpp
@@ -17,8 +17,6 @@ void DumbFilter::anchor() { }
void ModFilter::anchor() { }
-void EscapeFilter::anchor() { }
-
void AddRegEscapeFilter::anchor() { }
void ExtendedFilter::anchor() { }
diff --git a/utils/TableGen/X86ModRMFilters.h b/utils/TableGen/X86ModRMFilters.h
index 497915fe33..5ab1a48846 100644
--- a/utils/TableGen/X86ModRMFilters.h
+++ b/utils/TableGen/X86ModRMFilters.h
@@ -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
diff --git a/utils/TableGen/X86RecognizableInstr.cpp b/utils/TableGen/X86RecognizableInstr.cpp
index 3472c8a046..1eb579df3f 100644
--- a/utils/TableGen/X86RecognizableInstr.cpp
+++ b/utils/TableGen/X86RecognizableInstr.cpp
@@ -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))