mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-09 22:13:07 +00:00
Added support for callee- and caller-save registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
44662a783b
commit
03c6fafd05
@ -56,3 +56,28 @@ unsigned X86RegisterInfo::getFramePointer() const {
|
||||
unsigned X86RegisterInfo::getStackPointer() const {
|
||||
return X86::ESP;
|
||||
}
|
||||
|
||||
const unsigned* X86RegisterInfo::getCalleeSaveRegs() const {
|
||||
static const unsigned CalleeSaveRegs[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP,
|
||||
MRegisterInfo::NoRegister };
|
||||
return CalleeSaveRegs;
|
||||
}
|
||||
|
||||
|
||||
const unsigned* X86RegisterInfo::getCallerSaveRegs() const {
|
||||
static const unsigned CallerSaveRegs[] = { X86::EAX, X86::ECX, X86::EDX,
|
||||
MRegisterInfo::NoRegister };
|
||||
return CallerSaveRegs;
|
||||
}
|
||||
|
||||
void
|
||||
X86RegisterInfo::buildReg2RegClassMap
|
||||
(std::map<unsigned,
|
||||
const TargetRegisterClass*>& Reg2RegClassMap) const
|
||||
{
|
||||
for (MRegisterInfo::const_iterator I = const_regclass_begin(),
|
||||
E = const_regclass_end(); I != E; ++I)
|
||||
{
|
||||
I->buildReg2RegClassMap(Reg2RegClassMap);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ struct X86RegisterInfo : public MRegisterInfo {
|
||||
unsigned getFramePointer() const;
|
||||
unsigned getStackPointer() const;
|
||||
|
||||
const unsigned* getCalleeSaveRegs() const;
|
||||
const unsigned* getCallerSaveRegs() const;
|
||||
|
||||
/// Returns register class appropriate for input SSA register
|
||||
///
|
||||
const TargetRegisterClass *getClassForReg(unsigned Reg) const;
|
||||
@ -40,6 +43,8 @@ struct X86RegisterInfo : public MRegisterInfo {
|
||||
|
||||
unsigned getNumRegClasses() const;
|
||||
|
||||
void buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
|
||||
Reg2RegClassMap) const;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user