Flatten some of the arrays in the X86 disassembler tables to reduce space needed to store pointers on 64-bit hosts and reduce relocations needed at startup. Part of PR11953.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2012-02-09 07:45:30 +00:00
parent 72a043f9d6
commit ce8f4c58d8
4 changed files with 44 additions and 45 deletions
@@ -78,7 +78,7 @@
const char* name;
#define INSTRUCTION_IDS \
const InstrUID *instructionIDs;
unsigned instructionIDs;
#include "X86DisassemblerDecoderCommon.h"
@@ -131,14 +131,13 @@ static InstrUID decode(OpcodeType type,
debug("Corrupt table! Unknown modrm_type");
return 0;
case MODRM_ONEENTRY:
return dec->instructionIDs[0];
return modRMTable[dec->instructionIDs];
case MODRM_SPLITRM:
if (modFromModRM(modRM) == 0x3)
return dec->instructionIDs[1];
else
return dec->instructionIDs[0];
return modRMTable[dec->instructionIDs+1];
return modRMTable[dec->instructionIDs];
case MODRM_FULL:
return dec->instructionIDs[modRM];
return modRMTable[dec->instructionIDs+modRM];
}
}
@@ -24,7 +24,7 @@ extern "C" {
const char* name;
#define INSTRUCTION_IDS \
const InstrUID *instructionIDs;
unsigned instructionIDs;
#include "X86DisassemblerDecoderCommon.h"