LLVM  9.0.0svn
NVPTX.h
Go to the documentation of this file.
1 //===-- NVPTX.h - Top-level interface for NVPTX representation --*- 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 the entry points for global functions defined in
11 // the LLVM NVPTX back-end.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTX_H
16 #define LLVM_LIB_TARGET_NVPTX_NVPTX_H
17 
19 #include "llvm/ADT/StringMap.h"
20 #include "llvm/IR/Module.h"
21 #include "llvm/IR/Value.h"
24 #include <cassert>
25 #include <iosfwd>
26 
27 namespace llvm {
28 class NVPTXTargetMachine;
29 class FunctionPass;
30 class MachineFunctionPass;
31 class formatted_raw_ostream;
32 
33 namespace NVPTXCC {
34 enum CondCodes {
35  EQ,
36  NE,
37  LT,
38  LE,
39  GT,
41 };
42 }
43 
45  llvm::CodeGenOpt::Level OptLevel);
48 FunctionPass *createNVVMIntrRangePass(unsigned int SmVersion);
49 FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
57 
60 
61 namespace NVPTX {
65 };
66 
67 // A field inside TSFlags needs a shift and a mask. The usage is
68 // always as follows :
69 // ((TSFlags & fieldMask) >> fieldShift)
70 // The enum keeps the mask, the shift, and all valid values of the
71 // field in one place.
75 
76  VecNOP = 0,
77  VecLoad = 1,
78  VecStore = 2,
79  VecBuild = 3,
82  VecInsert = 6,
83  VecDest = 7,
84  VecOther = 15
85 };
86 
87 enum SimpleMove {
90 };
91 enum LoadStore {
92  isLoadMask = 0x20,
94  isStoreMask = 0x40,
96 };
97 
98 namespace PTXLdStInstCode {
100  GENERIC = 0,
101  GLOBAL = 1,
102  CONSTANT = 2,
103  SHARED = 3,
104  PARAM = 4,
105  LOCAL = 5
106 };
107 enum FromType {
108  Unsigned = 0,
112 };
113 enum VecType {
114  Scalar = 1,
115  V2 = 2,
116  V4 = 4
117 };
118 }
119 
120 /// PTXCvtMode - Conversion code enumeration
121 namespace PTXCvtMode {
122 enum CvtMode {
123  NONE = 0,
128  RN,
129  RZ,
130  RM,
131  RP,
132 
133  BASE_MASK = 0x0F,
134  FTZ_FLAG = 0x10,
135  SAT_FLAG = 0x20
136 };
137 }
138 
139 /// PTXCmpMode - Comparison mode enumeration
140 namespace PTXCmpMode {
141 enum CmpMode {
142  EQ = 0,
143  NE,
144  LT,
145  LE,
146  GT,
147  GE,
148  LO,
149  LS,
150  HI,
151  HS,
159  // NAN is a MACRO
161 
162  BASE_MASK = 0xFF,
163  FTZ_FLAG = 0x100
164 };
165 }
166 }
167 } // end namespace llvm;
168 
169 // Defines symbolic names for NVPTX registers. This defines a mapping from
170 // register name to register number.
171 #define GET_REGINFO_ENUM
172 #include "NVPTXGenRegisterInfo.inc"
173 
174 // Defines symbolic names for the NVPTX instructions.
175 #define GET_INSTRINFO_ENUM
176 #include "NVPTXGenInstrInfo.inc"
177 
178 #endif
MachineFunctionPass * createNVPTXProxyRegErasurePass()
This class represents lattice values for constants.
Definition: AllocatorList.h:24
ModulePass * createNVPTXAssignValidGlobalNamesPass()
SimpleMove
Definition: NVPTX.h:87
MachineFunctionPass * createNVPTXPrologEpilogPass()
ModulePass * createGenericToNVVMPass()
FunctionPass * createNVVMReflectPass(unsigned int SmVersion)
Definition: NVVMReflect.cpp:63
DrvInterface
Definition: NVPTX.h:62
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Target & getTheNVPTXTarget64()
FunctionPass * createNVPTXImageOptimizerPass()
Target & getTheNVPTXTarget32()
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:285
VecInstType
Definition: NVPTX.h:72
BasicBlockPass class - This class is used to implement most local optimizations.
Definition: Pass.h:319
BasicBlockPass * createNVPTXLowerAllocaPass()
Module.h This file contains the declarations for the Module class.
Target - Wrapper for Target specific information.
NVPTXTargetMachine.
MachineFunctionPass * createNVPTXPeephole()
FunctionPass * createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel)
createNVPTXISelDag - This pass converts a legalized DAG into a NVPTX-specific DAG, ready for instruction scheduling.
FunctionPass * createNVVMIntrRangePass(unsigned int SmVersion)
FunctionPass * createNVPTXLowerArgsPass(const NVPTXTargetMachine *TM)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:225