This patch adds a new NVPTX back-end to LLVM which supports code generation for NVIDI...
[oota-llvm.git] / lib / Target / NVPTX / MCTargetDesc / NVPTXBaseInfo.h
1 //===-- NVPTXBaseInfo.h - Top-level definitions for NVPTX -------*- C++ -*-===//
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 //
10 // This file contains small standalone helper functions and enum definitions for
11 // the NVPTX target useful for the compiler back-end and the MC libraries.
12 // As such, it deliberately does not include references to LLVM core
13 // code gen types, passes, etc..
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef NVPTXBASEINFO_H
18 #define NVPTXBASEINFO_H
19
20 namespace llvm {
21
22 enum AddressSpace {
23   ADDRESS_SPACE_GENERIC = 0,
24   ADDRESS_SPACE_GLOBAL = 1,
25   ADDRESS_SPACE_CONST_NOT_GEN = 2, // Not part of generic space
26   ADDRESS_SPACE_SHARED = 3,
27   ADDRESS_SPACE_CONST = 4,
28   ADDRESS_SPACE_LOCAL = 5,
29
30   // NVVM Internal
31   ADDRESS_SPACE_PARAM = 101
32 };
33
34 enum PropertyAnnotation {
35   PROPERTY_MAXNTID_X = 0,
36   PROPERTY_MAXNTID_Y,
37   PROPERTY_MAXNTID_Z,
38   PROPERTY_REQNTID_X,
39   PROPERTY_REQNTID_Y,
40   PROPERTY_REQNTID_Z,
41   PROPERTY_MINNCTAPERSM,
42   PROPERTY_ISTEXTURE,
43   PROPERTY_ISSURFACE,
44   PROPERTY_ISSAMPLER,
45   PROPERTY_ISREADONLY_IMAGE_PARAM,
46   PROPERTY_ISWRITEONLY_IMAGE_PARAM,
47   PROPERTY_ISKERNEL_FUNCTION,
48   PROPERTY_ALIGN,
49
50   // last property
51   PROPERTY_LAST
52 };
53
54 const unsigned AnnotationNameLen = 8; // length of each annotation name
55 const char
56 PropertyAnnotationNames[PROPERTY_LAST + 1][AnnotationNameLen + 1] = {
57   "maxntidx",               // PROPERTY_MAXNTID_X
58   "maxntidy",               // PROPERTY_MAXNTID_Y
59   "maxntidz",               // PROPERTY_MAXNTID_Z
60   "reqntidx",               // PROPERTY_REQNTID_X
61   "reqntidy",               // PROPERTY_REQNTID_Y
62   "reqntidz",               // PROPERTY_REQNTID_Z
63   "minctasm",               // PROPERTY_MINNCTAPERSM
64   "texture",                // PROPERTY_ISTEXTURE
65   "surface",                // PROPERTY_ISSURFACE
66   "sampler",                // PROPERTY_ISSAMPLER
67   "rdoimage",               // PROPERTY_ISREADONLY_IMAGE_PARAM
68   "wroimage",               // PROPERTY_ISWRITEONLY_IMAGE_PARAM
69   "kernel",                 // PROPERTY_ISKERNEL_FUNCTION
70   "align",                  // PROPERTY_ALIGN
71
72   // last property
73   "proplast",               // PROPERTY_LAST
74 };
75
76 // name of named metadata used for global annotations
77 #if defined(__GNUC__)
78 // As this is declared to be static but some of the .cpp files that
79 // include NVVM.h do not use this array, gcc gives a warning when
80 // compiling those .cpp files, hence __attribute__((unused)).
81 __attribute__((unused))
82 #endif
83 static const char* NamedMDForAnnotations = "nvvm.annotations";
84
85 }
86
87
88 #endif