1 //===-- SIInstrInfo.h - SI Instruction Info Interface ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Interface definition for SIInstrInfo.
13 //===----------------------------------------------------------------------===//
19 #include "AMDGPUInstrInfo.h"
20 #include "SIRegisterInfo.h"
24 class SIInstrInfo : public AMDGPUInstrInfo {
26 const SIRegisterInfo RI;
29 explicit SIInstrInfo(AMDGPUTargetMachine &tm);
31 const SIRegisterInfo &getRegisterInfo() const;
33 virtual void copyPhysReg(MachineBasicBlock &MBB,
34 MachineBasicBlock::iterator MI, DebugLoc DL,
35 unsigned DestReg, unsigned SrcReg,
38 virtual MachineInstr *commuteInstruction(MachineInstr *MI,
39 bool NewMI=false) const;
41 virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg,
44 virtual unsigned getIEQOpcode() const { assert(!"Implement"); return 0;}
45 virtual bool isMov(unsigned Opcode) const;
47 virtual bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const;
49 virtual int getIndirectIndexBegin(const MachineFunction &MF) const;
51 virtual int getIndirectIndexEnd(const MachineFunction &MF) const;
53 virtual unsigned calculateIndirectAddress(unsigned RegIndex,
54 unsigned Channel) const;
56 virtual const TargetRegisterClass *getIndirectAddrStoreRegClass(
57 unsigned SourceReg) const;
59 virtual const TargetRegisterClass *getIndirectAddrLoadRegClass() const;
61 virtual MachineInstrBuilder buildIndirectWrite(MachineBasicBlock *MBB,
62 MachineBasicBlock::iterator I,
65 unsigned OffsetReg) const;
67 virtual MachineInstrBuilder buildIndirectRead(MachineBasicBlock *MBB,
68 MachineBasicBlock::iterator I,
71 unsigned OffsetReg) const;
73 virtual const TargetRegisterClass *getSuperIndirectRegClass() const;
76 } // End namespace llvm
78 namespace SIInstrFlags {
80 // First 4 bits are the instruction encoding
87 #endif //SIINSTRINFO_H