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 = false;
40 ParseSubtargetFeatures(GPU, FS);
45 AMDGPUSubtarget::is64bit() const {
49 AMDGPUSubtarget::hasVertexCache() const {
50 return HasVertexCache;
53 AMDGPUSubtarget::getTexVTXClauseSize() const {
54 return TexVTXClauseSize;
56 enum AMDGPUSubtarget::Generation
57 AMDGPUSubtarget::getGeneration() const {
61 AMDGPUSubtarget::hasHWFP64() const {
65 AMDGPUSubtarget::hasCaymanISA() const {
69 AMDGPUSubtarget::IsIRStructurizerEnabled() const {
70 return EnableIRStructurizer;
73 AMDGPUSubtarget::isTargetELF() const {
77 AMDGPUSubtarget::getDefaultSize(uint32_t dim) const {
81 return DefaultSize[dim];
86 AMDGPUSubtarget::getDataLayout() const {
87 std::string DataLayout = std::string(
89 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
90 "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
91 "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048"
96 DataLayout.append("-f64:64:64");
100 DataLayout.append("-p:64:64:64");
102 DataLayout.append("-p:32:32:32");
105 if (Gen >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
106 DataLayout.append("-p3:32:32:32");
113 AMDGPUSubtarget::getDeviceName() const {