forked from OSchip/llvm-project
Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilter and ExactFilter. No functional change.
llvm-svn: 198226
This commit is contained in:
parent
c4a82438a7
commit
6d776e2660
|
@ -17,8 +17,6 @@ void DumbFilter::anchor() { }
|
|||
|
||||
void ModFilter::anchor() { }
|
||||
|
||||
void EscapeFilter::anchor() { }
|
||||
|
||||
void AddRegEscapeFilter::anchor() { }
|
||||
|
||||
void ExtendedFilter::anchor() { }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue