LLVM API Documentation
00001 //===-- NVPTXBaseInfo.h - Top-level definitions for NVPTX -------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains small standalone helper functions and enum definitions for 00011 // the NVPTX target useful for the compiler back-end and the MC libraries. 00012 // As such, it deliberately does not include references to LLVM core 00013 // code gen types, passes, etc.. 00014 // 00015 //===----------------------------------------------------------------------===// 00016 00017 #ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H 00018 #define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H 00019 00020 namespace llvm { 00021 00022 enum AddressSpace { 00023 ADDRESS_SPACE_GENERIC = 0, 00024 ADDRESS_SPACE_GLOBAL = 1, 00025 ADDRESS_SPACE_SHARED = 3, 00026 ADDRESS_SPACE_CONST = 4, 00027 ADDRESS_SPACE_LOCAL = 5, 00028 00029 // NVVM Internal 00030 ADDRESS_SPACE_PARAM = 101 00031 }; 00032 00033 enum PropertyAnnotation { 00034 PROPERTY_MAXNTID_X = 0, 00035 PROPERTY_MAXNTID_Y, 00036 PROPERTY_MAXNTID_Z, 00037 PROPERTY_REQNTID_X, 00038 PROPERTY_REQNTID_Y, 00039 PROPERTY_REQNTID_Z, 00040 PROPERTY_MINNCTAPERSM, 00041 PROPERTY_ISTEXTURE, 00042 PROPERTY_ISSURFACE, 00043 PROPERTY_ISSAMPLER, 00044 PROPERTY_ISREADONLY_IMAGE_PARAM, 00045 PROPERTY_ISWRITEONLY_IMAGE_PARAM, 00046 PROPERTY_ISREADWRITE_IMAGE_PARAM, 00047 PROPERTY_ISKERNEL_FUNCTION, 00048 PROPERTY_ALIGN, 00049 PROPERTY_MANAGED, 00050 00051 // last property 00052 PROPERTY_LAST 00053 }; 00054 00055 const unsigned AnnotationNameLen = 9; // length of each annotation name 00056 const char PropertyAnnotationNames[PROPERTY_LAST + 1][AnnotationNameLen + 1] = { 00057 "maxntidx", // PROPERTY_MAXNTID_X 00058 "maxntidy", // PROPERTY_MAXNTID_Y 00059 "maxntidz", // PROPERTY_MAXNTID_Z 00060 "reqntidx", // PROPERTY_REQNTID_X 00061 "reqntidy", // PROPERTY_REQNTID_Y 00062 "reqntidz", // PROPERTY_REQNTID_Z 00063 "minctasm", // PROPERTY_MINNCTAPERSM 00064 "texture", // PROPERTY_ISTEXTURE 00065 "surface", // PROPERTY_ISSURFACE 00066 "sampler", // PROPERTY_ISSAMPLER 00067 "rdoimage", // PROPERTY_ISREADONLY_IMAGE_PARAM 00068 "wroimage", // PROPERTY_ISWRITEONLY_IMAGE_PARAM 00069 "rdwrimage", // PROPERTY_ISREADWRITE_IMAGE_PARAM 00070 "kernel", // PROPERTY_ISKERNEL_FUNCTION 00071 "align", // PROPERTY_ALIGN 00072 "managed", // PROPERTY_MANAGED 00073 00074 // last property 00075 "proplast", // PROPERTY_LAST 00076 }; 00077 00078 // name of named metadata used for global annotations 00079 #if defined(__GNUC__) 00080 // As this is declared to be static but some of the .cpp files that 00081 // include NVVM.h do not use this array, gcc gives a warning when 00082 // compiling those .cpp files, hence __attribute__((unused)). 00083 __attribute__((unused)) 00084 #endif 00085 static const char *NamedMDForAnnotations = "nvvm.annotations"; 00086 00087 namespace NVPTXII { 00088 enum { 00089 // These must be kept in sync with TSFlags in NVPTXInstrFormats.td 00090 IsTexFlag = 0x80, 00091 IsSuldMask = 0x300, 00092 IsSuldShift = 8, 00093 IsSustFlag = 0x400, 00094 IsSurfTexQueryFlag = 0x800, 00095 IsTexModeUnifiedFlag = 0x1000 00096 }; 00097 } 00098 } 00099 00100 #endif