AMDGPU: Add core backend files for R600/SI codegen v6
[oota-llvm.git] / lib / Target / AMDGPU / R600InstrInfo.h
1 //===-- R600InstrInfo.h - R600 Instruction Info Interface -------*- C++ -*-===//
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 // Interface definition for R600InstrInfo
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef R600INSTRUCTIONINFO_H_
15 #define R600INSTRUCTIONINFO_H_
16
17 #include "AMDIL.h"
18 #include "AMDILInstrInfo.h"
19 #include "R600RegisterInfo.h"
20
21 #include <map>
22
23 namespace llvm {
24
25   class AMDGPUTargetMachine;
26   class DFAPacketizer;
27   class ScheduleDAG;
28   class MachineFunction;
29   class MachineInstr;
30   class MachineInstrBuilder;
31
32   class R600InstrInfo : public AMDGPUInstrInfo {
33   private:
34   const R600RegisterInfo RI;
35
36   public:
37   explicit R600InstrInfo(AMDGPUTargetMachine &tm);
38
39   const R600RegisterInfo &getRegisterInfo() const;
40   virtual void copyPhysReg(MachineBasicBlock &MBB,
41                            MachineBasicBlock::iterator MI, DebugLoc DL,
42                            unsigned DestReg, unsigned SrcReg,
43                            bool KillSrc) const;
44
45   bool isTrig(const MachineInstr &MI) const;
46
47   /// isVector - Vector instructions are instructions that must fill all
48   /// instruction slots within an instruction group.
49   bool isVector(const MachineInstr &MI) const;
50
51   virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg,
52                                         int64_t Imm) const;
53
54   virtual unsigned getIEQOpcode() const;
55   virtual bool isMov(unsigned Opcode) const;
56
57   DFAPacketizer *CreateTargetScheduleState(const TargetMachine *TM,
58                                            const ScheduleDAG *DAG) const;
59 };
60
61 } // End llvm namespace
62
63 namespace R600_InstFlag {
64         enum TIF {
65                 TRANS_ONLY = (1 << 0),
66                 TEX = (1 << 1),
67                 REDUCTION = (1 << 2),
68                 FC = (1 << 3),
69                 TRIG = (1 << 4),
70                 OP3 = (1 << 5),
71                 VECTOR = (1 << 6)
72         };
73 }
74
75 #endif // R600INSTRINFO_H_