LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AMDGPUSubtarget.cpp
Go to the documentation of this file.
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 GET_SUBTARGETINFO_ENUM
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "AMDGPUGenSubtargetInfo.inc"
23 
25  AMDGPUGenSubtargetInfo(TT, CPU, FS), DumpCode(false) {
26  InstrItins = getInstrItineraryForCPU(CPU);
27 
28  // Default card
29  StringRef GPU = CPU;
30  Is64bit = false;
31  DefaultSize[0] = 64;
32  DefaultSize[1] = 1;
33  DefaultSize[2] = 1;
34  HasVertexCache = false;
35  TexVTXClauseSize = 0;
37  FP64 = false;
38  CaymanISA = false;
39  EnableIRStructurizer = true;
40  EnableIfCvt = true;
41  ParseSubtargetFeatures(GPU, FS);
42  DevName = GPU;
43 }
44 
45 bool
47  return Is64bit;
48 }
49 bool
51  return HasVertexCache;
52 }
53 short
55  return TexVTXClauseSize;
56 }
59  return Gen;
60 }
61 bool
63  return FP64;
64 }
65 bool
67  return CaymanISA;
68 }
69 bool
71  return EnableIRStructurizer;
72 }
73 bool
75  return EnableIfCvt;
76 }
77 bool
79  return false;
80 }
81 size_t
82 AMDGPUSubtarget::getDefaultSize(uint32_t dim) const {
83  if (dim > 3) {
84  return 1;
85  } else {
86  return DefaultSize[dim];
87  }
88 }
89 
90 std::string
92  std::string DataLayout = std::string(
93  "e"
94  "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
95  "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
96  "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048"
97  "-n32:64"
98  );
99 
100  if (hasHWFP64()) {
101  DataLayout.append("-f64:64:64");
102  }
103 
104  if (is64bit()) {
105  DataLayout.append("-p:64:64:64");
106  } else {
107  DataLayout.append("-p:32:32:32");
108  }
109 
111  DataLayout.append("-p3:32:32:32");
112  }
113 
114  return DataLayout;
115 }
116 
117 std::string
119  return DevName;
120 }
AMDGPU specific subclass of TargetSubtarget.
enum Generation getGeneration() const
bool isIfCvtEnabled() const
#define false
Definition: ConvertUTF.c:64
AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS)
std::string getDeviceName() const
bool hasVertexCache() const
bool hasCaymanISA() const
virtual void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
virtual size_t getDefaultSize(uint32_t dim) const
bool IsIRStructurizerEnabled() const
std::string getDataLayout() const
short getTexVTXClauseSize() const