diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-11-03 19:59:59 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-11-03 19:59:59 +0000 |
commit | 9d8950d2403b88352dda4008555ab275a3b1ddf4 (patch) | |
tree | 3dc9ae79381a84748f125c6b3089d412d768c313 /llvm/lib/Target/Sparc/SparcRegClassInfo.h | |
parent | 784c623efb9cf50f03e7adaeaad5602b56749417 (diff) | |
download | bcm5719-llvm-9d8950d2403b88352dda4008555ab275a3b1ddf4.tar.gz bcm5719-llvm-9d8950d2403b88352dda4008555ab275a3b1ddf4.zip |
Added code to support correct saving of %ccr across calls
llvm-svn: 1111
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcRegClassInfo.h')
-rw-r--r-- | llvm/lib/Target/Sparc/SparcRegClassInfo.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegClassInfo.h b/llvm/lib/Target/Sparc/SparcRegClassInfo.h index 4f91268c374..fd768157500 100644 --- a/llvm/lib/Target/Sparc/SparcRegClassInfo.h +++ b/llvm/lib/Target/Sparc/SparcRegClassInfo.h @@ -191,22 +191,54 @@ class SparcFloatRegClass : public MachineRegClassInfo //----------------------------------------------------------------------------- // Int CC Register Class -// Only one integer cc register is available +// Only one integer cc register is available. However, this register is +// referred to as %xcc when instructions like subcc are executed but +// referred to as %ccr (i.e., %xcc + %icc") when this register is moved +// into an integer register using RD or WR instrcutions. So, two ids are +// allocated for two names. //----------------------------------------------------------------------------- +static string const IntCCRegNames[] = + { + "xcc", "ccr" + }; + + +class SparcIntCCRegOrder{ + + public: + + enum RegsInPrefOrder { + + xcc, ccr // only one is available - see the note above + }; + + static const string getRegName(const unsigned reg) { + assert( reg < 2 ); + return IntCCRegNames[reg]; + } + + // according to Sparc 64 ABI, %ccr is volatile + inline bool isRegVolatile(const int Reg) const { return true; } + + +}; + + + class SparcIntCCRegClass : public MachineRegClassInfo { public: SparcIntCCRegClass(unsigned ID) - : MachineRegClassInfo(ID,1, 1) { } + : MachineRegClassInfo(ID, 1, 2) { } inline void colorIGNode(IGNode * Node, bool IsColorUsedArr[] ) const { Node->setColor(0); // only one int cc reg is available } - // *** TODO: Check this + inline bool isRegVolatile(const int Reg) const { return true; } }; |