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"
16 #include "R600InstrInfo.h"
17 #include "SIInstrInfo.h"
21 #define DEBUG_TYPE "amdgpu-subtarget"
23 #define GET_SUBTARGETINFO_ENUM
24 #define GET_SUBTARGETINFO_TARGET_DESC
25 #define GET_SUBTARGETINFO_CTOR
26 #include "AMDGPUGenSubtargetInfo.inc"
28 AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
29 AMDGPUGenSubtargetInfo(TT, CPU, FS), DumpCode(false) {
30 InstrItins = getInstrItineraryForCPU(CPU);
35 HasVertexCache = false;
37 Gen = AMDGPUSubtarget::R600;
40 EnableIRStructurizer = true;
44 ParseSubtargetFeatures(GPU, FS);
47 if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
48 InstrInfo.reset(new R600InstrInfo(*this));
50 InstrInfo.reset(new SIInstrInfo(*this));
55 AMDGPUSubtarget::is64bit() const {
59 AMDGPUSubtarget::hasVertexCache() const {
60 return HasVertexCache;
63 AMDGPUSubtarget::getTexVTXClauseSize() const {
64 return TexVTXClauseSize;
66 enum AMDGPUSubtarget::Generation
67 AMDGPUSubtarget::getGeneration() const {
71 AMDGPUSubtarget::hasHWFP64() const {
75 AMDGPUSubtarget::hasCaymanISA() const {
79 AMDGPUSubtarget::IsIRStructurizerEnabled() const {
80 return EnableIRStructurizer;
83 AMDGPUSubtarget::isIfCvtEnabled() const {
87 AMDGPUSubtarget::getWavefrontSize() const {
91 AMDGPUSubtarget::getStackEntrySize() const {
92 assert(getGeneration() <= NORTHERN_ISLANDS);
93 switch(getWavefrontSize()) {
104 llvm_unreachable("Illegal wavefront size.");
108 AMDGPUSubtarget::hasCFAluBug() const {
109 assert(getGeneration() <= NORTHERN_ISLANDS);
113 AMDGPUSubtarget::isTargetELF() const {
118 AMDGPUSubtarget::getDeviceName() const {