clang 8.0.0

TargetBuiltins.h
Go to the documentation of this file.
1 //===--- TargetBuiltins.h - Target specific builtin IDs ---------*- 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 /// \file
11 /// Enumerates target-specific builtins in their own namespaces within
12 /// namespace ::clang.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CLANG_BASIC_TARGETBUILTINS_H
17 #define LLVM_CLANG_BASIC_TARGETBUILTINS_H
18
19 #include <stdint.h>
20 #include "clang/Basic/Builtins.h"
21 #undef PPC
22
23 namespace clang {
24
25 namespace NEON {
26 enum {
27 LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
28 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
29 #include "clang/Basic/BuiltinsNEON.def"
30 FirstTSBuiltin
31 };
32 }
33
34 /// ARM builtins
35 namespace ARM {
36 enum {
37 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
38 LastNEONBuiltin = NEON::FirstTSBuiltin - 1,
39 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
40 #include "clang/Basic/BuiltinsARM.def"
41 LastTSBuiltin
42 };
43 }
44
45 /// AArch64 builtins
46 namespace AArch64 {
47 enum {
48 LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
49 LastNEONBuiltin = NEON::FirstTSBuiltin - 1,
50 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
51 #include "clang/Basic/BuiltinsAArch64.def"
52 LastTSBuiltin
53 };
54 }
55
56 /// PPC builtins
57 namespace PPC {
58 enum {
59 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
60 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
61 #include "clang/Basic/BuiltinsPPC.def"
62 LastTSBuiltin
63 };
64 }
65
66 /// NVPTX builtins
67 namespace NVPTX {
68 enum {
69 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
70 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
71 #include "clang/Basic/BuiltinsNVPTX.def"
72 LastTSBuiltin
73 };
74 }
75
76 /// AMDGPU builtins
77 namespace AMDGPU {
78 enum {
79 LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
80 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
81 #include "clang/Basic/BuiltinsAMDGPU.def"
82 LastTSBuiltin
83 };
84 }
85
86 /// X86 builtins
87 namespace X86 {
88 enum {
89 LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
90 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
91 #include "clang/Basic/BuiltinsX86.def"
92 FirstX86_64Builtin,
93 LastX86CommonBuiltin = FirstX86_64Builtin - 1,
94 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
95 #include "clang/Basic/BuiltinsX86_64.def"
96 LastTSBuiltin
97 };
98 }
99
100 /// Flags to identify the types for overloaded Neon builtins.
101 ///
102 /// These must be kept in sync with the flags in utils/TableGen/NeonEmitter.h.
103 class NeonTypeFlags {
104 enum {
105 EltTypeMask = 0xf,
106 UnsignedFlag = 0x10,
107 QuadFlag = 0x20
108 };
109 uint32_t Flags;
110
111 public:
112 enum EltType {
113 Int8,
114 Int16,
115 Int32,
116 Int64,
117 Poly8,
118 Poly16,
119 Poly64,
120 Poly128,
121 Float16,
122 Float32,
123 Float64
124 };
125
126 NeonTypeFlags(unsigned F) : Flags(F) {}
127 NeonTypeFlags(EltType ET, bool IsUnsigned, bool IsQuad) : Flags(ET) {
128 if (IsUnsigned)
129 Flags |= UnsignedFlag;
130 if (IsQuad)
131 Flags |= QuadFlag;
132 }
133
134 EltType getEltType() const { return (EltType)(Flags & EltTypeMask); }
135 bool isPoly() const {
136 EltType ET = getEltType();
137 return ET == Poly8 || ET == Poly16;
138 }
139 bool isUnsigned() const { return (Flags & UnsignedFlag) != 0; }
140 bool isQuad() const { return (Flags & QuadFlag) != 0; }
141 };
142
143 /// Hexagon builtins
144 namespace Hexagon {
145 enum {
146 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
147 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
148 #include "clang/Basic/BuiltinsHexagon.def"
149 LastTSBuiltin
150 };
151 }
152
153 /// MIPS builtins
154 namespace Mips {
155 enum {
156 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
157 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
158 #include "clang/Basic/BuiltinsMips.def"
159 LastTSBuiltin
160 };
161 }
162
163 /// XCore builtins
164 namespace XCore {
165 enum {
166 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
167 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
168 #include "clang/Basic/BuiltinsXCore.def"
169 LastTSBuiltin
170 };
171 }
172
173 /// Le64 builtins
174 namespace Le64 {
175 enum {
176 LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
177 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
178 #include "clang/Basic/BuiltinsLe64.def"
179 LastTSBuiltin
180 };
181 }
182
183 /// SystemZ builtins
184 namespace SystemZ {
185 enum {
186 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
187 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
188 #include "clang/Basic/BuiltinsSystemZ.def"
189 LastTSBuiltin
190 };
191 }
192
193 /// WebAssembly builtins
194 namespace WebAssembly {
195 enum {
196 LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1,
197 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
198 #include "clang/Basic/BuiltinsWebAssembly.def"
199 LastTSBuiltin
200 };
201 }
202
203 } // end namespace clang.
204
205 #endif
clang::NeonTypeFlags::Poly128
Definition: TargetBuiltins.h:120
clang::NEON::FirstTSBuiltin
Definition: TargetBuiltins.h:30
clang::NeonTypeFlags::Int64
Definition: TargetBuiltins.h:116
clang::NEON::LastTIBuiltin
Definition: TargetBuiltins.h:27
clang::NeonTypeFlags::EltType
EltType
Definition: TargetBuiltins.h:112
clang::WebAssembly::LastTSBuiltin
Definition: TargetBuiltins.h:199
clang::AArch64::LastNEONBuiltin
Definition: TargetBuiltins.h:49
clang::NeonTypeFlags::Poly8
Definition: TargetBuiltins.h:117
clang::NeonTypeFlags::isUnsigned
bool isUnsigned() const
Definition: TargetBuiltins.h:139
clang::NeonTypeFlags::Int16
Definition: TargetBuiltins.h:114
clang::NeonTypeFlags::Poly64
Definition: TargetBuiltins.h:119
clang::NeonTypeFlags::Float16
Definition: TargetBuiltins.h:121
clang::X86::LastX86CommonBuiltin
Definition: TargetBuiltins.h:93
clang::NeonTypeFlags::getEltType
EltType getEltType() const
Definition: TargetBuiltins.h:134
clang::NeonTypeFlags::isPoly
bool isPoly() const
Definition: TargetBuiltins.h:135
clang::NeonTypeFlags::Poly16
Definition: TargetBuiltins.h:118
stdint.h
clang::NeonTypeFlags::NeonTypeFlags
NeonTypeFlags(EltType ET, bool IsUnsigned, bool IsQuad)
Definition: TargetBuiltins.h:127
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::X86::FirstX86_64Builtin
Definition: TargetBuiltins.h:92
clang::NeonTypeFlags::NeonTypeFlags
NeonTypeFlags(unsigned F)
Definition: TargetBuiltins.h:126
clang::NeonTypeFlags
Flags to identify the types for overloaded Neon builtins.
Definition: TargetBuiltins.h:103
clang::NeonTypeFlags::Int8
Definition: TargetBuiltins.h:113
clang::NeonTypeFlags::Float32
Definition: TargetBuiltins.h:122
clang::Builtin::FirstTSBuiltin
Definition: Builtins.h:53
clang::NeonTypeFlags::isQuad
bool isQuad() const
Definition: TargetBuiltins.h:140
clang::NeonTypeFlags::Int32
Definition: TargetBuiltins.h:115
Builtins.h
Defines enum values for all the target-independent builtin functions.