1 //===-- AMDILDeviceInfo.cpp - TODO: Add brief description -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
9 #include "AMDILDevices.h"
10 #include "AMDILSubtarget.h"
15 getDeviceFromName(const std::string &deviceName, AMDILSubtarget *ptr, bool is64bit, bool is64on32bit)
17 if (deviceName.c_str()[2] == '7') {
18 switch (deviceName.c_str()[3]) {
20 return new AMDIL710Device(ptr);
22 return new AMDIL770Device(ptr);
24 return new AMDIL7XXDevice(ptr);
26 } else if (deviceName == "cypress") {
28 assert(!is64bit && "This device does not support 64bit pointers!");
29 assert(!is64on32bit && "This device does not support 64bit"
30 " on 32bit pointers!");
32 return new AMDILCypressDevice(ptr);
33 } else if (deviceName == "juniper") {
35 assert(!is64bit && "This device does not support 64bit pointers!");
36 assert(!is64on32bit && "This device does not support 64bit"
37 " on 32bit pointers!");
39 return new AMDILEvergreenDevice(ptr);
40 } else if (deviceName == "redwood") {
42 assert(!is64bit && "This device does not support 64bit pointers!");
43 assert(!is64on32bit && "This device does not support 64bit"
44 " on 32bit pointers!");
46 return new AMDILRedwoodDevice(ptr);
47 } else if (deviceName == "cedar") {
49 assert(!is64bit && "This device does not support 64bit pointers!");
50 assert(!is64on32bit && "This device does not support 64bit"
51 " on 32bit pointers!");
53 return new AMDILCedarDevice(ptr);
54 } else if (deviceName == "barts"
55 || deviceName == "turks") {
57 assert(!is64bit && "This device does not support 64bit pointers!");
58 assert(!is64on32bit && "This device does not support 64bit"
59 " on 32bit pointers!");
61 return new AMDILNIDevice(ptr);
62 } else if (deviceName == "cayman") {
64 assert(!is64bit && "This device does not support 64bit pointers!");
65 assert(!is64on32bit && "This device does not support 64bit"
66 " on 32bit pointers!");
68 return new AMDILCaymanDevice(ptr);
69 } else if (deviceName == "caicos") {
71 assert(!is64bit && "This device does not support 64bit pointers!");
72 assert(!is64on32bit && "This device does not support 64bit"
73 " on 32bit pointers!");
75 return new AMDILNIDevice(ptr);
76 } else if (deviceName == "SI") {
77 return new AMDILSIDevice(ptr);
80 assert(!is64bit && "This device does not support 64bit pointers!");
81 assert(!is64on32bit && "This device does not support 64bit"
82 " on 32bit pointers!");
84 return new AMDIL7XXDevice(ptr);