From 9e6dc8b9e70c98fc269303a5a94f0476942fb35a Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 11 Sep 2012 04:19:21 +0000 Subject: [PATCH] Change unsigned to a uint16_t in static disassembler tables to reduce the table size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163594 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/Disassembler/X86Disassembler.h | 2 +- lib/Target/X86/Disassembler/X86DisassemblerDecoder.h | 2 +- utils/TableGen/X86DisassemblerTables.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/Disassembler/X86Disassembler.h b/lib/Target/X86/Disassembler/X86Disassembler.h index 0dbfa260014..981701f5276 100644 --- a/lib/Target/X86/Disassembler/X86Disassembler.h +++ b/lib/Target/X86/Disassembler/X86Disassembler.h @@ -78,7 +78,7 @@ uint16_t operands; #define INSTRUCTION_IDS \ - unsigned instructionIDs; + uint16_t instructionIDs; #include "X86DisassemblerDecoderCommon.h" diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h index 05cbb4c5975..407ead3cafa 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h @@ -24,7 +24,7 @@ extern "C" { uint16_t operands; #define INSTRUCTION_IDS \ - unsigned instructionIDs; + uint16_t instructionIDs; #include "X86DisassemblerDecoderCommon.h" diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp index f3bd373708f..8526621599a 100644 --- a/utils/TableGen/X86DisassemblerTables.cpp +++ b/utils/TableGen/X86DisassemblerTables.cpp @@ -366,6 +366,10 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2, break; } + // We assume that the index can fit into uint16_t. + assert(sEntryNumber < 65536U && + "Index into ModRMDecision is too large for uint16_t!"); + ++sTableNumber; } -- 2.34.1