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 | |
| 38 | /// \returns the encoding type of this instruction. |
| 39 | unsigned getEncodingType(const MachineInstr &MI) const; |
| 40 | |
| 41 | /// \returns the size of this instructions encoding in number of bytes. |
| 42 | unsigned getEncodingBytes(const MachineInstr &MI) const; |
| 43 | |
| 44 | virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg, |
| 45 | int64_t Imm) const; |
| 46 | |
| 47 | virtual unsigned getIEQOpcode() const { assert(!"Implement"); return 0;} |
| 48 | virtual bool isMov(unsigned Opcode) const; |
| 49 | |
| 50 | virtual bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const; |
| 51 | }; |
| 52 | |
| 53 | } // End namespace llvm |
| 54 | |
| 55 | namespace SIInstrFlags { |
| 56 | enum Flags { |
| 57 | // First 4 bits are the instruction encoding |
| 58 | NEED_WAIT = 1 << 4 |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | #endif //SIINSTRINFO_H |