radeonsi: initial WIP SI code
[mesa.git] / src / gallium / drivers / radeon / AMDILDeviceInfo.cpp
1 //===-- AMDILDeviceInfo.cpp - TODO: Add brief description -------===//
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 "AMDILDevices.h"
10 #include "AMDILSubtarget.h"
11
12 using namespace llvm;
13 namespace llvm {
14 AMDILDevice*
15 getDeviceFromName(const std::string &deviceName, AMDILSubtarget *ptr, bool is64bit, bool is64on32bit)
16 {
17 if (deviceName.c_str()[2] == '7') {
18 switch (deviceName.c_str()[3]) {
19 case '1':
20 return new AMDIL710Device(ptr);
21 case '7':
22 return new AMDIL770Device(ptr);
23 default:
24 return new AMDIL7XXDevice(ptr);
25 };
26 } else if (deviceName == "cypress") {
27 #if DEBUG
28 assert(!is64bit && "This device does not support 64bit pointers!");
29 assert(!is64on32bit && "This device does not support 64bit"
30 " on 32bit pointers!");
31 #endif
32 return new AMDILCypressDevice(ptr);
33 } else if (deviceName == "juniper") {
34 #if DEBUG
35 assert(!is64bit && "This device does not support 64bit pointers!");
36 assert(!is64on32bit && "This device does not support 64bit"
37 " on 32bit pointers!");
38 #endif
39 return new AMDILEvergreenDevice(ptr);
40 } else if (deviceName == "redwood") {
41 #if DEBUG
42 assert(!is64bit && "This device does not support 64bit pointers!");
43 assert(!is64on32bit && "This device does not support 64bit"
44 " on 32bit pointers!");
45 #endif
46 return new AMDILRedwoodDevice(ptr);
47 } else if (deviceName == "cedar") {
48 #if DEBUG
49 assert(!is64bit && "This device does not support 64bit pointers!");
50 assert(!is64on32bit && "This device does not support 64bit"
51 " on 32bit pointers!");
52 #endif
53 return new AMDILCedarDevice(ptr);
54 } else if (deviceName == "barts"
55 || deviceName == "turks") {
56 #if DEBUG
57 assert(!is64bit && "This device does not support 64bit pointers!");
58 assert(!is64on32bit && "This device does not support 64bit"
59 " on 32bit pointers!");
60 #endif
61 return new AMDILNIDevice(ptr);
62 } else if (deviceName == "cayman") {
63 #if DEBUG
64 assert(!is64bit && "This device does not support 64bit pointers!");
65 assert(!is64on32bit && "This device does not support 64bit"
66 " on 32bit pointers!");
67 #endif
68 return new AMDILCaymanDevice(ptr);
69 } else if (deviceName == "caicos") {
70 #if DEBUG
71 assert(!is64bit && "This device does not support 64bit pointers!");
72 assert(!is64on32bit && "This device does not support 64bit"
73 " on 32bit pointers!");
74 #endif
75 return new AMDILNIDevice(ptr);
76 } else if (deviceName == "SI") {
77 return new AMDILSIDevice(ptr);
78 } else {
79 #if DEBUG
80 assert(!is64bit && "This device does not support 64bit pointers!");
81 assert(!is64on32bit && "This device does not support 64bit"
82 " on 32bit pointers!");
83 #endif
84 return new AMDIL7XXDevice(ptr);
85 }
86 }
87 }