summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/X86RecognizableInstr.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-08-22 07:38:36 +0000
committerCraig Topper <craig.topper@gmail.com>2016-08-22 07:38:36 +0000
commit1867c6acc724d1928d9e50df9e9dc30beb789ad0 (patch)
tree34c897c3d31e569552846ec1424e6dec0fd89d3e /llvm/utils/TableGen/X86RecognizableInstr.cpp
parent313226fdbc18ecf656ff98634f96e7bf174a452d (diff)
downloadbcm5719-llvm-1867c6acc724d1928d9e50df9e9dc30beb789ad0.tar.gz
bcm5719-llvm-1867c6acc724d1928d9e50df9e9dc30beb789ad0.zip
[X86] Merge small helper function into the switch that calls it since they both operate on the same variable. NFC
llvm-svn: 279421
Diffstat (limited to 'llvm/utils/TableGen/X86RecognizableInstr.cpp')
-rw-r--r--llvm/utils/TableGen/X86RecognizableInstr.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/llvm/utils/TableGen/X86RecognizableInstr.cpp b/llvm/utils/TableGen/X86RecognizableInstr.cpp
index ffeac80d286..8fb500374ef 100644
--- a/llvm/utils/TableGen/X86RecognizableInstr.cpp
+++ b/llvm/utils/TableGen/X86RecognizableInstr.cpp
@@ -138,19 +138,6 @@ namespace X86Local {
using namespace X86Disassembler;
-/// isRegFormat - Indicates whether a particular form requires the Mod field of
-/// the ModR/M byte to be 0b11.
-///
-/// @param form - The form of the instruction.
-/// @return - true if the form implies that Mod must be 0b11, false
-/// otherwise.
-static bool isRegFormat(uint8_t form) {
- return (form == X86Local::MRMDestReg ||
- form == X86Local::MRMSrcReg ||
- form == X86Local::MRMXr ||
- (form >= X86Local::MRM0r && form <= X86Local::MRM7r));
-}
-
/// byteFromBitsInit - Extracts a value at most 8 bits in width from a BitsInit.
/// Useful for switch statements and the like.
///
@@ -853,10 +840,15 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
case X86Local::RawFrmImm16:
filter = new DumbFilter();
break;
- case X86Local::MRMDestReg: case X86Local::MRMDestMem:
- case X86Local::MRMSrcReg: case X86Local::MRMSrcMem:
- case X86Local::MRMXr: case X86Local::MRMXm:
- filter = new ModFilter(isRegFormat(Form));
+ case X86Local::MRMDestReg:
+ case X86Local::MRMSrcReg:
+ case X86Local::MRMXr:
+ filter = new ModFilter(true);
+ break;
+ case X86Local::MRMDestMem:
+ case X86Local::MRMSrcMem:
+ case X86Local::MRMXm:
+ filter = new ModFilter(false);
break;
case X86Local::MRM0r: case X86Local::MRM1r:
case X86Local::MRM2r: case X86Local::MRM3r:
OpenPOWER on IntegriCloud