76 for (
int x = 1;
x < num;
x++) {
113 const int MaxGlobal = 8;
114 const int MaxOutput = 16;
115 const int MaxLocal = 24;
116 const int MaxInput = 32;
117 const int MaxMicroReg = 40;
122 while (reg_idx >= MaxMicroReg)
123 reg_idx -= MaxMicroReg;
128 else if (reg_idx < MaxGlobal)
130 else if (reg_idx < MaxOutput)
132 else if (reg_idx < MaxLocal)
134 else if (reg_idx < MaxInput)
136 else if (reg_idx < MaxMicroReg)
140 switch (reg_idx - MaxMicroReg) {
268 std::stringstream
ss;
335 panic(
"Tried testing condition nonexistant condition code %d", condition);
347 CondCodes condCodes = codes;
359 return !(condCodes.z | (condCodes.n ^ condCodes.v));
361 return condCodes.z | (condCodes.n ^ condCodes.v);
363 return !(condCodes.n ^ condCodes.v);
365 return (condCodes.n ^ condCodes.v);
367 return !(condCodes.c | condCodes.z);
369 return (condCodes.c | condCodes.z);
383 panic(
"Tried testing condition nonexistant "
384 "condition code %d", condition);
Register ID: describe an architectural register with its class and index.
void printRegArray(std::ostream &os, const RegId *indexArray, int num) const
static bool passesCondition(uint32_t codes, uint32_t condition)
static void printReg(std::ostream &os, RegId reg)
static void printMnemonic(std::ostream &os, const char *mnemonic)
void advancePC(PCStateBase &pcState) const override
void printDestReg(std::ostream &os, int reg) const
static bool passesFpCondition(uint32_t fcc, uint32_t condition)
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
void printSrcReg(std::ostream &os, int reg) const
uint8_t _numSrcRegs
See numSrcRegs().
uint8_t _numDestRegs
See numDestRegs().
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
const char * mnemonic
Base mnemonic (e.g., "add").
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual const PCStateBase & pcState() const =0
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
#define panic(...)
This implements a cprintf based panic() function.
@ MISCREG_HPSTATE
Hyper privileged registers.
@ MISCREG_ASI
Ancillary State Registers.
@ MISCREG_FSR
Floating Point Status Register.
@ MISCREG_TPC
Privilged Registers.
constexpr auto & StackPointerReg
constexpr auto & FramePointerReg
@ FUnorderedOrLessOrEqual
@ FUnorderedOrGreaterOrEqual
const char * CondTestAbbrev[]
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ FloatRegClass
Floating-point register.
@ IntRegClass
Integer register.
void ccprintf(cp::Print &print)