Moved the RegIdx arrays to the base dyninst.
--HG-- extra : convert_revision : d705cde25c2cf1add20669e99d086add49141518
This commit is contained in:
parent
6826ee53db
commit
ef942ceecb
2 changed files with 12 additions and 70 deletions
|
@ -134,22 +134,6 @@ class AlphaDynInst : public BaseDynInst<Impl>
|
|||
void syscall(int64_t callnum);
|
||||
#endif
|
||||
|
||||
private:
|
||||
/** Physical register index of the destination registers of this
|
||||
* instruction.
|
||||
*/
|
||||
PhysRegIndex _destRegIdx[MaxInstDestRegs];
|
||||
|
||||
/** Physical register index of the source registers of this
|
||||
* instruction.
|
||||
*/
|
||||
PhysRegIndex _srcRegIdx[MaxInstSrcRegs];
|
||||
|
||||
/** Physical register index of the previous producers of the
|
||||
* architected destinations.
|
||||
*/
|
||||
PhysRegIndex _prevDestRegIdx[MaxInstDestRegs];
|
||||
|
||||
public:
|
||||
|
||||
// The register accessor methods provide the index of the
|
||||
|
@ -165,27 +149,27 @@ class AlphaDynInst : public BaseDynInst<Impl>
|
|||
|
||||
uint64_t readIntReg(const StaticInst *si, int idx)
|
||||
{
|
||||
return this->cpu->readIntReg(_srcRegIdx[idx]);
|
||||
return this->cpu->readIntReg(this->_srcRegIdx[idx]);
|
||||
}
|
||||
|
||||
FloatReg readFloatReg(const StaticInst *si, int idx, int width)
|
||||
{
|
||||
return this->cpu->readFloatReg(_srcRegIdx[idx], width);
|
||||
return this->cpu->readFloatReg(this->_srcRegIdx[idx], width);
|
||||
}
|
||||
|
||||
FloatReg readFloatReg(const StaticInst *si, int idx)
|
||||
{
|
||||
return this->cpu->readFloatReg(_srcRegIdx[idx]);
|
||||
return this->cpu->readFloatReg(this->_srcRegIdx[idx]);
|
||||
}
|
||||
|
||||
FloatRegBits readFloatRegBits(const StaticInst *si, int idx, int width)
|
||||
{
|
||||
return this->cpu->readFloatRegBits(_srcRegIdx[idx], width);
|
||||
return this->cpu->readFloatRegBits(this->_srcRegIdx[idx], width);
|
||||
}
|
||||
|
||||
FloatRegBits readFloatRegBits(const StaticInst *si, int idx)
|
||||
{
|
||||
return this->cpu->readFloatRegBits(_srcRegIdx[idx]);
|
||||
return this->cpu->readFloatRegBits(this->_srcRegIdx[idx]);
|
||||
}
|
||||
|
||||
/** @todo: Make results into arrays so they can handle multiple dest
|
||||
|
@ -193,77 +177,35 @@ class AlphaDynInst : public BaseDynInst<Impl>
|
|||
*/
|
||||
void setIntReg(const StaticInst *si, int idx, uint64_t val)
|
||||
{
|
||||
this->cpu->setIntReg(_destRegIdx[idx], val);
|
||||
this->cpu->setIntReg(this->_destRegIdx[idx], val);
|
||||
BaseDynInst<Impl>::setIntReg(si, idx, val);
|
||||
}
|
||||
|
||||
void setFloatReg(const StaticInst *si, int idx, FloatReg val, int width)
|
||||
{
|
||||
this->cpu->setFloatReg(_destRegIdx[idx], val, width);
|
||||
this->cpu->setFloatReg(this->_destRegIdx[idx], val, width);
|
||||
BaseDynInst<Impl>::setFloatReg(si, idx, val, width);
|
||||
}
|
||||
|
||||
void setFloatReg(const StaticInst *si, int idx, FloatReg val)
|
||||
{
|
||||
this->cpu->setFloatReg(_destRegIdx[idx], val);
|
||||
this->cpu->setFloatReg(this->_destRegIdx[idx], val);
|
||||
BaseDynInst<Impl>::setFloatReg(si, idx, val);
|
||||
}
|
||||
|
||||
void setFloatRegBits(const StaticInst *si, int idx,
|
||||
FloatRegBits val, int width)
|
||||
{
|
||||
this->cpu->setFloatRegBits(_destRegIdx[idx], val, width);
|
||||
this->cpu->setFloatRegBits(this->_destRegIdx[idx], val, width);
|
||||
BaseDynInst<Impl>::setFloatRegBits(si, idx, val);
|
||||
}
|
||||
|
||||
void setFloatRegBits(const StaticInst *si, int idx, FloatRegBits val)
|
||||
{
|
||||
this->cpu->setFloatRegBits(_destRegIdx[idx], val);
|
||||
this->cpu->setFloatRegBits(this->_destRegIdx[idx], val);
|
||||
BaseDynInst<Impl>::setFloatRegBits(si, idx, val);
|
||||
}
|
||||
|
||||
/** Returns the physical register index of the i'th destination
|
||||
* register.
|
||||
*/
|
||||
PhysRegIndex renamedDestRegIdx(int idx) const
|
||||
{
|
||||
return _destRegIdx[idx];
|
||||
}
|
||||
|
||||
/** Returns the physical register index of the i'th source register. */
|
||||
PhysRegIndex renamedSrcRegIdx(int idx) const
|
||||
{
|
||||
return _srcRegIdx[idx];
|
||||
}
|
||||
|
||||
/** Returns the physical register index of the previous physical register
|
||||
* that remapped to the same logical register index.
|
||||
*/
|
||||
PhysRegIndex prevDestRegIdx(int idx) const
|
||||
{
|
||||
return _prevDestRegIdx[idx];
|
||||
}
|
||||
|
||||
/** Renames a destination register to a physical register. Also records
|
||||
* the previous physical register that the logical register mapped to.
|
||||
*/
|
||||
void renameDestReg(int idx,
|
||||
PhysRegIndex renamed_dest,
|
||||
PhysRegIndex previous_rename)
|
||||
{
|
||||
_destRegIdx[idx] = renamed_dest;
|
||||
_prevDestRegIdx[idx] = previous_rename;
|
||||
}
|
||||
|
||||
/** Renames a source logical register to the physical register which
|
||||
* has/will produce that logical register's result.
|
||||
* @todo: add in whether or not the source register is ready.
|
||||
*/
|
||||
void renameSrcReg(int idx, PhysRegIndex renamed_src)
|
||||
{
|
||||
_srcRegIdx[idx] = renamed_src;
|
||||
}
|
||||
|
||||
public:
|
||||
/** Calculates EA part of a memory instruction. Currently unused,
|
||||
* though it may be useful in the future if we want to split
|
||||
|
|
|
@ -53,11 +53,11 @@ AlphaDynInst<Impl>::initVars()
|
|||
// as the normal register entries. It will allow the IQ to work
|
||||
// without any modifications.
|
||||
for (int i = 0; i < this->staticInst->numDestRegs(); i++) {
|
||||
_destRegIdx[i] = this->staticInst->destRegIdx(i);
|
||||
this->_destRegIdx[i] = this->staticInst->destRegIdx(i);
|
||||
}
|
||||
|
||||
for (int i = 0; i < this->staticInst->numSrcRegs(); i++) {
|
||||
_srcRegIdx[i] = this->staticInst->srcRegIdx(i);
|
||||
this->_srcRegIdx[i] = this->staticInst->srcRegIdx(i);
|
||||
this->_readySrcRegIdx[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue