2006-02-05 05:50:24 +00:00
|
|
|
//===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2006-02-05 05:50:24 +00:00
|
|
|
// This file contains the Sparc implementation of the MRegisterInfo class.
|
2004-02-25 19:28:19 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
#ifndef SPARCREGISTERINFO_H
|
|
|
|
#define SPARCREGISTERINFO_H
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
#include "llvm/Target/MRegisterInfo.h"
|
2006-02-05 05:50:24 +00:00
|
|
|
#include "SparcGenRegisterInfo.h.inc"
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
class SparcSubtarget;
|
2006-11-27 23:37:22 +00:00
|
|
|
class TargetInstrInfo;
|
2004-02-25 19:28:19 +00:00
|
|
|
class Type;
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
struct SparcRegisterInfo : public SparcGenRegisterInfo {
|
|
|
|
SparcSubtarget &Subtarget;
|
2006-11-13 23:36:35 +00:00
|
|
|
const TargetInstrInfo &TII;
|
2006-02-04 06:58:46 +00:00
|
|
|
|
2006-11-13 23:36:35 +00:00
|
|
|
SparcRegisterInfo(SparcSubtarget &st, const TargetInstrInfo &tii);
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
/// Code Generation virtual methods...
|
2004-08-15 22:15:11 +00:00
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
2004-02-25 19:28:19 +00:00
|
|
|
MachineBasicBlock::iterator MBBI,
|
2005-09-30 01:29:42 +00:00
|
|
|
unsigned SrcReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2004-08-15 22:15:11 +00:00
|
|
|
|
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
2005-09-30 01:29:42 +00:00
|
|
|
unsigned DestReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2004-08-15 22:15:11 +00:00
|
|
|
void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2006-02-03 07:06:25 +00:00
|
|
|
|
|
|
|
virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
|
|
|
|
unsigned OpNum,
|
|
|
|
int FrameIndex) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
|
2007-01-02 21:33:40 +00:00
|
|
|
const unsigned *getCalleeSavedRegs() const;
|
2006-05-18 00:12:58 +00:00
|
|
|
|
2007-01-02 21:33:40 +00:00
|
|
|
const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
|
2006-05-18 00:12:58 +00:00
|
|
|
|
2007-02-19 21:49:54 +00:00
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
|
|
|
|
2007-01-23 00:57:47 +00:00
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
|
|
|
|
2004-02-25 19:28:19 +00:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2004-08-14 22:57:22 +00:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
|
|
|
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2006-03-23 18:12:57 +00:00
|
|
|
|
2006-03-28 13:48:33 +00:00
|
|
|
// Debug information queries.
|
2006-04-07 16:34:46 +00:00
|
|
|
unsigned getRARegister() const;
|
2006-03-28 13:48:33 +00:00
|
|
|
unsigned getFrameRegister(MachineFunction &MF) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|