mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
MCRegisterInfo-ize getMatchingSuperReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152044 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6449b636f
commit
33ca87affb
@ -248,6 +248,16 @@ public:
|
||||
return *(SubRegIndices + (Reg - 1) * NumSubRegIndices + Idx - 1);
|
||||
}
|
||||
|
||||
/// getMatchingSuperReg - Return a super-register of the specified register
|
||||
/// Reg so its sub-register of index SubIdx is Reg.
|
||||
unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx,
|
||||
const MCRegisterClass *RC) const {
|
||||
for (const unsigned *SRs = getSuperRegisters(Reg); unsigned SR = *SRs;++SRs)
|
||||
if (Reg == getSubReg(SR, SubIdx) && RC->contains(SR))
|
||||
return SR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// getSubRegIndex - For a given register pair, return the sub-register index
|
||||
/// if the second register is a sub-register of the first. Return zero
|
||||
/// otherwise.
|
||||
|
@ -387,10 +387,7 @@ public:
|
||||
/// Reg so its sub-register of index SubIdx is Reg.
|
||||
unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
for (const uint16_t *SRs = getSuperRegisters(Reg); unsigned SR = *SRs;++SRs)
|
||||
if (Reg == getSubReg(SR, SubIdx) && RC->contains(SR))
|
||||
return SR;
|
||||
return 0;
|
||||
return MCRegisterInfo::getMatchingSuperReg(Reg, SubIdx, RC->MC);
|
||||
}
|
||||
|
||||
/// canCombineSubRegIndices - Given a register class and a list of
|
||||
|
Loading…
x
Reference in New Issue
Block a user