blob: a65f7b6b52b1e200931ae7b9cef15ba1ba707e5c [file] [log] [blame]
Tom Stellardf98f2ce2012-12-11 21:25:42 +00001//===-- 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
22namespace llvm {
23
24class SIInstrInfo : public AMDGPUInstrInfo {
25private:
26 const SIRegisterInfo RI;
27
28public:
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 Stellardf98f2ce2012-12-11 21:25:42 +000038 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 Stellardc0b0c672013-02-06 17:32:29 +000045
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 Stellardf98f2ce2012-12-11 21:25:42 +000071 };
72
73} // End namespace llvm
74
75namespace SIInstrFlags {
76 enum Flags {
77 // First 4 bits are the instruction encoding
Tom Stellard184f5c12013-02-07 19:39:45 +000078 VM_CNT = 1 << 0,
79 EXP_CNT = 1 << 1,
80 LGKM_CNT = 1 << 2
Tom Stellardf98f2ce2012-12-11 21:25:42 +000081 };
82}
83
84#endif //SIINSTRINFO_H