70 for (
int x = 1;
x < num;
x++) {
99 const int MaxGlobal = 8;
100 const int MaxOutput = 16;
101 const int MaxLocal = 24;
102 const int MaxInput = 32;
103 const int MaxMicroReg = 40;
108 while (reg_idx >= MaxMicroReg)
109 reg_idx -= MaxMicroReg;
114 else if (reg_idx < MaxGlobal)
116 else if (reg_idx < MaxOutput)
117 ccprintf(os,
"%%o%d", reg_idx - MaxGlobal);
118 else if (reg_idx < MaxLocal)
119 ccprintf(os,
"%%l%d", reg_idx - MaxOutput);
120 else if (reg_idx < MaxInput)
121 ccprintf(os,
"%%i%d", reg_idx - MaxLocal);
122 else if (reg_idx < MaxMicroReg)
123 ccprintf(os,
"%%u%d", reg_idx - MaxInput);
126 switch (reg_idx - MaxMicroReg) {
253 std::stringstream
ss;
320 panic(
"Tried testing condition nonexistant condition code %d", condition);
332 CondCodes condCodes = codes;
344 return !(condCodes.z | (condCodes.n ^ condCodes.v));
346 return condCodes.z | (condCodes.n ^ condCodes.v);
348 return !(condCodes.n ^ condCodes.v);
350 return (condCodes.n ^ condCodes.v);
352 return !(condCodes.c | condCodes.z);
354 return (condCodes.c | condCodes.z);
368 panic(
"Tried testing condition nonexistant " 369 "condition code %d", condition);
#define panic(...)
This implements a cprintf based panic() function.
void ccprintf(cp::Print &print)
static void printReg(std::ostream &os, RegId reg)
static void printMnemonic(std::ostream &os, const char *mnemonic)
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const override
Internal function to generate disassembly string.
int8_t _numSrcRegs
See numSrcRegs().
void advancePC(PCState &pcState) const override
RegId _destRegIdx[MaxInstDestRegs]
See destRegIdx().
static bool passesFpCondition(uint32_t fcc, uint32_t condition)
const char * mnemonic
Base mnemonic (e.g., "add").
const char * CondTestAbbrev[]
Hyper privileged registers.
void printSrcReg(std::ostream &os, int reg) const
EndBitUnion(HPSTATE) BitUnion16(PSTATE) Bitfield< 1 > ie
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Ancillary State Registers.
const int FramePointerReg
void printDestReg(std::ostream &os, int reg) const
int8_t _numDestRegs
See numDestRegs().
RegId _srcRegIdx[MaxInstSrcRegs]
See srcRegIdx().
void printRegArray(std::ostream &os, const RegId indexArray[], int num) const
const int StackPointerReg
const RegIndex & index() const
Index accessors.
static bool passesCondition(uint32_t codes, uint32_t condition)
Register ID: describe an architectural register with its class and index.
BitUnion32(UserDescFlags) Bitfield< 0 > seg_32bit
Floating Point Status Register.