Skip to content

Commit 1867c6a

Browse files
committed
[X86] Merge small helper function into the switch that calls it since they both operate on the same variable. NFC
llvm-svn: 279421
1 parent 313226f commit 1867c6a

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

llvm/utils/TableGen/X86RecognizableInstr.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,6 @@ namespace X86Local {
138138

139139
using namespace X86Disassembler;
140140

141-
/// isRegFormat - Indicates whether a particular form requires the Mod field of
142-
/// the ModR/M byte to be 0b11.
143-
///
144-
/// @param form - The form of the instruction.
145-
/// @return - true if the form implies that Mod must be 0b11, false
146-
/// otherwise.
147-
static bool isRegFormat(uint8_t form) {
148-
return (form == X86Local::MRMDestReg ||
149-
form == X86Local::MRMSrcReg ||
150-
form == X86Local::MRMXr ||
151-
(form >= X86Local::MRM0r && form <= X86Local::MRM7r));
152-
}
153-
154141
/// byteFromBitsInit - Extracts a value at most 8 bits in width from a BitsInit.
155142
/// Useful for switch statements and the like.
156143
///
@@ -853,10 +840,15 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
853840
case X86Local::RawFrmImm16:
854841
filter = new DumbFilter();
855842
break;
856-
case X86Local::MRMDestReg: case X86Local::MRMDestMem:
857-
case X86Local::MRMSrcReg: case X86Local::MRMSrcMem:
858-
case X86Local::MRMXr: case X86Local::MRMXm:
859-
filter = new ModFilter(isRegFormat(Form));
843+
case X86Local::MRMDestReg:
844+
case X86Local::MRMSrcReg:
845+
case X86Local::MRMXr:
846+
filter = new ModFilter(true);
847+
break;
848+
case X86Local::MRMDestMem:
849+
case X86Local::MRMSrcMem:
850+
case X86Local::MRMXm:
851+
filter = new ModFilter(false);
860852
break;
861853
case X86Local::MRM0r: case X86Local::MRM1r:
862854
case X86Local::MRM2r: case X86Local::MRM3r:

0 commit comments

Comments
 (0)