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 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the entry points for global functions defined in
10 // the LLVM NVPTX back-end.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTX_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTX_H
16 
17 #include "llvm/Pass.h"
18 #include "llvm/Support/CodeGen.h"
19 
20 namespace llvm {
21 class NVPTXTargetMachine;
22 class FunctionPass;
23 class MachineFunctionPass;
24 class formatted_raw_ostream;
25 
26 namespace NVPTXCC {
27 enum CondCodes {
28  EQ,
29  NE,
30  LT,
31  LE,
32  GT,
34 };
35 }
36 
38  llvm::CodeGenOpt::Level OptLevel);
41 FunctionPass *createNVVMIntrRangePass(unsigned int SmVersion);
42 FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
50 
51 namespace NVPTX {
55 };
56 
57 // A field inside TSFlags needs a shift and a mask. The usage is
58 // always as follows :
59 // ((TSFlags & fieldMask) >> fieldShift)
60 // The enum keeps the mask, the shift, and all valid values of the
61 // field in one place.
65 
66  VecNOP = 0,
67  VecLoad = 1,
68  VecStore = 2,
69  VecBuild = 3,
72  VecInsert = 6,
73  VecDest = 7,
74  VecOther = 15
75 };
76 
77 enum SimpleMove {
80 };
81 enum LoadStore {
82  isLoadMask = 0x20,
84  isStoreMask = 0x40,
86 };
87 
88 namespace PTXLdStInstCode {
90  GENERIC = 0,
91  GLOBAL = 1,
92  CONSTANT = 2,
93  SHARED = 3,
94  PARAM = 4,
95  LOCAL = 5
96 };
97 enum FromType {
98  Unsigned = 0,
102 };
103 enum VecType {
104  Scalar = 1,
105  V2 = 2,
106  V4 = 4
107 };
108 }
109 
110 /// PTXCvtMode - Conversion code enumeration
111 namespace PTXCvtMode {
112 enum CvtMode {
113  NONE = 0,
118  RN,
119  RZ,
120  RM,
121  RP,
122 
123  BASE_MASK = 0x0F,
124  FTZ_FLAG = 0x10,
125  SAT_FLAG = 0x20
126 };
127 }
128 
129 /// PTXCmpMode - Comparison mode enumeration
130 namespace PTXCmpMode {
131 enum CmpMode {
132  EQ = 0,
133  NE,
134  LT,
135  LE,
136  GT,
137  GE,
138  LO,
139  LS,
140  HI,
141  HS,
149  // NAN is a MACRO
151 
152  BASE_MASK = 0xFF,
153  FTZ_FLAG = 0x100
154 };
155 }
156 }
157 } // end namespace llvm;
158 
159 // Defines symbolic names for NVPTX registers. This defines a mapping from
160 // register name to register number.
161 #define GET_REGINFO_ENUM
162 #include "NVPTXGenRegisterInfo.inc"
163 
164 // Defines symbolic names for the NVPTX instructions.
165 #define GET_INSTRINFO_ENUM
166 #include "NVPTXGenInstrInfo.inc"
167 
168 #endif
MachineFunctionPass * createNVPTXProxyRegErasurePass()
This class represents lattice values for constants.
Definition: AllocatorList.h:23
ModulePass * createNVPTXAssignValidGlobalNamesPass()
SimpleMove
Definition: NVPTX.h:77
MachineFunctionPass * createNVPTXPrologEpilogPass()
ModulePass * createGenericToNVVMPass()
FunctionPass * createNVVMReflectPass(unsigned int SmVersion)
Definition: NVVMReflect.cpp:62
DrvInterface
Definition: NVPTX.h:52
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
FunctionPass * createNVPTXImageOptimizerPass()
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:284
VecInstType
Definition: NVPTX.h:62
BasicBlockPass class - This class is used to implement most local optimizations.
Definition: Pass.h:318
BasicBlockPass * createNVPTXLowerAllocaPass()
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:224