1 //===-- AMDILEvergreenDevice.cpp - Device Info for Evergreen --------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 //==-----------------------------------------------------------------------===//
10 #include "AMDILEvergreenDevice.h"
14 AMDGPUEvergreenDevice::AMDGPUEvergreenDevice(AMDGPUSubtarget *ST)
17 std::string name = ST->getDeviceName();
18 if (name == "cedar") {
19 DeviceFlag = OCL_DEVICE_CEDAR;
20 } else if (name == "redwood") {
21 DeviceFlag = OCL_DEVICE_REDWOOD;
22 } else if (name == "cypress") {
23 DeviceFlag = OCL_DEVICE_CYPRESS;
25 DeviceFlag = OCL_DEVICE_JUNIPER;
29 AMDGPUEvergreenDevice::~AMDGPUEvergreenDevice() {
32 size_t AMDGPUEvergreenDevice::getMaxLDSSize() const {
33 if (usesHardware(AMDGPUDeviceInfo::LocalMem)) {
34 return MAX_LDS_SIZE_800;
39 size_t AMDGPUEvergreenDevice::getMaxGDSSize() const {
40 if (usesHardware(AMDGPUDeviceInfo::RegionMem)) {
41 return MAX_LDS_SIZE_800;
46 uint32_t AMDGPUEvergreenDevice::getMaxNumUAVs() const {
50 uint32_t AMDGPUEvergreenDevice::getResourceID(uint32_t id) const {
53 assert(0 && "ID type passed in is unknown!");
57 return GLOBAL_RETURN_RAW_UAV_ID;
60 return DEFAULT_ARENA_UAV_ID;
62 if (usesHardware(AMDGPUDeviceInfo::LocalMem)) {
63 return DEFAULT_LDS_ID;
65 return DEFAULT_ARENA_UAV_ID;
68 if (usesHardware(AMDGPUDeviceInfo::RegionMem)) {
69 return DEFAULT_GDS_ID;
71 return DEFAULT_ARENA_UAV_ID;
74 if (usesHardware(AMDGPUDeviceInfo::PrivateMem)) {
75 return DEFAULT_SCRATCH_ID;
77 return DEFAULT_ARENA_UAV_ID;
83 size_t AMDGPUEvergreenDevice::getWavefrontSize() const {
84 return AMDGPUDevice::WavefrontSize;
87 uint32_t AMDGPUEvergreenDevice::getGeneration() const {
88 return AMDGPUDeviceInfo::HD5XXX;
91 void AMDGPUEvergreenDevice::setCaps() {
92 mSWBits.set(AMDGPUDeviceInfo::ArenaSegment);
93 mHWBits.set(AMDGPUDeviceInfo::ArenaUAV);
94 mHWBits.set(AMDGPUDeviceInfo::HW64BitDivMod);
95 mSWBits.reset(AMDGPUDeviceInfo::HW64BitDivMod);
96 mSWBits.set(AMDGPUDeviceInfo::Signed24BitOps);
97 if (mSTM->isOverride(AMDGPUDeviceInfo::ByteStores)) {
98 mHWBits.set(AMDGPUDeviceInfo::ByteStores);
100 if (mSTM->isOverride(AMDGPUDeviceInfo::Debug)) {
101 mSWBits.set(AMDGPUDeviceInfo::LocalMem);
102 mSWBits.set(AMDGPUDeviceInfo::RegionMem);
104 mHWBits.set(AMDGPUDeviceInfo::LocalMem);
105 mHWBits.set(AMDGPUDeviceInfo::RegionMem);
107 mHWBits.set(AMDGPUDeviceInfo::Images);
108 if (mSTM->isOverride(AMDGPUDeviceInfo::NoAlias)) {
109 mHWBits.set(AMDGPUDeviceInfo::NoAlias);
111 mHWBits.set(AMDGPUDeviceInfo::CachedMem);
112 if (mSTM->isOverride(AMDGPUDeviceInfo::MultiUAV)) {
113 mHWBits.set(AMDGPUDeviceInfo::MultiUAV);
115 mHWBits.set(AMDGPUDeviceInfo::ByteLDSOps);
116 mSWBits.reset(AMDGPUDeviceInfo::ByteLDSOps);
117 mHWBits.set(AMDGPUDeviceInfo::ArenaVectors);
118 mHWBits.set(AMDGPUDeviceInfo::LongOps);
119 mSWBits.reset(AMDGPUDeviceInfo::LongOps);
120 mHWBits.set(AMDGPUDeviceInfo::TmrReg);
123 AMDGPUCypressDevice::AMDGPUCypressDevice(AMDGPUSubtarget *ST)
124 : AMDGPUEvergreenDevice(ST) {
128 AMDGPUCypressDevice::~AMDGPUCypressDevice() {
131 void AMDGPUCypressDevice::setCaps() {
132 if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) {
133 mHWBits.set(AMDGPUDeviceInfo::DoubleOps);
134 mHWBits.set(AMDGPUDeviceInfo::FMA);
139 AMDGPUCedarDevice::AMDGPUCedarDevice(AMDGPUSubtarget *ST)
140 : AMDGPUEvergreenDevice(ST) {
144 AMDGPUCedarDevice::~AMDGPUCedarDevice() {
147 void AMDGPUCedarDevice::setCaps() {
148 mSWBits.set(AMDGPUDeviceInfo::FMA);
151 size_t AMDGPUCedarDevice::getWavefrontSize() const {
152 return AMDGPUDevice::QuarterWavefrontSize;
155 AMDGPURedwoodDevice::AMDGPURedwoodDevice(AMDGPUSubtarget *ST)
156 : AMDGPUEvergreenDevice(ST) {
160 AMDGPURedwoodDevice::~AMDGPURedwoodDevice() {
163 void AMDGPURedwoodDevice::setCaps() {
164 mSWBits.set(AMDGPUDeviceInfo::FMA);
167 size_t AMDGPURedwoodDevice::getWavefrontSize() const {
168 return AMDGPUDevice::HalfWavefrontSize;