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);
28 memset(CapsOverride, 0, sizeof(*CapsOverride)
29 * AMDGPUDeviceInfo::MaxNumberCapabilities);
36 ParseSubtargetFeatures(GPU, FS);
38 Device = AMDGPUDeviceInfo::getDeviceFromName(DevName, this, Is64bit);
41 AMDGPUSubtarget::~AMDGPUSubtarget() {
46 AMDGPUSubtarget::isOverride(AMDGPUDeviceInfo::Caps caps) const {
47 assert(caps < AMDGPUDeviceInfo::MaxNumberCapabilities &&
48 "Caps index is out of bounds!");
49 return CapsOverride[caps];
52 AMDGPUSubtarget::is64bit() const {
56 AMDGPUSubtarget::isTargetELF() const {
60 AMDGPUSubtarget::getDefaultSize(uint32_t dim) const {
64 return DefaultSize[dim];
69 AMDGPUSubtarget::getDataLayout() const {
71 return std::string("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16"
72 "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32"
73 "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64"
74 "-v96:128:128-v128:128:128-v192:256:256-v256:256:256"
75 "-v512:512:512-v1024:1024:1024-v2048:2048:2048-a0:0:64");
77 return Device->getDataLayout();
81 AMDGPUSubtarget::getDeviceName() const {
85 AMDGPUSubtarget::device() const {