1//===-- AMDILNIDevice.cpp - Device Info for Northern Islands devices ------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8/// \file
9//==-----------------------------------------------------------------------===//
10#include "AMDILNIDevice.h"
11#include "AMDGPUSubtarget.h"
12#include "AMDILEvergreenDevice.h"
13
14using namespace llvm;
15
16AMDGPUNIDevice::AMDGPUNIDevice(AMDGPUSubtarget *ST)
17  : AMDGPUEvergreenDevice(ST) {
18  std::string name = ST->getDeviceName();
19  if (name == "caicos") {
20    DeviceFlag = OCL_DEVICE_CAICOS;
21  } else if (name == "turks") {
22    DeviceFlag = OCL_DEVICE_TURKS;
23  } else if (name == "cayman") {
24    DeviceFlag = OCL_DEVICE_CAYMAN;
25  } else {
26    DeviceFlag = OCL_DEVICE_BARTS;
27  }
28}
29AMDGPUNIDevice::~AMDGPUNIDevice() {
30}
31
32size_t
33AMDGPUNIDevice::getMaxLDSSize() const {
34  if (usesHardware(AMDGPUDeviceInfo::LocalMem)) {
35    return MAX_LDS_SIZE_900;
36  } else {
37    return 0;
38  }
39}
40
41uint32_t
42AMDGPUNIDevice::getGeneration() const {
43  return AMDGPUDeviceInfo::HD6XXX;
44}
45
46
47AMDGPUCaymanDevice::AMDGPUCaymanDevice(AMDGPUSubtarget *ST)
48  : AMDGPUNIDevice(ST) {
49  setCaps();
50}
51
52AMDGPUCaymanDevice::~AMDGPUCaymanDevice() {
53}
54
55void
56AMDGPUCaymanDevice::setCaps() {
57  if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) {
58    mHWBits.set(AMDGPUDeviceInfo::DoubleOps);
59    mHWBits.set(AMDGPUDeviceInfo::FMA);
60  }
61  mHWBits.set(AMDGPUDeviceInfo::Signed24BitOps);
62  mSWBits.reset(AMDGPUDeviceInfo::Signed24BitOps);
63  mSWBits.set(AMDGPUDeviceInfo::ArenaSegment);
64}
65
66