149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//===-- NVPTXBaseInfo.h - Top-level definitions for NVPTX -------*- C++ -*-===//
249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//
349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//                     The LLVM Compiler Infrastructure
449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//
549683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// This file is distributed under the University of Illinois Open Source
649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// License. See LICENSE.TXT for details.
749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//
849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//===----------------------------------------------------------------------===//
949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//
1049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// This file contains small standalone helper functions and enum definitions for
1149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// the NVPTX target useful for the compiler back-end and the MC libraries.
1249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// As such, it deliberately does not include references to LLVM core
1349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// code gen types, passes, etc..
1449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//
1549683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski//===----------------------------------------------------------------------===//
1649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
1749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski#ifndef NVPTXBASEINFO_H
1849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski#define NVPTXBASEINFO_H
1949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
2049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinskinamespace llvm {
2149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
2249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinskienum AddressSpace {
2349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_GENERIC = 0,
2449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_GLOBAL = 1,
2549683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_SHARED = 3,
2649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_CONST = 4,
2749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_LOCAL = 5,
2849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
2949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  // NVVM Internal
3049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  ADDRESS_SPACE_PARAM = 101
3149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski};
3249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
3349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinskienum PropertyAnnotation {
3449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_MAXNTID_X = 0,
3549683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_MAXNTID_Y,
3649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_MAXNTID_Z,
3749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_REQNTID_X,
3849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_REQNTID_Y,
3949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_REQNTID_Z,
4049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_MINNCTAPERSM,
4149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISTEXTURE,
4249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISSURFACE,
4349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISSAMPLER,
4449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISREADONLY_IMAGE_PARAM,
4549683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISWRITEONLY_IMAGE_PARAM,
46dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines  PROPERTY_ISREADWRITE_IMAGE_PARAM,
4749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ISKERNEL_FUNCTION,
4849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_ALIGN,
49dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines  PROPERTY_MANAGED,
5049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
5149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  // last property
5249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski  PROPERTY_LAST
5349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski};
5449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
55dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hinesconst unsigned AnnotationNameLen = 9; // length of each annotation name
563639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinskiconst char PropertyAnnotationNames[PROPERTY_LAST + 1][AnnotationNameLen + 1] = {
573639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "maxntidx",                         // PROPERTY_MAXNTID_X
583639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "maxntidy",                         // PROPERTY_MAXNTID_Y
593639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "maxntidz",                         // PROPERTY_MAXNTID_Z
603639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "reqntidx",                         // PROPERTY_REQNTID_X
613639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "reqntidy",                         // PROPERTY_REQNTID_Y
623639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "reqntidz",                         // PROPERTY_REQNTID_Z
633639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "minctasm",                         // PROPERTY_MINNCTAPERSM
643639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "texture",                          // PROPERTY_ISTEXTURE
653639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "surface",                          // PROPERTY_ISSURFACE
663639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "sampler",                          // PROPERTY_ISSAMPLER
673639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "rdoimage",                         // PROPERTY_ISREADONLY_IMAGE_PARAM
683639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "wroimage",                         // PROPERTY_ISWRITEONLY_IMAGE_PARAM
69dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines  "rdwrimage",                        // PROPERTY_ISREADWRITE_IMAGE_PARAM
703639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "kernel",                           // PROPERTY_ISKERNEL_FUNCTION
713639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "align",                            // PROPERTY_ALIGN
72dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines  "managed",                          // PROPERTY_MANAGED
7349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
743639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski              // last property
753639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski  "proplast", // PROPERTY_LAST
7649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski};
7749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
7849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// name of named metadata used for global annotations
7949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski#if defined(__GNUC__)
8049683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// As this is declared to be static but some of the .cpp files that
8149683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// include NVVM.h do not use this array, gcc gives a warning when
8249683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski// compiling those .cpp files, hence __attribute__((unused)).
8349683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski__attribute__((unused))
8449683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski#endif
853639ce2575660a0e6938d2e84e8bd9a738fd7051Justin Holewinski    static const char *NamedMDForAnnotations = "nvvm.annotations";
8649683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
8749683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski}
8849683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski
8949683f3c961379fbc088871a5d6304950f1f1cbcJustin Holewinski#endif
90