55,66c55,66
< // Typedef for physical register index type. Although the Impl would be the
< // most likely location for this, there are a few classes that need this
< // typedef yet are not templated on the Impl. For now it will be defined here.
< typedef short int PhysRegIndex;
< // Physical register ID
< // Associate a physical register index to a register class and
< // so it is easy to track which type of register are used.
< // A flat index is also provided for when it is useful to have a unified
< // indexing (for the dependency graph and the scoreboard for example)
< struct PhysRegId {
< RegClass regClass;
< PhysRegIndex regIdx;
---
> /** Physical register index type.
> * Although the Impl might be a better for this, but there are a few classes
> * that need this typedef yet are not templated on the Impl.
> */
> using PhysRegIndex = short int;
>
> /** Physical register ID.
> * Like a register ID but physical. The inheritance is private because the
> * only relationship between this types is functional, and it is done to
> * prevent code replication. */
> class PhysRegId : private RegId {
> private:
68c68,73
< PhysRegId(RegClass _regClass, PhysRegIndex _regIdx,
---
>
> public:
> explicit PhysRegId() : RegId(IntRegClass, -1), flatIdx(-1) {}
>
> /** Scalar PhysRegId constructor. */
> explicit PhysRegId(RegClass _regClass, PhysRegIndex _regIdx,
70c75
< : regClass(_regClass), regIdx(_regIdx), flatIdx(_flatIdx)
---
> : RegId(_regClass, _regIdx), flatIdx(_flatIdx)
72a78,93
> /** Visible RegId methods */
> /** @{ */
> using RegId::index;
> using RegId::classValue;
> using RegId::isZeroReg;
> using RegId::className;
> /** @} */
> /**
> * Explicit forward methods, to prevent comparisons of PhysRegId with
> * RegIds.
> */
> /** @{ */
> bool operator<(const PhysRegId& that) const {
> return RegId::operator<(that);
> }
>
74c95
< return regClass == that.regClass && regIdx == that.regIdx;
---
> return RegId::operator==(that);
78c99
< return !(*this==that);
---
> return RegId::operator!=(that);
79a101
> /** @} */
81,87d102
< bool isZeroReg() const
< {
< return (regIdx == TheISA::ZeroReg &&
< (regClass == IntRegClass ||
< (THE_ISA == ALPHA_ISA && regClass == FloatRegClass)));
< }
<
89c104
< bool isIntPhysReg() const { return regClass == IntRegClass; }
---
> bool isIntPhysReg() const { return isIntReg(); }
92c107
< bool isFloatPhysReg() const { return regClass == FloatRegClass; }
---
> bool isFloatPhysReg() const { return isFloatReg(); }
95c110
< bool isCCPhysReg() const { return regClass == CCRegClass; }
---
> bool isCCPhysReg() const { return isCCReg(); }
96a112,114
> /** @Return true if it is a condition-code physical register. */
> bool isMiscPhysReg() const { return isMiscReg(); }
>
103c121
< return regClass == MiscRegClass;
---
> return !isRenameable();
104a123,125
>
> /** Flat index accessor */
> const PhysRegIndex& flatIndex() const { return flatIdx; }