1 //=====-- AMDGPUSubtarget.h - Define Subtarget for the AMDIL ---*- C++ -*-====//
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 AMDGPU specific subclass of TargetSubtarget.
13 //===----------------------------------------------------------------------===//
15 #ifndef AMDGPUSUBTARGET_H
16 #define AMDGPUSUBTARGET_H
18 #include "AMDGPUInstrInfo.h"
19 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Target/TargetSubtargetInfo.h"
23 #define GET_SUBTARGETINFO_HEADER
24 #include "AMDGPUGenSubtargetInfo.inc"
26 #define MAX_CB_SIZE (1 << 16)
30 class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
32 std::unique_ptr<AMDGPUInstrInfo> InstrInfo;
50 short TexVTXClauseSize;
54 bool EnableIRStructurizer;
56 unsigned WavefrontSize;
60 InstrItineraryData InstrItins;
63 AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
65 const AMDGPUInstrInfo *getInstrInfo() const {
66 return InstrInfo.get();
69 const InstrItineraryData &getInstrItineraryData() const {
73 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
75 bool is64bit() const {
79 bool hasVertexCache() const {
80 return HasVertexCache;
83 short getTexVTXClauseSize() const {
84 return TexVTXClauseSize;
87 Generation getGeneration() const {
91 bool hasHWFP64() const {
95 bool hasCaymanISA() const {
100 return (getGeneration() >= EVERGREEN);
103 bool hasBFI() const {
104 return (getGeneration() >= EVERGREEN);
107 bool hasBFM() const {
111 bool hasBCNT(unsigned Size) const {
113 return (getGeneration() >= EVERGREEN);
116 return (getGeneration() >= SOUTHERN_ISLANDS);
119 bool hasMulU24() const {
120 return (getGeneration() >= EVERGREEN);
123 bool hasMulI24() const {
124 return (getGeneration() >= SOUTHERN_ISLANDS ||
128 bool IsIRStructurizerEnabled() const {
129 return EnableIRStructurizer;
132 bool isIfCvtEnabled() const {
136 unsigned getWavefrontSize() const {
137 return WavefrontSize;
140 unsigned getStackEntrySize() const;
142 bool hasCFAluBug() const {
143 assert(getGeneration() <= NORTHERN_ISLANDS);
147 int getLocalMemorySize() const {
148 return LocalMemorySize;
151 bool enableMachineScheduler() const override {
152 return getGeneration() <= NORTHERN_ISLANDS;
155 // Helper functions to simplify if statements
156 bool isTargetELF() const {
160 StringRef getDeviceName() const {
164 bool dumpCode() const {
167 bool r600ALUEncoding() const {
172 } // End namespace llvm
174 #endif // AMDGPUSUBTARGET_H