mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-12 07:21:56 +00:00
R600/SI: Add new helper isSGPRClassID
Move these into header since they are trivial git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e67962e9b
commit
59da3f04ca
@ -288,13 +288,6 @@ const TargetRegisterClass *SIRegisterInfo::getPhysRegClass(unsigned Reg) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SIRegisterInfo::isSGPRClass(const TargetRegisterClass *RC) const {
|
||||
if (!RC) {
|
||||
return false;
|
||||
}
|
||||
return !hasVGPRs(RC);
|
||||
}
|
||||
|
||||
bool SIRegisterInfo::hasVGPRs(const TargetRegisterClass *RC) const {
|
||||
return getCommonSubClass(&AMDGPU::VReg_32RegClass, RC) ||
|
||||
getCommonSubClass(&AMDGPU::VReg_64RegClass, RC) ||
|
||||
|
@ -46,7 +46,20 @@ struct SIRegisterInfo : public AMDGPURegisterInfo {
|
||||
const TargetRegisterClass *getPhysRegClass(unsigned Reg) const;
|
||||
|
||||
/// \returns true if this class contains only SGPR registers
|
||||
bool isSGPRClass(const TargetRegisterClass *RC) const;
|
||||
bool isSGPRClass(const TargetRegisterClass *RC) const {
|
||||
if (!RC)
|
||||
return false;
|
||||
|
||||
return !hasVGPRs(RC);
|
||||
}
|
||||
|
||||
/// \returns true if this class ID contains only SGPR registers
|
||||
bool isSGPRClassID(unsigned RCID) const {
|
||||
if (static_cast<int>(RCID) == -1)
|
||||
return false;
|
||||
|
||||
return isSGPRClass(getRegClass(RCID));
|
||||
}
|
||||
|
||||
/// \returns true if this class contains VGPR registers.
|
||||
bool hasVGPRs(const TargetRegisterClass *RC) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user