45 using namespace MipsISA;
53 panic(
"getArgument() not implemented\n");
65 double sdouble_val = fp_val;
66 void *sdouble_ptr = &sdouble_val;
67 uint64_t sdp_bits = *(uint64_t *) sdouble_ptr;
73 int32_t sword_val = (int32_t) fp_val;
74 void *sword_ptr = &sword_val;
75 uint64_t sword_bits= *(uint32_t *) sword_ptr;
81 float wfloat_val = fp_val;
82 void *wfloat_ptr = &wfloat_val;
83 uint64_t wfloat_bits = *(uint32_t *) wfloat_ptr;
89 double wdouble_val = fp_val;
90 void *wdouble_ptr = &wdouble_val;
91 uint64_t wdp_bits = *(uint64_t *) wdouble_ptr;
96 panic(
"Invalid Floating Point Conversion Type (%d). See \"types.hh\" for List of Conversions\n",cvt_type);
104 double digit_offset = pow(10.0,digits);
105 val = val * digit_offset;
108 val = val / digit_offset;
115 int trunc_val = (int) val;
116 return (
double) trunc_val;
122 int shift = (cc_idx == 0) ? 23 : cc_idx + 24;
123 bool cc_val = (fcsr >>
shift) & 0x00000001;
130 int cc_idx = (cc_num == 0) ? 23 : cc_num + 24;
132 fcsr =
bits(fcsr, 31, cc_idx + 1) << (cc_idx + 1) |
134 bits(fcsr, cc_idx - 1, 0);
144 fcsr_bits = fcsr_bits | (1 << invalid_offset);
148 fcsr_bits = fcsr_bits | (1 << cause_offset);
160 uint32_t val_bits = *(uint32_t *) val_ptr;
161 return (
bits(val_bits, 30, 23) == 0xFF);
166 uint64_t val_bits = *(uint64_t *) val_ptr;
167 return (
bits(val_bits, 62, 52) == 0x7FF);
171 panic(
"Type unsupported. Size mismatch\n");
183 uint32_t val_bits = *(uint32_t *) val_ptr;
184 return (
bits(val_bits, 30, 22) == 0x1FE);
189 uint64_t val_bits = *(uint64_t *) val_ptr;
190 return (
bits(val_bits, 62, 51) == 0xFFE);
194 panic(
"Type unsupported. Size mismatch\n");
205 uint32_t val_bits = *(uint32_t *) val_ptr;
206 return (
bits(val_bits, 30, 22) == 0x1FF);
211 uint64_t val_bits = *(uint64_t *) val_ptr;
212 return (
bits(val_bits, 62, 51) == 0xFFF);
216 panic(
"Type unsupported. Size mismatch\n");
227 cpu->thread->setIntReg(
ZeroReg, 0);
228 cpu->thread->setFloatReg(
ZeroReg, 0.0);
266 panic(
"Copy Misc. Regs Not Implemented Yet\n");
bool isQnan(void *val_ptr, int size)
bool isSnan(void *val_ptr, int size)
virtual void setFloatRegFlat(int idx, FloatReg val)=0
void skipFunction(ThreadContext *tc)
uint32_t genInvalidVector(uint32_t fcsr_bits)
void startupCPU(ThreadContext *tc, int cpuId)
virtual uint64_t readIntRegFlat(int idx)=0
Flat register interfaces.
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
double roundFP(double val, int digits)
virtual void setIntRegFlat(int idx, uint64_t val)=0
uint32_t genCCVector(uint32_t fcsr, int cc_num, uint32_t cc_val)
double truncFP(double val)
virtual TheISA::PCState pcState()=0
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual uint64_t readIntReg(int reg_idx)=0
void initCPU(ThreadContext *tc, int cpuId)
uint64_t fpConvert(ConvertType cvt_type, double fp_val)
bool isNan(void *val_ptr, int size)
virtual void activate()=0
Set the status to Active.
bool getCondCode(uint32_t fcsr, int cc_idx)
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
virtual FloatReg readFloatRegFlat(int idx)=0
const int ReturnAddressReg
void copyMiscRegs(ThreadContext *src, ThreadContext *dest)
GenericISA::SimplePCState< MachInst > PCState
TranslatingPortProxy Object Declaration for FS.
void zeroRegisters(CPU *cpu)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val)=0
void copyRegs(ThreadContext *src, ThreadContext *dest)