2006-02-05 05:50:24 +00:00
|
|
|
//===- SparcInstrInfo.h - Sparc Instruction Information ---------*- 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 TargetInstrInfo class.
|
2004-02-25 19:28:19 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
#ifndef SPARCINSTRUCTIONINFO_H
|
|
|
|
#define SPARCINSTRUCTIONINFO_H
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
2006-02-05 05:50:24 +00:00
|
|
|
#include "SparcRegisterInfo.h"
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
/// SPII - This namespace holds all of the target specific flags that
|
2004-07-16 10:31:59 +00:00
|
|
|
/// instruction info tracks.
|
|
|
|
///
|
2006-02-05 05:50:24 +00:00
|
|
|
namespace SPII {
|
2004-07-16 10:31:59 +00:00
|
|
|
enum {
|
|
|
|
Pseudo = (1<<0),
|
|
|
|
Load = (1<<1),
|
|
|
|
Store = (1<<2),
|
|
|
|
DelaySlot = (1<<3)
|
|
|
|
};
|
2006-05-24 17:04:05 +00:00
|
|
|
}
|
2004-07-16 10:31:59 +00:00
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
class SparcInstrInfo : public TargetInstrInfo {
|
|
|
|
const SparcRegisterInfo RI;
|
2004-02-25 19:28:19 +00:00
|
|
|
public:
|
2006-02-05 05:50:24 +00:00
|
|
|
SparcInstrInfo(SparcSubtarget &ST);
|
2004-02-25 19:28:19 +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).
|
|
|
|
///
|
|
|
|
virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
|
2004-07-25 06:19:04 +00:00
|
|
|
|
|
|
|
/// Return true if the instruction is a register to register move and
|
|
|
|
/// leave the source and dest operands in the passed parameters.
|
|
|
|
///
|
|
|
|
virtual bool isMoveInstr(const MachineInstr &MI,
|
|
|
|
unsigned &SrcReg, unsigned &DstReg) const;
|
2006-02-03 06:44:54 +00:00
|
|
|
|
|
|
|
/// isLoadFromStackSlot - If the specified machine instruction is a direct
|
|
|
|
/// load from a stack slot, return the virtual or physical register number of
|
|
|
|
/// the destination along with the FrameIndex of the loaded stack slot. If
|
|
|
|
/// not, return 0. This predicate must return 0 if the instruction has
|
|
|
|
/// any side effects other than loading from the stack slot.
|
|
|
|
virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
|
|
|
|
|
|
|
|
/// isStoreToStackSlot - If the specified machine instruction is a direct
|
|
|
|
/// store to a stack slot, return the virtual or physical register number of
|
|
|
|
/// the source reg along with the FrameIndex of the loaded stack slot. If
|
|
|
|
/// not, return 0. This predicate must return 0 if the instruction has
|
|
|
|
/// any side effects other than storing to the stack slot.
|
|
|
|
virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
|
2006-10-24 16:39:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
|
|
|
MachineBasicBlock *FBB,
|
|
|
|
const std::vector<MachineOperand> &Cond) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|