summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/AMDILNIDevice.cpp
blob: 8fda1c18ae551b91790f47e4fa54e401ac28401f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//===-- AMDILNIDevice.cpp - TODO: Add brief description -------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//==-----------------------------------------------------------------------===//
#include "AMDILNIDevice.h"
#include "AMDILEvergreenDevice.h"
#include "AMDILSubtarget.h"

using namespace llvm;

AMDILNIDevice::AMDILNIDevice(AMDILSubtarget *ST)
  : AMDILEvergreenDevice(ST)
{
  std::string name = ST->getDeviceName();
  if (name == "caicos") {
    mDeviceFlag = OCL_DEVICE_CAICOS;
  } else if (name == "turks") {
    mDeviceFlag = OCL_DEVICE_TURKS;
  } else if (name == "cayman") {
    mDeviceFlag = OCL_DEVICE_CAYMAN;
  } else {
    mDeviceFlag = OCL_DEVICE_BARTS;
  }
}
AMDILNIDevice::~AMDILNIDevice()
{
}

size_t
AMDILNIDevice::getMaxLDSSize() const
{
  if (usesHardware(AMDILDeviceInfo::LocalMem)) {
    return MAX_LDS_SIZE_900;
  } else {
    return 0;
  }
}

uint32_t
AMDILNIDevice::getGeneration() const
{
  return AMDILDeviceInfo::HD6XXX;
}


AMDILCaymanDevice::AMDILCaymanDevice(AMDILSubtarget *ST)
  : AMDILNIDevice(ST)
{
  setCaps();
}

AMDILCaymanDevice::~AMDILCaymanDevice()
{
}

void
AMDILCaymanDevice::setCaps()
{
  if (mSTM->isOverride(AMDILDeviceInfo::DoubleOps)) {
    mHWBits.set(AMDILDeviceInfo::DoubleOps);
    mHWBits.set(AMDILDeviceInfo::FMA);
  }
  mHWBits.set(AMDILDeviceInfo::Signed24BitOps);
  mSWBits.reset(AMDILDeviceInfo::Signed24BitOps);
  mSWBits.set(AMDILDeviceInfo::ArenaSegment);
}