1 //===-- AMDGPUSubtarget.cpp - AMDGPU Subtarget Information ----------------===//
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 Implements the AMDGPU specific subclass of TargetSubtarget.
13 //===----------------------------------------------------------------------===//
15 #include "AMDGPUSubtarget.h"
19 #define GET_SUBTARGETINFO_ENUM
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "AMDGPUGenSubtargetInfo.inc"
24 AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
25 AMDGPUGenSubtargetInfo(TT, CPU, FS), DumpCode(false) {
26 InstrItins = getInstrItineraryForCPU(CPU);
34 HasVertexCache = false;
36 Gen = AMDGPUSubtarget::R600;
39 EnableIRStructurizer = true;
43 ParseSubtargetFeatures(GPU, FS);
48 AMDGPUSubtarget::is64bit() const {
52 AMDGPUSubtarget::hasVertexCache() const {
53 return HasVertexCache;
56 AMDGPUSubtarget::getTexVTXClauseSize() const {
57 return TexVTXClauseSize;
59 enum AMDGPUSubtarget::Generation
60 AMDGPUSubtarget::getGeneration() const {
64 AMDGPUSubtarget::hasHWFP64() const {
68 AMDGPUSubtarget::hasCaymanISA() const {
72 AMDGPUSubtarget::IsIRStructurizerEnabled() const {
73 return EnableIRStructurizer;
76 AMDGPUSubtarget::isIfCvtEnabled() const {
80 AMDGPUSubtarget::getWavefrontSize() const {
84 AMDGPUSubtarget::getStackEntrySize() const {
85 assert(getGeneration() <= NORTHERN_ISLANDS);
86 switch(getWavefrontSize()) {
97 llvm_unreachable("Illegal wavefront size.");
101 AMDGPUSubtarget::hasCFAluBug() const {
102 assert(getGeneration() <= NORTHERN_ISLANDS);
106 AMDGPUSubtarget::isTargetELF() const {
110 AMDGPUSubtarget::getDefaultSize(uint32_t dim) const {
114 return DefaultSize[dim];
119 AMDGPUSubtarget::getDeviceName() const {