Go to the documentation of this file.
9 #ifndef CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
10 #define CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
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"
97 :
PT(static_cast<uint8_t>(
PT)),
VTM(static_cast<uint8_t>(
VTM)),
98 TM(static_cast<uint8_t>(
TM)) {}
170 bool IsPointer =
false;
172 bool IsImmediate =
false;
174 bool IsConstant =
false;
175 unsigned ElementBitwidth = 0;
184 enum class FixedLMULType { LargerThan, SmallerThan };
206 if (ShortStr.empty())
212 bool isScalar()
const {
return Scale && Scale.getValue() == 0; }
213 bool isVector()
const {
return Scale && Scale.getValue() != 0; }
215 return isVector() && ElementBitwidth == Width;
225 return isFloat() && ElementBitwidth == Width;
232 bool verifyType()
const;
235 void applyBasicType();
241 void applyLog2EEW(
unsigned Log2EEW);
242 void applyFixedSEW(
unsigned NewSEW);
243 void applyFixedLog2LMUL(
int Log2LMUL,
enum FixedLMULType
Type);
246 void initBuiltinStr();
248 void initClangBuiltinStr();
297 bool HasUnMaskedOverloaded;
298 bool HasBuiltinAlias;
304 std::vector<int64_t> IntrinsicTypes;
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,
315 const std::vector<int64_t> &IntrinsicTypes,
316 const std::vector<llvm::StringRef> &RequiredFeatures,
323 llvm::StringRef
getName()
const {
return Name; }
325 bool hasVL()
const {
return HasVL; }
337 return RISCVPredefinedMacros;
339 unsigned getNF()
const {
return NF; }
341 return IntrinsicTypes;
356 #endif // CLANG_SUPPORT_RISCVVINTRINSICUTILS_H
bool hasBuiltinAlias() const
const std::string & getBuiltinStr() const
static llvm::Optional< RVVTypePtr > computeType(BasicType BT, int Log2LMUL, PrototypeDescriptor Proto)
static const PrototypeDescriptor VL
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)
static const PrototypeDescriptor Vector
bool isFloat(unsigned Width) const
std::string getBuiltinTypeStr() const
bool operator!=(const PrototypeDescriptor &PD) const
constexpr PrototypeDescriptor(BaseTypeModifier PT, VectorTypeModifier VTM=VectorTypeModifier::NoModifier, TypeModifier TM=TypeModifier::NoModifier)
const std::string & getShortStr()
The base class of the type hierarchy.
llvm::StringRef getManualCodegen() const
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...
void MulLog2LMUL(int Log2LMUL)
const std::string & getClangBuiltinStr() const
bool operator>(const PrototypeDescriptor &PD) const
RISCVPredefinedMacroT getRISCVPredefinedMacros() const
static std::string getSuffixStr(BasicType Type, int Log2LMUL, llvm::ArrayRef< PrototypeDescriptor > PrototypeDescriptors)
static llvm::Optional< PrototypeDescriptor > parsePrototypeDescriptor(llvm::StringRef PrototypeStr)
static const PrototypeDescriptor Mask
constexpr PrototypeDescriptor()=default
const RVVTypes & getInputTypes() const
constexpr PrototypeDescriptor(uint8_t PT, uint8_t VTM, uint8_t TM)
bool isVector(unsigned Width) const
@ LLVM_MARK_AS_BITMASK_ENUM
std::vector< RVVTypePtr > RVVTypes
bool isSignedInteger() const
@ LLVM_MARK_AS_BITMASK_ENUM
llvm::StringRef getOverloadedName() const
bool hasUnMaskedOverloaded() const
llvm::StringRef getName() const
bool hasPolicyOperand() const
llvm::StringRef getIRName() const
bool isFloatVector(unsigned Width) const
llvm::StringRef getBuiltinName() const
const std::string & getTypeStr() const
PolicyScheme getPolicyScheme() const
bool hasPassthruOperand() const
bool hasManualCodegen() const
llvm::SmallVector< PrototypeDescriptor > parsePrototypes(llvm::StringRef Prototypes)
RVVTypePtr getOutputType() const
llvm::Optional< unsigned > getScale(unsigned ElementBitwidth) const
uint8_t RISCVPredefinedMacroT
const std::vector< int64_t > & getIntrinsicTypes() const