Change unsigned to a uint16_t in static disassembler tables to reduce the table size.

llvm-svn: 163594
This commit is contained in:
Craig Topper 2012-09-11 04:19:21 +00:00
parent 7419c5fb45
commit 8702c5b7c0
3 changed files with 6 additions and 2 deletions

View File

@ -78,7 +78,7 @@
uint16_t operands; uint16_t operands;
#define INSTRUCTION_IDS \ #define INSTRUCTION_IDS \
unsigned instructionIDs; uint16_t instructionIDs;
#include "X86DisassemblerDecoderCommon.h" #include "X86DisassemblerDecoderCommon.h"

View File

@ -24,7 +24,7 @@ extern "C" {
uint16_t operands; uint16_t operands;
#define INSTRUCTION_IDS \ #define INSTRUCTION_IDS \
unsigned instructionIDs; uint16_t instructionIDs;
#include "X86DisassemblerDecoderCommon.h" #include "X86DisassemblerDecoderCommon.h"

View File

@ -366,6 +366,10 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
break; break;
} }
// We assume that the index can fit into uint16_t.
assert(sEntryNumber < 65536U &&
"Index into ModRMDecision is too large for uint16_t!");
++sTableNumber; ++sTableNumber;
} }