2005-10-16 05:39:50 +00:00
|
|
|
//===- PPCRegisterInfo.h - PowerPC Register Information Impl -----*- C++ -*-==//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-17 04:55:41 +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-08-17 04:55:41 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the PowerPC implementation of the MRegisterInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef POWERPC32_REGISTERINFO_H
|
|
|
|
#define POWERPC32_REGISTERINFO_H
|
|
|
|
|
2005-10-14 23:51:18 +00:00
|
|
|
#include "PPC.h"
|
2005-10-14 23:37:35 +00:00
|
|
|
#include "PPCGenRegisterInfo.h.inc"
|
2004-08-17 04:55:41 +00:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Type;
|
|
|
|
|
2005-10-16 05:39:50 +00:00
|
|
|
class PPCRegisterInfo : public PPCGenRegisterInfo {
|
2004-08-17 04:55:41 +00:00
|
|
|
std::map<unsigned, unsigned> ImmToIdxMap;
|
|
|
|
public:
|
2005-10-16 05:39:50 +00:00
|
|
|
PPCRegisterInfo();
|
2004-08-17 04:55:41 +00:00
|
|
|
|
|
|
|
/// Code Generation virtual methods...
|
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
2005-09-30 01:30:55 +00:00
|
|
|
unsigned SrcReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2004-08-17 04:55:41 +00:00
|
|
|
|
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
2005-09-30 01:30:55 +00:00
|
|
|
unsigned DestReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2004-08-17 04:55:41 +00:00
|
|
|
void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
const TargetRegisterClass *RC) const;
|
|
|
|
|
2005-09-09 21:46:49 +00:00
|
|
|
/// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
|
|
|
|
/// copy instructions, turning them into load/store instructions.
|
|
|
|
virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
|
|
|
|
int FrameIndex) const;
|
|
|
|
|
2004-08-17 04:55:41 +00:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II) 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.
|
|
|
|
unsigned getFrameRegister(MachineFunction &MF) const;
|
2004-08-17 04:55:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|