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 "llvm/ADT/StringExtras.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Target/TargetSubtargetInfo.h"
22 #define GET_SUBTARGETINFO_HEADER
23 #include "AMDGPUGenSubtargetInfo.inc"
25 #define MAX_CB_SIZE (1 << 16)
29 class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
47 short TexVTXClauseSize;
51 bool EnableIRStructurizer;
53 unsigned WavefrontSize;
56 InstrItineraryData InstrItins;
59 AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
61 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
62 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
65 bool hasVertexCache() const;
66 short getTexVTXClauseSize() const;
67 enum Generation getGeneration() const;
68 bool hasHWFP64() const;
69 bool hasCaymanISA() const;
72 return (getGeneration() >= EVERGREEN);
76 return (getGeneration() >= EVERGREEN);
83 bool hasMulU24() const {
84 return (getGeneration() >= EVERGREEN);
87 bool hasMulI24() const {
88 return (getGeneration() >= SOUTHERN_ISLANDS ||
92 bool IsIRStructurizerEnabled() const;
93 bool isIfCvtEnabled() const;
94 unsigned getWavefrontSize() const;
95 unsigned getStackEntrySize() const;
96 bool hasCFAluBug() const;
98 bool enableMachineScheduler() const override {
99 return getGeneration() <= NORTHERN_ISLANDS;
102 // Helper functions to simplify if statements
103 bool isTargetELF() const;
104 std::string getDeviceName() const;
105 bool dumpCode() const { return DumpCode; }
106 bool r600ALUEncoding() const { return R600ALUInst; }
110 } // End namespace llvm
112 #endif // AMDGPUSUBTARGET_H