2007-12-04 22:35:58 +00:00
|
|
|
//===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-12-04 22:35:58 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2007-12-05 01:40:25 +00:00
|
|
|
// This file contains the CellSPU implementation of the TargetInstrInfo class.
|
2007-12-04 22:35:58 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPU_INSTRUCTIONINFO_H
|
|
|
|
#define SPU_INSTRUCTIONINFO_H
|
|
|
|
|
|
|
|
#include "SPU.h"
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "SPURegisterInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
//! Cell SPU instruction information class
|
2008-01-01 01:03:04 +00:00
|
|
|
class SPUInstrInfo : public TargetInstrInfoImpl {
|
2007-12-04 22:35:58 +00:00
|
|
|
SPUTargetMachine &TM;
|
|
|
|
const SPURegisterInfo RI;
|
|
|
|
public:
|
2008-03-25 22:06:05 +00:00
|
|
|
explicit SPUInstrInfo(SPUTargetMachine &tm);
|
2007-12-04 22:35:58 +00:00
|
|
|
|
|
|
|
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
|
|
|
|
/// such, whenever a client has an instance of instruction info, it should
|
|
|
|
/// always be able to get register info as well (through this method).
|
|
|
|
///
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const SPURegisterInfo &getRegisterInfo() const { return RI; }
|
2007-12-04 22:35:58 +00:00
|
|
|
|
2008-11-18 19:49:32 +00:00
|
|
|
unsigned isLoadFromStackSlot(const MachineInstr *MI,
|
|
|
|
int &FrameIndex) const;
|
|
|
|
unsigned isStoreToStackSlot(const MachineInstr *MI,
|
|
|
|
int &FrameIndex) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2010-07-11 07:31:03 +00:00
|
|
|
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I, DebugLoc DL,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
bool KillSrc) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-01-01 21:11:32 +00:00
|
|
|
//! Store a register to a stack slot, based on its register class.
|
|
|
|
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned SrcReg, bool isKill, int FrameIndex,
|
2010-05-06 19:06:44 +00:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2008-01-01 21:11:32 +00:00
|
|
|
|
|
|
|
//! Load a register from a stack slot, based on its register class.
|
|
|
|
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, int FrameIndex,
|
2010-05-06 19:06:44 +00:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2008-01-01 21:11:32 +00:00
|
|
|
|
2009-01-03 00:27:53 +00:00
|
|
|
//! Reverses a branch's condition, returning false on success.
|
|
|
|
virtual
|
|
|
|
bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const;
|
2008-12-10 00:15:19 +00:00
|
|
|
|
|
|
|
virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
|
2009-01-26 03:37:41 +00:00
|
|
|
MachineBasicBlock *&FBB,
|
2009-02-09 07:14:22 +00:00
|
|
|
SmallVectorImpl<MachineOperand> &Cond,
|
|
|
|
bool AllowModify) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-12-10 00:15:19 +00:00
|
|
|
virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-12-10 00:15:19 +00:00
|
|
|
virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
2010-06-17 22:43:56 +00:00
|
|
|
MachineBasicBlock *FBB,
|
|
|
|
const SmallVectorImpl<MachineOperand> &Cond,
|
|
|
|
DebugLoc DL) const;
|
2008-12-10 00:15:19 +00:00
|
|
|
};
|
2007-12-04 22:35:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|