Tom Stellard | f98f2ce | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===-- SIInstrInfo.h - SI Instruction Info Interface ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file |
| 11 | /// \brief Interface definition for SIInstrInfo. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | |
| 16 | #ifndef SIINSTRINFO_H |
| 17 | #define SIINSTRINFO_H |
| 18 | |
| 19 | #include "AMDGPUInstrInfo.h" |
| 20 | #include "SIRegisterInfo.h" |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class SIInstrInfo : public AMDGPUInstrInfo { |
| 25 | private: |
| 26 | const SIRegisterInfo RI; |
| 27 | |
| 28 | public: |
| 29 | explicit SIInstrInfo(AMDGPUTargetMachine &tm); |
| 30 | |
| 31 | const SIRegisterInfo &getRegisterInfo() const; |
| 32 | |
| 33 | virtual void copyPhysReg(MachineBasicBlock &MBB, |
| 34 | MachineBasicBlock::iterator MI, DebugLoc DL, |
| 35 | unsigned DestReg, unsigned SrcReg, |
| 36 | bool KillSrc) const; |
| 37 | |
Tom Stellard | f98f2ce | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 38 | virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg, |
| 39 | int64_t Imm) const; |
| 40 | |
| 41 | virtual unsigned getIEQOpcode() const { assert(!"Implement"); return 0;} |
| 42 | virtual bool isMov(unsigned Opcode) const; |
| 43 | |
| 44 | virtual bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const; |
Tom Stellard | c0b0c67 | 2013-02-06 17:32:29 +0000 | [diff] [blame] | 45 | |
| 46 | virtual int getIndirectIndexBegin(const MachineFunction &MF) const; |
| 47 | |
| 48 | virtual int getIndirectIndexEnd(const MachineFunction &MF) const; |
| 49 | |
| 50 | virtual unsigned calculateIndirectAddress(unsigned RegIndex, |
| 51 | unsigned Channel) const; |
| 52 | |
| 53 | virtual const TargetRegisterClass *getIndirectAddrStoreRegClass( |
| 54 | unsigned SourceReg) const; |
| 55 | |
| 56 | virtual const TargetRegisterClass *getIndirectAddrLoadRegClass() const; |
| 57 | |
| 58 | virtual MachineInstrBuilder buildIndirectWrite(MachineBasicBlock *MBB, |
| 59 | MachineBasicBlock::iterator I, |
| 60 | unsigned ValueReg, |
| 61 | unsigned Address, |
| 62 | unsigned OffsetReg) const; |
| 63 | |
| 64 | virtual MachineInstrBuilder buildIndirectRead(MachineBasicBlock *MBB, |
| 65 | MachineBasicBlock::iterator I, |
| 66 | unsigned ValueReg, |
| 67 | unsigned Address, |
| 68 | unsigned OffsetReg) const; |
| 69 | |
| 70 | virtual const TargetRegisterClass *getSuperIndirectRegClass() const; |
Tom Stellard | f98f2ce | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | } // End namespace llvm |
| 74 | |
| 75 | namespace SIInstrFlags { |
| 76 | enum Flags { |
| 77 | // First 4 bits are the instruction encoding |
Tom Stellard | 184f5c1 | 2013-02-07 19:39:45 +0000 | [diff] [blame] | 78 | VM_CNT = 1 << 0, |
| 79 | EXP_CNT = 1 << 1, |
| 80 | LGKM_CNT = 1 << 2 |
Tom Stellard | f98f2ce | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 81 | }; |
| 82 | } |
| 83 | |
| 84 | #endif //SIINSTRINFO_H |