-inline
-unsigned MCRegisterInfo::getMatchingSuperReg(unsigned Reg, unsigned SubIdx,
- const MCRegisterClass *RC) const {
- for (MCSuperRegIterator Supers(Reg, this); Supers.isValid(); ++Supers)
- if (RC->contains(*Supers) && Reg == getSubReg(*Supers, SubIdx))
- return *Supers;
- return 0;
-}
-
-inline
-unsigned MCRegisterInfo::getSubReg(unsigned Reg, unsigned Idx) const {
- // Get a pointer to the corresponding SubRegIndices list. This list has the
- // name of each sub-register in the same order as MCSubRegIterator.
- const uint16_t *SRI = SubRegIndices + get(Reg).SubRegIndices;
- for (MCSubRegIterator Subs(Reg, this); Subs.isValid(); ++Subs, ++SRI)
- if (*SRI == Idx)
- return *Subs;
- return 0;
-}
-
-inline
-unsigned MCRegisterInfo::getSubRegIndex(unsigned Reg, unsigned SubReg) const {
- // Get a pointer to the corresponding SubRegIndices list. This list has the
- // name of each sub-register in the same order as MCSubRegIterator.
- const uint16_t *SRI = SubRegIndices + get(Reg).SubRegIndices;
- for (MCSubRegIterator Subs(Reg, this); Subs.isValid(); ++Subs, ++SRI)
- if (*Subs == SubReg)
- return *SRI;
- return 0;
-}
-