R600: Remove unused function AMDGPUSubtarget::getDefaultSize()
[oota-llvm.git] / lib / Target / R600 / AMDGPUSubtarget.cpp
1 //===-- AMDGPUSubtarget.cpp - AMDGPU Subtarget Information ----------------===//
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 Implements the AMDGPU specific subclass of TargetSubtarget.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "AMDGPUSubtarget.h"
16
17 using namespace llvm;
18
19 #define DEBUG_TYPE "amdgpu-subtarget"
20
21 #define GET_SUBTARGETINFO_ENUM
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "AMDGPUGenSubtargetInfo.inc"
25
26 AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
27   AMDGPUGenSubtargetInfo(TT, CPU, FS), DumpCode(false) {
28     InstrItins = getInstrItineraryForCPU(CPU);
29
30   // Default card
31   StringRef GPU = CPU;
32   Is64bit = false;
33   HasVertexCache = false;
34   TexVTXClauseSize = 0;
35   Gen = AMDGPUSubtarget::R600;
36   FP64 = false;
37   CaymanISA = false;
38   EnableIRStructurizer = true;
39   EnableIfCvt = true;
40   WavefrontSize = 0;
41   CFALUBug = false;
42   ParseSubtargetFeatures(GPU, FS);
43   DevName = GPU;
44 }
45
46 bool
47 AMDGPUSubtarget::is64bit() const  {
48   return Is64bit;
49 }
50 bool
51 AMDGPUSubtarget::hasVertexCache() const {
52   return HasVertexCache;
53 }
54 short
55 AMDGPUSubtarget::getTexVTXClauseSize() const {
56   return TexVTXClauseSize;
57 }
58 enum AMDGPUSubtarget::Generation
59 AMDGPUSubtarget::getGeneration() const {
60   return Gen;
61 }
62 bool
63 AMDGPUSubtarget::hasHWFP64() const {
64   return FP64;
65 }
66 bool
67 AMDGPUSubtarget::hasCaymanISA() const {
68   return CaymanISA;
69 }
70 bool
71 AMDGPUSubtarget::IsIRStructurizerEnabled() const {
72   return EnableIRStructurizer;
73 }
74 bool
75 AMDGPUSubtarget::isIfCvtEnabled() const {
76   return EnableIfCvt;
77 }
78 unsigned
79 AMDGPUSubtarget::getWavefrontSize() const {
80   return WavefrontSize;
81 }
82 unsigned
83 AMDGPUSubtarget::getStackEntrySize() const {
84   assert(getGeneration() <= NORTHERN_ISLANDS);
85   switch(getWavefrontSize()) {
86   case 16:
87     return 8;
88   case 32:
89     if (hasCaymanISA())
90       return 4;
91     else
92       return 8;
93   case 64:
94     return 4;
95   default:
96     llvm_unreachable("Illegal wavefront size.");
97   }
98 }
99 bool
100 AMDGPUSubtarget::hasCFAluBug() const {
101   assert(getGeneration() <= NORTHERN_ISLANDS);
102   return CFALUBug;
103 }
104 bool
105 AMDGPUSubtarget::isTargetELF() const {
106   return false;
107 }
108
109 std::string
110 AMDGPUSubtarget::getDeviceName() const {
111   return DevName;
112 }