clang  15.0.0git
RISCVVIntrinsicUtils.h
Go to the documentation of this file.
1 //===--- RISCVVIntrinsicUtils.h - RISC-V Vector Intrinsic Utils -*- 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 #ifndef CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
10 #define CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/BitmaskEnum.h"
14 #include "llvm/ADT/Optional.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringRef.h"
17 #include <cstdint>
18 #include <string>
19 #include <vector>
20 
21 namespace clang {
22 namespace RISCV {
23 
25 
26 // Modifier for vector type.
27 enum class VectorTypeModifier : uint8_t {
28  NoModifier,
32  MaskVector,
33  Log2EEW3,
34  Log2EEW4,
35  Log2EEW5,
36  Log2EEW6,
37  FixedSEW8,
38  FixedSEW16,
39  FixedSEW32,
40  FixedSEW64,
55 };
56 
57 // Similar to basic type but used to describe what's kind of type related to
58 // basic vector type, used to compute type info of arguments.
59 enum class BaseTypeModifier : uint8_t {
60  Invalid,
61  Scalar,
62  Vector,
63  Void,
64  SizeT,
65  Ptrdiff,
67  SignedLong,
68 };
69 
70 // Modifier for type, used for both scalar and vector types.
71 enum class TypeModifier : uint8_t {
72  NoModifier = 0,
73  Pointer = 1 << 0,
74  Const = 1 << 1,
75  Immediate = 1 << 2,
76  UnsignedInteger = 1 << 3,
77  SignedInteger = 1 << 4,
78  Float = 1 << 5,
79  // LMUL1 should be kind of VectorTypeModifier, but that might come with
80  // Widening2XVector for widening reduction.
81  // However that might require VectorTypeModifier become bitmask rather than
82  // simple enum, so we decide keek LMUL1 in TypeModifier for code size
83  // optimization of clang binary size.
84  LMUL1 = 1 << 6,
85  MaxOffset = 6,
87 };
88 
89 // PrototypeDescriptor is used to compute type info of arguments or return
90 // value.
92  constexpr PrototypeDescriptor() = default;
97  : PT(static_cast<uint8_t>(PT)), VTM(static_cast<uint8_t>(VTM)),
98  TM(static_cast<uint8_t>(TM)) {}
99  constexpr PrototypeDescriptor(uint8_t PT, uint8_t VTM, uint8_t TM)
100  : PT(PT), VTM(VTM), TM(TM) {}
101 
102  uint8_t PT = static_cast<uint8_t>(BaseTypeModifier::Invalid);
103  uint8_t VTM = static_cast<uint8_t>(VectorTypeModifier::NoModifier);
104  uint8_t TM = static_cast<uint8_t>(TypeModifier::NoModifier);
105 
106  bool operator!=(const PrototypeDescriptor &PD) const {
107  return PD.PT != PT || PD.VTM != VTM || PD.TM != TM;
108  }
109  bool operator>(const PrototypeDescriptor &PD) const {
110  return !(PD.PT <= PT && PD.VTM <= VTM && PD.TM <= TM);
111  }
112 
113  static const PrototypeDescriptor Mask;
115  static const PrototypeDescriptor VL;
117  parsePrototypeDescriptor(llvm::StringRef PrototypeStr);
118 };
119 
121 parsePrototypes(llvm::StringRef Prototypes);
122 
123 // Basic type of vector type.
124 enum class BasicType : uint8_t {
125  Unknown = 0,
126  Int8 = 1 << 0,
127  Int16 = 1 << 1,
128  Int32 = 1 << 2,
129  Int64 = 1 << 3,
130  Float16 = 1 << 4,
131  Float32 = 1 << 5,
132  Float64 = 1 << 6,
133  MaxOffset = 6,
135 };
136 
137 // Type of vector type.
138 enum ScalarTypeKind : uint8_t {
149 };
150 
151 // Exponential LMUL
152 struct LMULType {
153  int Log2LMUL;
154  LMULType(int Log2LMUL);
155  // Return the C/C++ string representation of LMUL
156  std::string str() const;
157  llvm::Optional<unsigned> getScale(unsigned ElementBitwidth) const;
158  void MulLog2LMUL(int Log2LMUL);
159 };
160 
161 class RVVType;
162 using RVVTypePtr = RVVType *;
163 using RVVTypes = std::vector<RVVTypePtr>;
164 
165 // This class is compact representation of a valid and invalid RVVType.
166 class RVVType {
167  BasicType BT;
168  ScalarTypeKind ScalarType = Invalid;
169  LMULType LMUL;
170  bool IsPointer = false;
171  // IsConstant indices are "int", but have the constant expression.
172  bool IsImmediate = false;
173  // Const qualifier for pointer to const object or object of const type.
174  bool IsConstant = false;
175  unsigned ElementBitwidth = 0;
176  VScaleVal Scale = 0;
177  bool Valid;
178 
179  std::string BuiltinStr;
180  std::string ClangBuiltinStr;
181  std::string Str;
182  std::string ShortStr;
183 
184  enum class FixedLMULType { LargerThan, SmallerThan };
185 
186 public:
187  RVVType() : BT(BasicType::Unknown), LMUL(0), Valid(false) {}
188  RVVType(BasicType BT, int Log2LMUL, const PrototypeDescriptor &Profile);
189 
190  // Return the string representation of a type, which is an encoded string for
191  // passing to the BUILTIN() macro in Builtins.def.
192  const std::string &getBuiltinStr() const { return BuiltinStr; }
193 
194  // Return the clang builtin type for RVV vector type which are used in the
195  // riscv_vector.h header file.
196  const std::string &getClangBuiltinStr() const { return ClangBuiltinStr; }
197 
198  // Return the C/C++ string representation of a type for use in the
199  // riscv_vector.h header file.
200  const std::string &getTypeStr() const { return Str; }
201 
202  // Return the short name of a type for C/C++ name suffix.
204  // Not all types are used in short name, so compute the short name by
205  // demanded.
206  if (ShortStr.empty())
207  initShortStr();
208  return ShortStr;
209  }
210 
211  bool isValid() const { return Valid; }
212  bool isScalar() const { return Scale && Scale.getValue() == 0; }
213  bool isVector() const { return Scale && Scale.getValue() != 0; }
214  bool isVector(unsigned Width) const {
215  return isVector() && ElementBitwidth == Width;
216  }
217  bool isFloat() const { return ScalarType == ScalarTypeKind::Float; }
218  bool isSignedInteger() const {
219  return ScalarType == ScalarTypeKind::SignedInteger;
220  }
221  bool isFloatVector(unsigned Width) const {
222  return isVector() && isFloat() && ElementBitwidth == Width;
223  }
224  bool isFloat(unsigned Width) const {
225  return isFloat() && ElementBitwidth == Width;
226  }
227 
228  bool isPointer() const { return IsPointer; }
229 
230 private:
231  // Verify RVV vector type and set Valid.
232  bool verifyType() const;
233 
234  // Creates a type based on basic types of TypeRange
235  void applyBasicType();
236 
237  // Applies a prototype modifier to the current type. The result maybe an
238  // invalid type.
239  void applyModifier(const PrototypeDescriptor &prototype);
240 
241  void applyLog2EEW(unsigned Log2EEW);
242  void applyFixedSEW(unsigned NewSEW);
243  void applyFixedLog2LMUL(int Log2LMUL, enum FixedLMULType Type);
244 
245  // Compute and record a string for legal type.
246  void initBuiltinStr();
247  // Compute and record a builtin RVV vector type string.
248  void initClangBuiltinStr();
249  // Compute and record a type string for used in the header.
250  void initTypeStr();
251  // Compute and record a short name of a type for C/C++ name suffix.
252  void initShortStr();
253 
254 public:
255  /// Compute output and input types by applying different config (basic type
256  /// and LMUL with type transformers). It also record result of type in legal
257  /// or illegal set to avoid compute the same config again. The result maybe
258  /// have illegal RVVType.
260  computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
262  static llvm::Optional<RVVTypePtr> computeType(BasicType BT, int Log2LMUL,
263  PrototypeDescriptor Proto);
264 };
265 
266 using RISCVPredefinedMacroT = uint8_t;
267 
269  Basic = 0,
270  V = 1 << 1,
271  Zvfh = 1 << 2,
272  RV64 = 1 << 3,
273  VectorMaxELen64 = 1 << 4,
276 };
277 
278 enum PolicyScheme : uint8_t {
282 };
283 
284 // TODO refactor RVVIntrinsic class design after support all intrinsic
285 // combination. This represents an instantiation of an intrinsic with a
286 // particular type and prototype
288 
289 private:
290  std::string BuiltinName; // Builtin name
291  std::string Name; // C intrinsic name.
292  std::string OverloadedName;
293  std::string IRName;
294  bool IsMasked;
295  bool HasVL;
296  PolicyScheme Scheme;
297  bool HasUnMaskedOverloaded;
298  bool HasBuiltinAlias;
299  std::string ManualCodegen;
300  RVVTypePtr OutputType; // Builtin output type
301  RVVTypes InputTypes; // Builtin input types
302  // The types we use to obtain the specific LLVM intrinsic. They are index of
303  // InputTypes. -1 means the return type.
304  std::vector<int64_t> IntrinsicTypes;
305  RISCVPredefinedMacroT RISCVPredefinedMacros = 0;
306  unsigned NF = 1;
307 
308 public:
309  RVVIntrinsic(llvm::StringRef Name, llvm::StringRef Suffix,
310  llvm::StringRef OverloadedName, llvm::StringRef OverloadedSuffix,
311  llvm::StringRef IRName, bool IsMasked, bool HasMaskedOffOperand,
312  bool HasVL, PolicyScheme Scheme, bool HasUnMaskedOverloaded,
313  bool HasBuiltinAlias, llvm::StringRef ManualCodegen,
314  const RVVTypes &Types,
315  const std::vector<int64_t> &IntrinsicTypes,
316  const std::vector<llvm::StringRef> &RequiredFeatures,
317  unsigned NF);
318  ~RVVIntrinsic() = default;
319 
320  RVVTypePtr getOutputType() const { return OutputType; }
321  const RVVTypes &getInputTypes() const { return InputTypes; }
322  llvm::StringRef getBuiltinName() const { return BuiltinName; }
323  llvm::StringRef getName() const { return Name; }
324  llvm::StringRef getOverloadedName() const { return OverloadedName; }
325  bool hasVL() const { return HasVL; }
326  bool hasPolicy() const { return Scheme != SchemeNone; }
327  bool hasPassthruOperand() const { return Scheme == HasPassthruOperand; }
328  bool hasPolicyOperand() const { return Scheme == HasPolicyOperand; }
329  bool hasUnMaskedOverloaded() const { return HasUnMaskedOverloaded; }
330  bool hasBuiltinAlias() const { return HasBuiltinAlias; }
331  bool hasManualCodegen() const { return !ManualCodegen.empty(); }
332  bool isMasked() const { return IsMasked; }
333  llvm::StringRef getIRName() const { return IRName; }
334  llvm::StringRef getManualCodegen() const { return ManualCodegen; }
335  PolicyScheme getPolicyScheme() const { return Scheme; }
337  return RISCVPredefinedMacros;
338  }
339  unsigned getNF() const { return NF; }
340  const std::vector<int64_t> &getIntrinsicTypes() const {
341  return IntrinsicTypes;
342  }
343 
344  // Return the type string for a BUILTIN() macro in Builtins.def.
346 
347  static std::string
348  getSuffixStr(BasicType Type, int Log2LMUL,
349  llvm::ArrayRef<PrototypeDescriptor> PrototypeDescriptors);
350 };
351 
352 } // end namespace RISCV
353 
354 } // end namespace clang
355 
356 #endif // CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
clang::RISCV::TypeModifier::NoModifier
@ NoModifier
clang::RISCV::VectorMaxELenFp64
@ VectorMaxELenFp64
Definition: RISCVVIntrinsicUtils.h:275
clang::RISCV::VectorTypeModifier::SFixedLog2LMUL2
@ SFixedLog2LMUL2
clang::RISCV::PrototypeDescriptor
Definition: RISCVVIntrinsicUtils.h:91
clang::RISCV::RISCVPredefinedMacro
RISCVPredefinedMacro
Definition: RISCVVIntrinsicUtils.h:268
clang::RISCV::Size_t
@ Size_t
Definition: RISCVVIntrinsicUtils.h:140
clang::RISCV::RVVIntrinsic::hasBuiltinAlias
bool hasBuiltinAlias() const
Definition: RISCVVIntrinsicUtils.h:330
clang::RISCV::TypeModifier::LMUL1
@ LMUL1
clang::RISCV::RVVIntrinsic::isMasked
bool isMasked() const
Definition: RISCVVIntrinsicUtils.h:332
clang::RISCV::LMULType::str
std::string str() const
Definition: RISCVVIntrinsicUtils.cpp:44
clang::RISCV::LMULType
Definition: RISCVVIntrinsicUtils.h:152
clang::RISCV::RVVType::getBuiltinStr
const std::string & getBuiltinStr() const
Definition: RISCVVIntrinsicUtils.h:192
clang::RISCV::RVVIntrinsic::~RVVIntrinsic
~RVVIntrinsic()=default
clang::RISCV::RVVType::computeType
static llvm::Optional< RVVTypePtr > computeType(BasicType BT, int Log2LMUL, PrototypeDescriptor Proto)
Definition: RISCVVIntrinsicUtils.cpp:819
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::RISCV::VectorTypeModifier::FixedSEW64
@ FixedSEW64
clang::RISCV::RVVType::isPointer
bool isPointer() const
Definition: RISCVVIntrinsicUtils.h:228
clang::RISCV::VectorTypeModifier::SFixedLog2LMULN3
@ SFixedLog2LMULN3
clang::RISCV::VectorMaxELen64
@ VectorMaxELen64
Definition: RISCVVIntrinsicUtils.h:273
clang::RISCV::TypeModifier::Immediate
@ Immediate
clang::RISCV::Boolean
@ Boolean
Definition: RISCVVIntrinsicUtils.h:144
clang::RISCV::SignedLong
@ SignedLong
Definition: RISCVVIntrinsicUtils.h:143
llvm::SmallVector
Definition: LLVM.h:38
clang::RISCV::VectorTypeModifier::LFixedLog2LMUL1
@ LFixedLog2LMUL1
clang::RISCV::UnsignedLong
@ UnsignedLong
clang::RISCV::HasPassthruOperand
@ HasPassthruOperand
Definition: RISCVVIntrinsicUtils.h:280
clang::RISCV::PrototypeDescriptor::VL
static const PrototypeDescriptor VL
Definition: RISCVVIntrinsicUtils.h:115
clang::RISCV::BasicType::Float16
@ Float16
clang::RISCV::RVVIntrinsic::RVVIntrinsic
RVVIntrinsic(llvm::StringRef Name, llvm::StringRef Suffix, llvm::StringRef OverloadedName, llvm::StringRef OverloadedSuffix, llvm::StringRef IRName, bool IsMasked, bool HasMaskedOffOperand, bool HasVL, PolicyScheme Scheme, bool HasUnMaskedOverloaded, bool HasBuiltinAlias, llvm::StringRef ManualCodegen, const RVVTypes &Types, const std::vector< int64_t > &IntrinsicTypes, const std::vector< llvm::StringRef > &RequiredFeatures, unsigned NF)
Definition: RISCVVIntrinsicUtils.cpp:848
clang::RISCV::BasicType::Unknown
@ Unknown
clang::RISCV::BaseTypeModifier::Ptrdiff
@ Ptrdiff
clang::RISCV::PrototypeDescriptor::Vector
static const PrototypeDescriptor Vector
Definition: RISCVVIntrinsicUtils.h:114
clang::RISCV::PolicyScheme
PolicyScheme
Definition: RISCVVIntrinsicUtils.h:278
clang::RISCV::SignedInteger
@ SignedInteger
Definition: RISCVVIntrinsicUtils.h:145
clang::RISCV::RVVIntrinsic::hasVL
bool hasVL() const
Definition: RISCVVIntrinsicUtils.h:325
clang::RISCV::VectorTypeModifier::SFixedLog2LMULN1
@ SFixedLog2LMULN1
clang::RISCV::ScalarTypeKind
ScalarTypeKind
Definition: RISCVVIntrinsicUtils.h:138
llvm::Optional< unsigned >
clang::RISCV::RVVType::isFloat
bool isFloat(unsigned Width) const
Definition: RISCVVIntrinsicUtils.h:224
clang::RISCV::VectorTypeModifier::LFixedLog2LMULN1
@ LFixedLog2LMULN1
clang::RISCV::RVVIntrinsic::getBuiltinTypeStr
std::string getBuiltinTypeStr() const
Definition: RISCVVIntrinsicUtils.cpp:913
clang::RISCV::RVVType::isScalar
bool isScalar() const
Definition: RISCVVIntrinsicUtils.h:212
clang::RISCV::VectorTypeModifier::LFixedLog2LMULN2
@ LFixedLog2LMULN2
clang::RISCV::BasicType::Float32
@ Float32
clang::RISCV::PrototypeDescriptor::operator!=
bool operator!=(const PrototypeDescriptor &PD) const
Definition: RISCVVIntrinsicUtils.h:106
clang::RISCV::VectorTypeModifier::LFixedLog2LMUL2
@ LFixedLog2LMUL2
clang::RISCV::V
@ V
Definition: RISCVVIntrinsicUtils.h:270
clang::RISCV::PrototypeDescriptor::PrototypeDescriptor
constexpr PrototypeDescriptor(BaseTypeModifier PT, VectorTypeModifier VTM=VectorTypeModifier::NoModifier, TypeModifier TM=TypeModifier::NoModifier)
Definition: RISCVVIntrinsicUtils.h:93
clang::RISCV::RVVType::getShortStr
const std::string & getShortStr()
Definition: RISCVVIntrinsicUtils.h:203
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1556
clang::RISCV::VectorTypeModifier::Widening8XVector
@ Widening8XVector
clang::RISCV::RVVIntrinsic::getManualCodegen
llvm::StringRef getManualCodegen() const
Definition: RISCVVIntrinsicUtils.h:334
clang::RISCV::VectorMaxELenFp32
@ VectorMaxELenFp32
Definition: RISCVVIntrinsicUtils.h:274
clang::RISCV::TypeModifier::Const
@ Const
clang::RISCV::BaseTypeModifier::SizeT
@ SizeT
clang::RISCV::VectorTypeModifier::FixedSEW8
@ FixedSEW8
clang::RISCV::RVVType::computeTypes
static llvm::Optional< RVVTypes > computeTypes(BasicType BT, int Log2LMUL, unsigned NF, llvm::ArrayRef< PrototypeDescriptor > Prototype)
Compute output and input types by applying different config (basic type and LMUL with type transforme...
Definition: RISCVVIntrinsicUtils.cpp:789
clang::RISCV::UnsignedLong
@ UnsignedLong
Definition: RISCVVIntrinsicUtils.h:142
clang::RISCV::LMULType::MulLog2LMUL
void MulLog2LMUL(int Log2LMUL)
Definition: RISCVVIntrinsicUtils.cpp:74
clang::RISCV::RVVType::getClangBuiltinStr
const std::string & getClangBuiltinStr() const
Definition: RISCVVIntrinsicUtils.h:196
clang::RISCV::VectorTypeModifier::Widening2XVector
@ Widening2XVector
clang::RISCV::VectorTypeModifier::Log2EEW4
@ Log2EEW4
clang::RISCV::PrototypeDescriptor::operator>
bool operator>(const PrototypeDescriptor &PD) const
Definition: RISCVVIntrinsicUtils.h:109
clang::RISCV::Invalid
@ Invalid
clang::RISCV::Ptrdiff_t
@ Ptrdiff_t
Definition: RISCVVIntrinsicUtils.h:141
clang::RISCV::VectorTypeModifier::SFixedLog2LMUL3
@ SFixedLog2LMUL3
clang::RISCV::HasPolicyOperand
@ HasPolicyOperand
Definition: RISCVVIntrinsicUtils.h:281
clang::RISCV::Void
@ Void
Definition: RISCVVIntrinsicUtils.h:139
clang::RISCV::RVVIntrinsic::getNF
unsigned getNF() const
Definition: RISCVVIntrinsicUtils.h:339
clang::RISCV::VectorTypeModifier::SFixedLog2LMULN2
@ SFixedLog2LMULN2
clang::RISCV::VectorTypeModifier::Log2EEW6
@ Log2EEW6
clang::RISCV::PrototypeDescriptor::PT
uint8_t PT
Definition: RISCVVIntrinsicUtils.h:102
clang::RISCV::RVVIntrinsic::getRISCVPredefinedMacros
RISCVPredefinedMacroT getRISCVPredefinedMacros() const
Definition: RISCVVIntrinsicUtils.h:336
clang::RISCV::SchemeNone
@ SchemeNone
Definition: RISCVVIntrinsicUtils.h:279
clang::RISCV::LMULType::LMULType
LMULType(int Log2LMUL)
Definition: RISCVVIntrinsicUtils.cpp:38
clang::RISCV::RVVType
Definition: RISCVVIntrinsicUtils.h:166
clang::RISCV::RVVIntrinsic::getSuffixStr
static std::string getSuffixStr(BasicType Type, int Log2LMUL, llvm::ArrayRef< PrototypeDescriptor > PrototypeDescriptors)
Definition: RISCVVIntrinsicUtils.cpp:922
clang::RISCV::BaseTypeModifier
BaseTypeModifier
Definition: RISCVVIntrinsicUtils.h:59
clang::RISCV::RVVType::isFloat
bool isFloat() const
Definition: RISCVVIntrinsicUtils.h:217
clang::RISCV::BasicType::Int8
@ Int8
clang::RISCV::TypeModifier
TypeModifier
Definition: RISCVVIntrinsicUtils.h:71
clang::RISCV::Zvfh
@ Zvfh
Definition: RISCVVIntrinsicUtils.h:271
clang::RISCV::PrototypeDescriptor::parsePrototypeDescriptor
static llvm::Optional< PrototypeDescriptor > parsePrototypeDescriptor(llvm::StringRef PrototypeStr)
Definition: RISCVVIntrinsicUtils.cpp:367
clang::RISCV::BaseTypeModifier::Scalar
@ Scalar
clang::RISCV::RVVIntrinsic::hasPolicy
bool hasPolicy() const
Definition: RISCVVIntrinsicUtils.h:326
clang::RISCV::PrototypeDescriptor::Mask
static const PrototypeDescriptor Mask
Definition: RISCVVIntrinsicUtils.h:113
clang::RISCV::BaseTypeModifier::Vector
@ Vector
clang::RISCV::PrototypeDescriptor::PrototypeDescriptor
constexpr PrototypeDescriptor()=default
clang::RISCV::SignedLong
@ SignedLong
clang::RISCV::RVVIntrinsic::getInputTypes
const RVVTypes & getInputTypes() const
Definition: RISCVVIntrinsicUtils.h:321
clang::RISCV::PrototypeDescriptor::PrototypeDescriptor
constexpr PrototypeDescriptor(uint8_t PT, uint8_t VTM, uint8_t TM)
Definition: RISCVVIntrinsicUtils.h:99
clang::RISCV::RVVType::isVector
bool isVector(unsigned Width) const
Definition: RISCVVIntrinsicUtils.h:214
clang::RISCV::PrototypeDescriptor::VTM
uint8_t VTM
Definition: RISCVVIntrinsicUtils.h:103
clang::RISCV::BasicType::LLVM_MARK_AS_BITMASK_ENUM
@ LLVM_MARK_AS_BITMASK_ENUM
clang::RISCV::RV64
@ RV64
Definition: RISCVVIntrinsicUtils.h:272
clang::RISCV::VectorTypeModifier::NoModifier
@ NoModifier
false
#define false
Definition: stdbool.h:22
clang::RISCV::VectorTypeModifier::Widening4XVector
@ Widening4XVector
clang::RISCV::RVVTypes
std::vector< RVVTypePtr > RVVTypes
Definition: RISCVVIntrinsicUtils.h:163
clang::RISCV::RVVType::RVVType
RVVType()
Definition: RISCVVIntrinsicUtils.h:187
clang::RISCV::RVVType::isSignedInteger
bool isSignedInteger() const
Definition: RISCVVIntrinsicUtils.h:218
llvm::ArrayRef
Definition: LLVM.h:34
clang::RISCV::TypeModifier::LLVM_MARK_AS_BITMASK_ENUM
@ LLVM_MARK_AS_BITMASK_ENUM
clang::RISCV::Float
@ Float
Definition: RISCVVIntrinsicUtils.h:147
clang::RISCV::RVVIntrinsic::getOverloadedName
llvm::StringRef getOverloadedName() const
Definition: RISCVVIntrinsicUtils.h:324
clang::RISCV::BasicType::Int16
@ Int16
clang::RISCV::VectorTypeModifier::SFixedLog2LMUL0
@ SFixedLog2LMUL0
clang::RISCV::RVVIntrinsic::hasUnMaskedOverloaded
bool hasUnMaskedOverloaded() const
Definition: RISCVVIntrinsicUtils.h:329
clang::RISCV::RVVIntrinsic::getName
llvm::StringRef getName() const
Definition: RISCVVIntrinsicUtils.h:323
clang::RISCV::UnsignedInteger
@ UnsignedInteger
Definition: RISCVVIntrinsicUtils.h:146
clang::RISCV::RVVIntrinsic::hasPolicyOperand
bool hasPolicyOperand() const
Definition: RISCVVIntrinsicUtils.h:328
clang::RISCV::VectorTypeModifier::LFixedLog2LMULN3
@ LFixedLog2LMULN3
clang::RISCV::RVVType::isValid
bool isValid() const
Definition: RISCVVIntrinsicUtils.h:211
clang::RISCV::VectorTypeModifier::LFixedLog2LMUL0
@ LFixedLog2LMUL0
clang::RISCV::BasicType::MaxOffset
@ MaxOffset
clang::RISCV::VectorTypeModifier::Log2EEW3
@ Log2EEW3
clang::RISCV::BasicType::Float64
@ Float64
clang::RISCV::RVVType::isVector
bool isVector() const
Definition: RISCVVIntrinsicUtils.h:213
clang::RISCV::VectorTypeModifier::SFixedLog2LMUL1
@ SFixedLog2LMUL1
clang
Definition: CalledOnceCheck.h:17
clang::RISCV::VectorTypeModifier::LFixedLog2LMUL3
@ LFixedLog2LMUL3
clang::RISCV::VectorTypeModifier::Log2EEW5
@ Log2EEW5
clang::RISCV::BasicType::Int64
@ Int64
clang::RISCV::RVVIntrinsic::getIRName
llvm::StringRef getIRName() const
Definition: RISCVVIntrinsicUtils.h:333
clang::RISCV::RVVType::isFloatVector
bool isFloatVector(unsigned Width) const
Definition: RISCVVIntrinsicUtils.h:221
clang::RISCV::RVVIntrinsic::getBuiltinName
llvm::StringRef getBuiltinName() const
Definition: RISCVVIntrinsicUtils.h:322
clang::RISCV::RVVType::getTypeStr
const std::string & getTypeStr() const
Definition: RISCVVIntrinsicUtils.h:200
clang::RISCV::RVVIntrinsic::getPolicyScheme
PolicyScheme getPolicyScheme() const
Definition: RISCVVIntrinsicUtils.h:335
clang::RISCV::Basic
@ Basic
Definition: RISCVVIntrinsicUtils.h:269
clang::RISCV::RVVIntrinsic::hasPassthruOperand
bool hasPassthruOperand() const
Definition: RISCVVIntrinsicUtils.h:327
clang::RISCV::RVVIntrinsic::hasManualCodegen
bool hasManualCodegen() const
Definition: RISCVVIntrinsicUtils.h:331
clang::RISCV::BasicType
BasicType
Definition: RISCVVIntrinsicUtils.h:124
clang::RISCV::Float
@ Float
clang::RISCV::TypeModifier::Pointer
@ Pointer
clang::RISCV::PrototypeDescriptor::TM
uint8_t TM
Definition: RISCVVIntrinsicUtils.h:104
clang::RISCV::VectorTypeModifier::MaskVector
@ MaskVector
clang::RISCV::parsePrototypes
llvm::SmallVector< PrototypeDescriptor > parsePrototypes(llvm::StringRef Prototypes)
clang::RISCV::VectorTypeModifier
VectorTypeModifier
Definition: RISCVVIntrinsicUtils.h:27
clang::RISCV::Invalid
@ Invalid
Definition: RISCVVIntrinsicUtils.h:148
clang::RISCV::VectorTypeModifier::FixedSEW32
@ FixedSEW32
clang::RISCV::VectorTypeModifier::FixedSEW16
@ FixedSEW16
clang::RISCV::RVVIntrinsic::getOutputType
RVVTypePtr getOutputType() const
Definition: RISCVVIntrinsicUtils.h:320
clang::RISCV::LMULType::getScale
llvm::Optional< unsigned > getScale(unsigned ElementBitwidth) const
Definition: RISCVVIntrinsicUtils.cpp:50
clang::RISCV::RISCVPredefinedMacroT
uint8_t RISCVPredefinedMacroT
Definition: RISCVVIntrinsicUtils.h:266
clang::RISCV::TypeModifier::MaxOffset
@ MaxOffset
clang::RISCV::LMULType::Log2LMUL
int Log2LMUL
Definition: RISCVVIntrinsicUtils.h:153
clang::RISCV::RVVIntrinsic::getIntrinsicTypes
const std::vector< int64_t > & getIntrinsicTypes() const
Definition: RISCVVIntrinsicUtils.h:340
clang::RISCV::RVVIntrinsic
Definition: RISCVVIntrinsicUtils.h:287
clang::RISCV::BasicType::Int32
@ Int32