Go to the documentation of this file.
33 #ifndef TCE_TARGET_MACHINE_PLUGIN_HH
34 #define TCE_TARGET_MACHINE_PLUGIN_HH
38 #include "tce_config.h"
40 #define TCELE64DLString \
59 #define TCEBEDLString \
75 #include <llvm/IR/DataLayout.h>
76 #include <llvm/CodeGen/SelectionDAGTargetInfo.h>
94 class TargetInstrInfo;
97 class TargetRegisterInfo;
98 class TargetFrameLowering;
99 class TargetSubtargetInfo;
100 class TargetTransformInfo;
103 class TCETargetMachine;
104 class TargetRegisterClass;
118 virtual const TargetInstrInfo*
getInstrInfo()
const = 0;
122 virtual const TargetSubtargetInfo*
getSubtarget()
const = 0;
124 const Function& F)
const = 0;
130 virtual std::string
rfName(
unsigned dwarfRegNum) = 0;
148 const std::string& opName)
const = 0;
159 virtual const std::string*
adfXML() = 0;
177 virtual bool hasUDIV()
const = 0;
178 virtual bool hasSDIV()
const = 0;
179 virtual bool hasUREM()
const = 0;
180 virtual bool hasSREM()
const = 0;
181 virtual bool hasMUL()
const = 0;
182 virtual bool hasROTL()
const = 0;
183 virtual bool hasROTR()
const = 0;
184 virtual bool hasSXHW()
const = 0;
185 virtual bool hasSXQW()
const = 0;
187 virtual bool hasSHR()
const = 0;
188 virtual bool hasSHL()
const = 0;
189 virtual bool hasSHRU()
const = 0;
203 virtual int getLoad(
const TargetRegisterClass *rc)
const = 0;
204 virtual int getStore(
const TargetRegisterClass *rc)
const = 0;
208 virtual int getAddOpcode(
const llvm::EVT& vt)
const = 0;
210 virtual int getShlOpcode(
const llvm::EVT& vt)
const = 0;
212 virtual int getIorOpcode(
const llvm::EVT& vt)
const = 0;
216 const llvm::TargetRegisterClass* current)
const = 0;
218 unsigned nodeId,
const llvm::TargetRegisterClass* current)
const = 0;
221 virtual bool is64bit()
const = 0;
239 llvm::MachineInstr& i,
240 llvm::SmallVectorImpl<llvm::MachineOperand>& cond)
const {
252 int offset)
const = 0;
virtual unsigned registerIndex(unsigned dwarfRegNum)=0
Returns name of the physical register index corresponding to a generated register ID.
virtual int getStore(const TargetRegisterClass *rc) const =0
virtual int getMaxuOpcode(llvm::SDNode *n) const =0
TCESubtarget * subTarget_
virtual unsigned fpDRegNum()=0
Returns ID number of the frame pointer register.
virtual bool hasSXHW() const =0
virtual const llvm::TargetRegisterClass * extrasRegClass(const llvm::TargetRegisterClass *current) const =0
Clustered-TTA-subtemplate related methods.
virtual int getMinuOpcode(llvm::SDNode *n) const =0
virtual bool has8bitLoads() const =0
virtual bool has16bitLoads() const =0
virtual int getLoadOpcode(const llvm::EVT &vt) const =0
virtual bool hasSQRTF() const =0
virtual const TargetFrameLowering * getFrameLowering() const =0
virtual unsigned int extractElementLane(const MachineInstr &mi) const =0
virtual bool analyzeCCBranch(llvm::MachineInstr &i, llvm::SmallVectorImpl< llvm::MachineOperand > &cond) const
virtual bool hasUREM() const =0
virtual bool hasROTR() const =0
virtual int getMinOpcode(llvm::SDNode *n) const =0
virtual bool validStackAccessOperation(const std::string &opName) const =0
Returns true if OSAL operation is valid for stack accesses.
virtual const SelectionDAGTargetInfo * getSelectionDAGInfo() const
virtual int getIorOpcode(const llvm::EVT &vt) const =0
virtual int getMaxOpcode(llvm::SDNode *n) const =0
virtual TargetTransformInfo getTargetTransformInfo(const Function &F) const =0
virtual const llvm::TargetRegisterClass * nodeRegClass(unsigned nodeId, const llvm::TargetRegisterClass *current) const =0
virtual const TargetSubtargetInfo * getSubtarget() const =0
virtual void registerTargetMachine(TCETargetMachine &tm)=0
Plugin needs target machine for TragetLowering generation.
virtual const TargetInstrInfo * getInstrInfo() const =0
virtual bool hasUDIV() const =0
virtual TargetLowering * getTargetLowering() const =0
virtual const std::string * adfXML()=0
Returns pointer to xml string of the target machine .adf.
virtual bool isLittleEndian() const =0
virtual bool hasROTL() const =0
virtual ~TCETargetMachinePlugin()
virtual unsigned spDRegNum()=0
Returns ID number of the stack pointer register.
virtual bool hasSREM() const =0
virtual bool hasSHL() const =0
virtual int getFalsePredicateOpcode(unsigned opc) const =0
virtual unsigned raPortDRegNum()=0
Returns ID number of the return address register.
virtual bool is64bit() const =0
virtual const TCETargetMachine * getCurrentTargetMachine() const
virtual unsigned opcode(TCEString operationName) const =0
Returns the opcode for the given osal operation, undefined if not found.
TargetFrameLowering * frameInfo_
SelectionDAGTargetInfo tsInfo_
virtual std::vector< unsigned > getParamDRegNums() const =0
virtual bool hasSXQW() const =0
virtual bool hasSHRU() const =0
virtual bool hasSDIV() const =0
virtual int getAddOpcode(const llvm::EVT &vt) const =0
virtual int maxVectorSize() const =0
virtual int getLoad(const TargetRegisterClass *rc) const =0
virtual unsigned rvDRegNum()=0
virtual std::string rfName(unsigned dwarfRegNum)=0
Returns name of the physical register file corresponding to a generated register ID.
virtual bool hasOperation(TCEString operationName) const =0
Returns true in case the target supports the given osal operation.
TargetLowering * lowering_
virtual const DataLayout * getDataLayout() const
virtual unsigned rvHighDRegNum()=0
virtual std::tuple< int, int > getPointerAdjustment(int offset) const =0
virtual TCETargetMachine * getCurrentTargetMachine()
virtual MVT::SimpleValueType getDefaultType() const =0
virtual bool canMaterializeConstant(const ConstantInt &ci) const =0
virtual int getShlOpcode(const llvm::EVT &vt) const =0
virtual int getTruePredicateOpcode(unsigned opc) const =0
virtual bool hasMUL() const =0
virtual bool hasSHR() const =0
virtual std::vector< unsigned > getVectorRVDRegNums() const =0
llvm::DataLayout TargetData
virtual std::string operationName(unsigned opc) const =0
Returns operation name corresponding to llvm target opcode.
virtual FunctionPass * createISelPass(TCETargetMachine *tm)=0
virtual std::string dataASName()=0
Returns name of the data address space.
TCEInstrInfo * instrInfo_
Target machine instruction info for the llvm framework.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
virtual DataLayout * getDataLayout()
virtual unsigned llvmRegisterId(const TCEString &ttaRegister)=0