radeon/llvm: Add some comments
[mesa.git] / src / gallium / drivers / radeon / AMDILNIDevice.cpp
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 //==-----------------------------------------------------------------------===//
9 #include "AMDILNIDevice.h"
10 #include "AMDILEvergreenDevice.h"
11 #include "AMDILSubtarget.h"
12
13 using namespace llvm;
14
15 AMDILNIDevice::AMDILNIDevice(AMDILSubtarget *ST)
16 : AMDILEvergreenDevice(ST)
17 {
18 std::string name = ST->getDeviceName();
19 if (name == "caicos") {
20 mDeviceFlag = OCL_DEVICE_CAICOS;
21 } else if (name == "turks") {
22 mDeviceFlag = OCL_DEVICE_TURKS;
23 } else if (name == "cayman") {
24 mDeviceFlag = OCL_DEVICE_CAYMAN;
25 } else {
26 mDeviceFlag = OCL_DEVICE_BARTS;
27 }
28 }
29 AMDILNIDevice::~AMDILNIDevice()
30 {
31 }
32
33 size_t
34 AMDILNIDevice::getMaxLDSSize() const
35 {
36 if (usesHardware(AMDILDeviceInfo::LocalMem)) {
37 return MAX_LDS_SIZE_900;
38 } else {
39 return 0;
40 }
41 }
42
43 uint32_t
44 AMDILNIDevice::getGeneration() const
45 {
46 return AMDILDeviceInfo::HD6XXX;
47 }
48
49
50 AMDILCaymanDevice::AMDILCaymanDevice(AMDILSubtarget *ST)
51 : AMDILNIDevice(ST)
52 {
53 setCaps();
54 }
55
56 AMDILCaymanDevice::~AMDILCaymanDevice()
57 {
58 }
59
60 void
61 AMDILCaymanDevice::setCaps()
62 {
63 if (mSTM->isOverride(AMDILDeviceInfo::DoubleOps)) {
64 mHWBits.set(AMDILDeviceInfo::DoubleOps);
65 mHWBits.set(AMDILDeviceInfo::FMA);
66 }
67 mHWBits.set(AMDILDeviceInfo::Signed24BitOps);
68 mSWBits.reset(AMDILDeviceInfo::Signed24BitOps);
69 mSWBits.set(AMDILDeviceInfo::ArenaSegment);
70 }
71