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 ParseSubtargetFeatures(GPU, FS);
44 AMDGPUSubtarget::is64bit() const {
48 AMDGPUSubtarget::hasVertexCache() const {
49 return HasVertexCache;
52 AMDGPUSubtarget::getTexVTXClauseSize() const {
53 return TexVTXClauseSize;
55 enum AMDGPUSubtarget::Generation
56 AMDGPUSubtarget::getGeneration() const {
60 AMDGPUSubtarget::hasHWFP64() const {
64 AMDGPUSubtarget::hasCaymanISA() const {
68 AMDGPUSubtarget::isTargetELF() const {
72 AMDGPUSubtarget::getDefaultSize(uint32_t dim) const {
76 return DefaultSize[dim];
81 AMDGPUSubtarget::getDataLayout() const {
82 std::string DataLayout = std::string(
84 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
85 "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
86 "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048"
91 DataLayout.append("-f64:64:64");
95 DataLayout.append("-p:64:64:64");
97 DataLayout.append("-p:32:32:32");
104 AMDGPUSubtarget::getDeviceName() const {