49 const char * mnemonic)
const
55 const char * instMnemonic,
const char * mnemonic)
const
57 ccprintf(os,
" %s : %s ", instMnemonic, mnemonic);
104 panic(
"Unrecognized segment %d\n", segment);
125 assert(size == 1 || size == 2 || size == 4 || size == 8);
126 static const char * abcdFormats[9] =
127 {
"",
"%s",
"%sx",
"",
"e%sx",
"",
"",
"",
"r%sx"};
128 static const char * piFormats[9] =
129 {
"",
"%s",
"%s",
"",
"e%s",
"",
"",
"",
"r%s"};
130 static const char * longFormats[9] =
131 {
"",
"r%sb",
"r%sw",
"",
"r%sd",
"",
"",
"",
"r%s"};
132 static const char * microFormats[9] =
133 {
"",
"t%db",
"t%dw",
"",
"t%dd",
"",
"",
"",
"t%d"};
139 const char * suffix =
"";
141 rel_reg &= ~IntFoldBit;
145 else if (rel_reg < 8 && size == 1)
150 ccprintf(os, abcdFormats[size],
"a");
153 ccprintf(os, abcdFormats[size],
"b");
156 ccprintf(os, abcdFormats[size],
"c");
159 ccprintf(os, abcdFormats[size],
"d");
162 ccprintf(os, piFormats[size],
"sp");
165 ccprintf(os, piFormats[size],
"bp");
168 ccprintf(os, piFormats[size],
"si");
171 ccprintf(os, piFormats[size],
"di");
174 ccprintf(os, longFormats[size],
"8");
177 ccprintf(os, longFormats[size],
"9");
180 ccprintf(os, longFormats[size],
"10");
183 ccprintf(os, longFormats[size],
"11");
186 ccprintf(os, longFormats[size],
"12");
189 ccprintf(os, longFormats[size],
"13");
192 ccprintf(os, longFormats[size],
"14");
195 ccprintf(os, longFormats[size],
"15");
211 ccprintf(os,
"%%xmm%d_%s", rel_reg / 2,
212 (rel_reg % 2) ?
"high":
"low");
240 uint64_t disp, uint8_t addressSize,
bool rip)
const
242 bool someAddr =
false;
249 if (scale != 0 && index !=
ZeroReg)
279 std::stringstream
ss;
void ccprintf(cp::Print &print)
void printMem(std::ostream &os, uint8_t segment, uint8_t scale, RegIndex index, RegIndex base, uint64_t disp, uint8_t addressSize, bool rip) const
int8_t _numSrcRegs
See numSrcRegs().
const char * mnemonic
Base mnemonic (e.g., "add").
void printMnemonic(std::ostream &os, const char *mnemonic) const
TheISA::RegIndex RegIndex
Logical register index type.
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
RegIndex _srcRegIdx[MaxInstSrcRegs]
See srcRegIdx().
void printSegment(std::ostream &os, int segment) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void printDestReg(std::ostream &os, int reg, int size) const
static const IntRegIndex IntFoldBit
int8_t _numDestRegs
See numDestRegs().
void printReg(std::ostream &os, int reg, int size) const
void printSrcReg(std::ostream &os, int reg, int size) const
RegIndex _destRegIdx[MaxInstDestRegs]
See destRegIdx().
RegClass regIdxToClass(TheISA::RegIndex reg_idx, TheISA::RegIndex *rel_reg_idx=NULL)
Map a 'unified' architectural register index to its register class.