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 //===----------------------------------------------------------------------===//
10 // This file implements the AMDGPU specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #include "AMDGPUSubtarget.h"
18 #define GET_SUBTARGETINFO_ENUM
19 #define GET_SUBTARGETINFO_TARGET_DESC
20 #define GET_SUBTARGETINFO_CTOR
21 #include "AMDGPUGenSubtargetInfo.inc"
23 AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT
, StringRef CPU
, StringRef FS
) :
24 AMDGPUGenSubtargetInfo(TT
, CPU
, FS
), mDumpCode(false) {
25 InstrItins
= getInstrItineraryForCPU(CPU
);
27 memset(CapsOverride
, 0, sizeof(*CapsOverride
)
28 * AMDGPUDeviceInfo::MaxNumberCapabilities
);
35 ParseSubtargetFeatures(GPU
, FS
);
37 mDevice
= AMDGPUDeviceInfo::getDeviceFromName(mDevName
, this, mIs64bit
);
40 AMDGPUSubtarget::~AMDGPUSubtarget()
46 AMDGPUSubtarget::isOverride(AMDGPUDeviceInfo::Caps caps
) const
48 assert(caps
< AMDGPUDeviceInfo::MaxNumberCapabilities
&&
49 "Caps index is out of bounds!");
50 return CapsOverride
[caps
];
53 AMDGPUSubtarget::is64bit() const
58 AMDGPUSubtarget::isTargetELF() const
63 AMDGPUSubtarget::getDefaultSize(uint32_t dim
) const
68 return mDefaultSize
[dim
];
73 AMDGPUSubtarget::getDataLayout() const
76 return std::string("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16"
77 "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32"
78 "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64"
79 "-v96:128:128-v128:128:128-v192:256:256-v256:256:256"
80 "-v512:512:512-v1024:1024:1024-v2048:2048:2048-a0:0:64");
82 return mDevice
->getDataLayout();
86 AMDGPUSubtarget::getDeviceName() const
91 AMDGPUSubtarget::device() const