2012-05-04 20:18:50 +00:00
|
|
|
//===-- NVPTXBaseInfo.h - Top-level definitions for NVPTX -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains small standalone helper functions and enum definitions for
|
|
|
|
// the NVPTX target useful for the compiler back-end and the MC libraries.
|
|
|
|
// As such, it deliberately does not include references to LLVM core
|
|
|
|
// code gen types, passes, etc..
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXBASEINFO_H
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
enum AddressSpace {
|
|
|
|
ADDRESS_SPACE_GENERIC = 0,
|
|
|
|
ADDRESS_SPACE_GLOBAL = 1,
|
|
|
|
ADDRESS_SPACE_SHARED = 3,
|
|
|
|
ADDRESS_SPACE_CONST = 4,
|
|
|
|
ADDRESS_SPACE_LOCAL = 5,
|
|
|
|
|
|
|
|
// NVVM Internal
|
|
|
|
ADDRESS_SPACE_PARAM = 101
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PropertyAnnotation {
|
|
|
|
PROPERTY_MAXNTID_X = 0,
|
|
|
|
PROPERTY_MAXNTID_Y,
|
|
|
|
PROPERTY_MAXNTID_Z,
|
|
|
|
PROPERTY_REQNTID_X,
|
|
|
|
PROPERTY_REQNTID_Y,
|
|
|
|
PROPERTY_REQNTID_Z,
|
|
|
|
PROPERTY_MINNCTAPERSM,
|
|
|
|
PROPERTY_ISTEXTURE,
|
|
|
|
PROPERTY_ISSURFACE,
|
|
|
|
PROPERTY_ISSAMPLER,
|
|
|
|
PROPERTY_ISREADONLY_IMAGE_PARAM,
|
|
|
|
PROPERTY_ISWRITEONLY_IMAGE_PARAM,
|
2014-04-09 15:38:52 +00:00
|
|
|
PROPERTY_ISREADWRITE_IMAGE_PARAM,
|
2012-05-04 20:18:50 +00:00
|
|
|
PROPERTY_ISKERNEL_FUNCTION,
|
|
|
|
PROPERTY_ALIGN,
|
2014-04-09 15:38:52 +00:00
|
|
|
PROPERTY_MANAGED,
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
// last property
|
|
|
|
PROPERTY_LAST
|
|
|
|
};
|
|
|
|
|
2014-04-09 15:38:52 +00:00
|
|
|
const unsigned AnnotationNameLen = 9; // length of each annotation name
|
2013-03-30 14:29:21 +00:00
|
|
|
const char PropertyAnnotationNames[PROPERTY_LAST + 1][AnnotationNameLen + 1] = {
|
|
|
|
"maxntidx", // PROPERTY_MAXNTID_X
|
|
|
|
"maxntidy", // PROPERTY_MAXNTID_Y
|
|
|
|
"maxntidz", // PROPERTY_MAXNTID_Z
|
|
|
|
"reqntidx", // PROPERTY_REQNTID_X
|
|
|
|
"reqntidy", // PROPERTY_REQNTID_Y
|
|
|
|
"reqntidz", // PROPERTY_REQNTID_Z
|
|
|
|
"minctasm", // PROPERTY_MINNCTAPERSM
|
|
|
|
"texture", // PROPERTY_ISTEXTURE
|
|
|
|
"surface", // PROPERTY_ISSURFACE
|
|
|
|
"sampler", // PROPERTY_ISSAMPLER
|
|
|
|
"rdoimage", // PROPERTY_ISREADONLY_IMAGE_PARAM
|
|
|
|
"wroimage", // PROPERTY_ISWRITEONLY_IMAGE_PARAM
|
2014-04-09 15:38:52 +00:00
|
|
|
"rdwrimage", // PROPERTY_ISREADWRITE_IMAGE_PARAM
|
2013-03-30 14:29:21 +00:00
|
|
|
"kernel", // PROPERTY_ISKERNEL_FUNCTION
|
|
|
|
"align", // PROPERTY_ALIGN
|
2014-04-09 15:38:52 +00:00
|
|
|
"managed", // PROPERTY_MANAGED
|
2012-05-04 20:18:50 +00:00
|
|
|
|
2013-03-30 14:29:21 +00:00
|
|
|
// last property
|
|
|
|
"proplast", // PROPERTY_LAST
|
2012-05-04 20:18:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// name of named metadata used for global annotations
|
|
|
|
#if defined(__GNUC__)
|
|
|
|
// As this is declared to be static but some of the .cpp files that
|
|
|
|
// include NVVM.h do not use this array, gcc gives a warning when
|
|
|
|
// compiling those .cpp files, hence __attribute__((unused)).
|
|
|
|
__attribute__((unused))
|
|
|
|
#endif
|
2013-03-30 14:29:21 +00:00
|
|
|
static const char *NamedMDForAnnotations = "nvvm.annotations";
|
2012-05-04 20:18:50 +00:00
|
|
|
|
2014-07-17 11:59:04 +00:00
|
|
|
namespace NVPTXII {
|
|
|
|
enum {
|
|
|
|
// These must be kept in sync with TSFlags in NVPTXInstrFormats.td
|
|
|
|
IsTexFlag = 0x80,
|
|
|
|
IsSuldMask = 0x300,
|
|
|
|
IsSuldShift = 8,
|
|
|
|
IsSustFlag = 0x400,
|
|
|
|
IsSurfTexQueryFlag = 0x800,
|
|
|
|
IsTexModeUnifiedFlag = 0x1000
|
|
|
|
};
|
|
|
|
}
|
2012-05-04 20:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|