private:
static constexpr auto NumVecElemPerVecReg = TheISA::NumVecElemPerVecReg;
- typedef union {
- FloatReg d;
- FloatRegBits q;
- } PhysFloatReg;
-
/** Integer register file. */
std::vector<IntReg> intRegFile;
std::vector<PhysRegId> intRegIds;
/** Floating point register file. */
- std::vector<PhysFloatReg> floatRegFile;
+ std::vector<FloatRegBits> floatRegFile;
std::vector<PhysRegId> floatRegIds;
/** Vector register file. */
{
assert(phys_reg->isFloatPhysReg());
- FloatRegBits floatRegBits = floatRegFile[phys_reg->index()].q;
+ FloatRegBits floatRegBits = floatRegFile[phys_reg->index()];
DPRINTF(IEW, "RegFile: Access to float register %i as int, "
"has data %#x\n", phys_reg->index(),
phys_reg->index(), (uint64_t)val);
if (!phys_reg->isZeroReg())
- floatRegFile[phys_reg->index()].q = val;
+ floatRegFile[phys_reg->index()] = val;
}
/** Sets a vector register to the given value. */
typedef ThreadContext::Status Status;
protected:
- union {
- FloatReg f[TheISA::NumFloatRegs];
- FloatRegBits i[TheISA::NumFloatRegs];
- } floatRegs;
+ FloatRegBits floatRegs[TheISA::NumFloatRegs];
TheISA::IntReg intRegs[TheISA::NumIntRegs];
VecRegContainer vecRegs[TheISA::NumVecRegs];
#ifdef ISA_HAS_CC_REGS
{
_pcState = 0;
memset(intRegs, 0, sizeof(intRegs));
- memset(floatRegs.i, 0, sizeof(floatRegs.i));
+ memset(floatRegs, 0, sizeof(floatRegs));
for (int i = 0; i < TheISA::NumVecRegs; i++) {
vecRegs[i].zero();
}
int flatIndex = isa->flattenFloatIndex(reg_idx);
assert(flatIndex < TheISA::NumFloatRegs);
FloatRegBits regVal(readFloatRegBitsFlat(flatIndex));
- DPRINTF(FloatRegs, "Reading float reg %d (%d) bits as %#x, %f.\n",
- reg_idx, flatIndex, regVal, floatRegs.f[flatIndex]);
+ DPRINTF(FloatRegs, "Reading float reg %d (%d) bits as %#x.\n",
+ reg_idx, flatIndex, regVal);
return regVal;
}
// when checkercpu enabled
if (flatIndex < TheISA::NumFloatRegs)
setFloatRegBitsFlat(flatIndex, val);
- DPRINTF(FloatRegs, "Setting float reg %d (%d) bits to %#x, %#f.\n",
- reg_idx, flatIndex, val, floatRegs.f[flatIndex]);
+ DPRINTF(FloatRegs, "Setting float reg %d (%d) bits to %#x.\n",
+ reg_idx, flatIndex, val);
}
void setVecReg(const RegId& reg, const VecRegContainer& val)
uint64_t readIntRegFlat(int idx) { return intRegs[idx]; }
void setIntRegFlat(int idx, uint64_t val) { intRegs[idx] = val; }
- FloatRegBits readFloatRegBitsFlat(int idx) { return floatRegs.i[idx]; }
+ FloatRegBits readFloatRegBitsFlat(int idx) { return floatRegs[idx]; }
void setFloatRegBitsFlat(int idx, FloatRegBits val) {
- floatRegs.i[idx] = val;
+ floatRegs[idx] = val;
}
const VecRegContainer& readVecRegFlat(const RegIndex& reg) const