summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-12-19 23:38:49 +0000
committerJim Grosbach <grosbach@apple.com>2012-12-19 23:38:49 +0000
commit01ab714758d939acb1c6a12a679a1e5866fdb214 (patch)
treef96faae2a5e6cbd6449977134ffb497b1cabc6d1
parent74c6944a3154ad4d12aa37d5ff4af2f0113ca1cb (diff)
downloadbcm5719-llvm-01ab714758d939acb1c6a12a679a1e5866fdb214.tar.gz
bcm5719-llvm-01ab714758d939acb1c6a12a679a1e5866fdb214.zip
Add isSubRegisterEq() and isSuperRegisterEq().
isSub and isSuper return false if RegA == RegB. Add variants which also include the identity function. llvm-svn: 170609
-rw-r--r--llvm/include/llvm/MC/MCRegisterInfo.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h
index 9310b466f41..c793533fab6 100644
--- a/llvm/include/llvm/MC/MCRegisterInfo.h
+++ b/llvm/include/llvm/MC/MCRegisterInfo.h
@@ -386,14 +386,24 @@ public:
return RegEncodingTable[RegNo];
}
- /// Returns true if regB is a sub-register of regA.
- bool isSubRegister(unsigned regA, unsigned regB) const {
- return isSuperRegister(regB, regA);
+ /// Returns true if RegB is a sub-register of RegA.
+ bool isSubRegister(unsigned RegA, unsigned RegB) const {
+ return isSuperRegister(RegB, RegA);
}
- /// Returns true if regB is a super-register of regA.
+ /// Returns true if RegB is a super-register of RegA.
bool isSuperRegister(unsigned RegA, unsigned RegB) const;
+ /// Returns true if RegB is a sub-register of RegA or if RegB == RegA.
+ bool isSubRegisterEq(unsigned RegA, unsigned RegB) const {
+ return isSuperRegisterEq(RegB, RegA);
+ }
+
+ /// Returns true if RegB is a super-register of RegA or if RegB == RegA.
+ bool isSuperRegisterEq(unsigned RegA, unsigned RegB) const {
+ return RegA == RegB || isSuperRegister(RegA, RegB);
+ }
+
};
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud