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"};
138 const char * suffix =
"";
140 reg_idx &= ~IntFoldBit;
144 else if (reg_idx < 8 && size == 1)
149 ccprintf(os, abcdFormats[size],
"a");
152 ccprintf(os, abcdFormats[size],
"b");
155 ccprintf(os, abcdFormats[size],
"c");
158 ccprintf(os, abcdFormats[size],
"d");
161 ccprintf(os, piFormats[size],
"sp");
164 ccprintf(os, piFormats[size],
"bp");
167 ccprintf(os, piFormats[size],
"si");
170 ccprintf(os, piFormats[size],
"di");
173 ccprintf(os, longFormats[size],
"8");
176 ccprintf(os, longFormats[size],
"9");
179 ccprintf(os, longFormats[size],
"10");
182 ccprintf(os, longFormats[size],
"11");
185 ccprintf(os, longFormats[size],
"12");
188 ccprintf(os, longFormats[size],
"13");
191 ccprintf(os, longFormats[size],
"14");
194 ccprintf(os, longFormats[size],
"15");
208 ccprintf(os,
"%%xmm%d_%s", reg_idx / 2,
209 (reg_idx % 2) ?
"high":
"low");
233 uint64_t disp, uint8_t addressSize,
bool rip)
const 235 bool someAddr =
false;
242 if (scale != 0 && index !=
ZeroReg)
272 std::stringstream
ss;
#define panic(...)
This implements a cprintf based panic() function.
void ccprintf(cp::Print &print)
bool isMiscReg() const
true if it is a condition-code physical register.
int8_t _numSrcRegs
See numSrcRegs().
Class for register indices passed to instruction constructors.
void printDestReg(std::ostream &os, int reg, int size) const
RegId _destRegIdx[MaxInstDestRegs]
See destRegIdx().
void printReg(std::ostream &os, RegId reg, int size) const
const char * mnemonic
Base mnemonic (e.g., "add").
bool isCCReg() const
true if it is a condition-code physical register.
void printSegment(std::ostream &os, int segment) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static const IntRegIndex IntFoldBit
void printMnemonic(std::ostream &os, const char *mnemonic) const
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 _numDestRegs
See numDestRegs().
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
This is exposed globally, independent of the ISA.
RegId _srcRegIdx[MaxInstSrcRegs]
See srcRegIdx().
const RegIndex & index() const
Index accessors.
void printSrcReg(std::ostream &os, int reg, int size) const
Register ID: describe an architectural register with its class and index.