66a67
> std::vector<PhysRegId> intRegIds;
69a71
> std::vector<PhysRegId> floatRegIds;
72a75
> std::vector<PhysRegId> ccRegIds;
73a77,79
> /** Misc Reg Ids */
> std::vector<PhysRegId> miscRegIds;
>
75,86c81
< * The first floating-point physical register index. The physical
< * register file has a single continuous index space, with the
< * initial indices mapping to the integer registers, followed
< * immediately by the floating-point registers. Thus the first
< * floating-point index is equal to the number of integer
< * registers.
< *
< * Note that this internal organizational detail on how physical
< * register file indices are ordered should *NOT* be exposed
< * outside of this class. Other classes can use the is*PhysReg()
< * methods to map from a physical register index to a class
< * without knowing the internal structure of the index map.
---
> * Number of physical general purpose registers
88c83
< unsigned baseFloatRegIndex;
---
> unsigned numPhysicalIntRegs;
91,92c86
< * The first condition-code physical register index. The
< * condition-code registers follow the floating-point registers.
---
> * Number of physical general purpose registers
94c88
< unsigned baseCCRegIndex;
---
> unsigned numPhysicalFloatRegs;
95a90,94
> /**
> * Number of physical general purpose registers
> */
> unsigned numPhysicalCCRegs;
>
117c116
< unsigned numIntPhysRegs() const { return baseFloatRegIndex; }
---
> unsigned numIntPhysRegs() const { return numPhysicalIntRegs; }
120,121c119
< unsigned numFloatPhysRegs() const
< { return baseCCRegIndex - baseFloatRegIndex; }
---
> unsigned numFloatPhysRegs() const { return numPhysicalFloatRegs; }
124,125c122
< unsigned numCCPhysRegs() const
< { return totalNumRegs - baseCCRegIndex; }
---
> unsigned numCCPhysRegs() const { return numPhysicalCCRegs; }
130,136c127,129
< /**
< * @return true if the specified physical register index
< * corresponds to an integer physical register.
< */
< bool isIntPhysReg(PhysRegIndex reg_idx) const
< {
< return 0 <= reg_idx && reg_idx < baseFloatRegIndex;
---
> /** Gets a misc register PhysRegIdPtr. */
> PhysRegIdPtr getMiscRegId(RegIndex reg_idx) {
> return &miscRegIds[reg_idx];
139,156d131
< /**
< * @return true if the specified physical register index
< * corresponds to a floating-point physical register.
< */
< bool isFloatPhysReg(PhysRegIndex reg_idx) const
< {
< return (baseFloatRegIndex <= reg_idx && reg_idx < baseCCRegIndex);
< }
<
< /**
< * Return true if the specified physical register index
< * corresponds to a condition-code physical register.
< */
< bool isCCPhysReg(PhysRegIndex reg_idx)
< {
< return (baseCCRegIndex <= reg_idx && reg_idx < totalNumRegs);
< }
<
158c133
< uint64_t readIntReg(PhysRegIndex reg_idx) const
---
> uint64_t readIntReg(PhysRegIdPtr phys_reg) const
160c135
< assert(isIntPhysReg(reg_idx));
---
> assert(phys_reg->isIntPhysReg());
163,164c138,139
< "%#x\n", int(reg_idx), intRegFile[reg_idx]);
< return intRegFile[reg_idx];
---
> "%#x\n", phys_reg->regIdx, intRegFile[phys_reg->regIdx]);
> return intRegFile[phys_reg->regIdx];
168c143
< FloatReg readFloatReg(PhysRegIndex reg_idx) const
---
> FloatReg readFloatReg(PhysRegIdPtr phys_reg) const
170c145
< assert(isFloatPhysReg(reg_idx));
---
> assert(phys_reg->isFloatPhysReg());
172,174d146
< // Remove the base Float reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseFloatRegIndex;
<
176c148,149
< "data %#x\n", int(reg_idx), floatRegFile[reg_offset].q);
---
> "data %#x\n", phys_reg->regIdx,
> floatRegFile[phys_reg->regIdx].q);
178c151
< return floatRegFile[reg_offset].d;
---
> return floatRegFile[phys_reg->regIdx].d;
181c154
< FloatRegBits readFloatRegBits(PhysRegIndex reg_idx) const
---
> FloatRegBits readFloatRegBits(PhysRegIdPtr phys_reg) const
183c156
< assert(isFloatPhysReg(reg_idx));
---
> assert(phys_reg->isFloatPhysReg());
185,186c158
< // Remove the base Float reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseFloatRegIndex;
---
> FloatRegBits floatRegBits = floatRegFile[phys_reg->regIdx].q;
188,189d159
< FloatRegBits floatRegBits = floatRegFile[reg_offset].q;
<
191c161,162
< "has data %#x\n", int(reg_idx), (uint64_t)floatRegBits);
---
> "has data %#x\n", phys_reg->regIdx,
> (uint64_t)floatRegBits);
197c168
< CCReg readCCReg(PhysRegIndex reg_idx)
---
> CCReg readCCReg(PhysRegIdPtr phys_reg)
199c170
< assert(isCCPhysReg(reg_idx));
---
> assert(phys_reg->isCCPhysReg());
201,203d171
< // Remove the base CC reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseCCRegIndex;
<
205c173,174
< "data %#x\n", int(reg_idx), ccRegFile[reg_offset]);
---
> "data %#x\n", phys_reg->regIdx,
> ccRegFile[phys_reg->regIdx]);
207c176
< return ccRegFile[reg_offset];
---
> return ccRegFile[phys_reg->regIdx];
211c180
< void setIntReg(PhysRegIndex reg_idx, uint64_t val)
---
> void setIntReg(PhysRegIdPtr phys_reg, uint64_t val)
213c182
< assert(isIntPhysReg(reg_idx));
---
> assert(phys_reg->isIntPhysReg());
216c185
< int(reg_idx), val);
---
> phys_reg->regIdx, val);
218,219c187,188
< if (reg_idx != TheISA::ZeroReg)
< intRegFile[reg_idx] = val;
---
> if (!phys_reg->isZeroReg())
> intRegFile[phys_reg->regIdx] = val;
223c192
< void setFloatReg(PhysRegIndex reg_idx, FloatReg val)
---
> void setFloatReg(PhysRegIdPtr phys_reg, FloatReg val)
225c194
< assert(isFloatPhysReg(reg_idx));
---
> assert(phys_reg->isFloatPhysReg());
227,229d195
< // Remove the base Float reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseFloatRegIndex;
<
231c197
< int(reg_idx), (uint64_t)val);
---
> phys_reg->regIdx, (uint64_t)val);
233,236c199,200
< #if THE_ISA == ALPHA_ISA
< if (reg_offset != TheISA::ZeroReg)
< #endif
< floatRegFile[reg_offset].d = val;
---
> if (!phys_reg->isZeroReg())
> floatRegFile[phys_reg->regIdx].d = val;
239c203
< void setFloatRegBits(PhysRegIndex reg_idx, FloatRegBits val)
---
> void setFloatRegBits(PhysRegIdPtr phys_reg, FloatRegBits val)
241c205
< assert(isFloatPhysReg(reg_idx));
---
> assert(phys_reg->isFloatPhysReg());
243,245d206
< // Remove the base Float reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseFloatRegIndex;
<
247c208
< int(reg_idx), (uint64_t)val);
---
> phys_reg->regIdx, (uint64_t)val);
249c210
< floatRegFile[reg_offset].q = val;
---
> floatRegFile[phys_reg->regIdx].q = val;
253c214
< void setCCReg(PhysRegIndex reg_idx, CCReg val)
---
> void setCCReg(PhysRegIdPtr phys_reg, CCReg val)
255c216
< assert(isCCPhysReg(reg_idx));
---
> assert(phys_reg->isCCPhysReg());
257,259d217
< // Remove the base CC reg dependency.
< PhysRegIndex reg_offset = reg_idx - baseCCRegIndex;
<
261c219
< int(reg_idx), (uint64_t)val);
---
> phys_reg->regIdx, (uint64_t)val);
263c221
< ccRegFile[reg_offset] = val;
---
> ccRegFile[phys_reg->regIdx] = val;