]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXBaseInfo.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / NVPTX / MCTargetDesc / NVPTXBaseInfo.h
CommitLineData
223e47cc
LB
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
1a4d82fc
JJ
17#ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H
18#define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H
223e47cc
LB
19
20namespace llvm {
21
22enum AddressSpace {
23 ADDRESS_SPACE_GENERIC = 0,
24 ADDRESS_SPACE_GLOBAL = 1,
223e47cc
LB
25 ADDRESS_SPACE_SHARED = 3,
26 ADDRESS_SPACE_CONST = 4,
27 ADDRESS_SPACE_LOCAL = 5,
28
29 // NVVM Internal
30 ADDRESS_SPACE_PARAM = 101
31};
32
33enum PropertyAnnotation {
34 PROPERTY_MAXNTID_X = 0,
35 PROPERTY_MAXNTID_Y,
36 PROPERTY_MAXNTID_Z,
37 PROPERTY_REQNTID_X,
38 PROPERTY_REQNTID_Y,
39 PROPERTY_REQNTID_Z,
40 PROPERTY_MINNCTAPERSM,
41 PROPERTY_ISTEXTURE,
42 PROPERTY_ISSURFACE,
43 PROPERTY_ISSAMPLER,
44 PROPERTY_ISREADONLY_IMAGE_PARAM,
45 PROPERTY_ISWRITEONLY_IMAGE_PARAM,
1a4d82fc 46 PROPERTY_ISREADWRITE_IMAGE_PARAM,
223e47cc
LB
47 PROPERTY_ISKERNEL_FUNCTION,
48 PROPERTY_ALIGN,
1a4d82fc 49 PROPERTY_MANAGED,
223e47cc
LB
50
51 // last property
52 PROPERTY_LAST
53};
54
1a4d82fc
JJ
55const unsigned AnnotationNameLen = 9; // length of each annotation name
56const char 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 "rdwrimage", // PROPERTY_ISREADWRITE_IMAGE_PARAM
70 "kernel", // PROPERTY_ISKERNEL_FUNCTION
71 "align", // PROPERTY_ALIGN
72 "managed", // PROPERTY_MANAGED
223e47cc 73
1a4d82fc
JJ
74 // last property
75 "proplast", // PROPERTY_LAST
223e47cc
LB
76};
77
78// name of named metadata used for global annotations
79#if defined(__GNUC__)
80// As this is declared to be static but some of the .cpp files that
81// include NVVM.h do not use this array, gcc gives a warning when
82// compiling those .cpp files, hence __attribute__((unused)).
83__attribute__((unused))
84#endif
1a4d82fc 85 static const char *NamedMDForAnnotations = "nvvm.annotations";
223e47cc 86
1a4d82fc
JJ
87namespace NVPTXII {
88enum {
89 // These must be kept in sync with TSFlags in NVPTXInstrFormats.td
90 IsTexFlag = 0x80,
91 IsSuldMask = 0x300,
92 IsSuldShift = 8,
93 IsSustFlag = 0x400,
94 IsSurfTexQueryFlag = 0x800,
95 IsTexModeUnifiedFlag = 0x1000
96};
97}
223e47cc 98}
223e47cc
LB
99
100#endif