//===--- RISCVVIntrinsicUtils.h - RISC-V Vector Intrinsic Utils -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef CLANG_SUPPORT_RISCVVINTRINSICUTILS_H #define CLANG_SUPPORT_RISCVVINTRINSICUTILS_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitmaskEnum.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include <cstdint> #include <optional> #include <set> #include <string> #include <unordered_map> #include <vector> namespace llvm { class raw_ostream; } // end namespace llvm namespace clang { namespace RISCV { VScaleVal; // Modifier for vector type. enum class VectorTypeModifier : uint8_t { … }; // Similar to basic type but used to describe what's kind of type related to // basic vector type, used to compute type info of arguments. enum class BaseTypeModifier : uint8_t { … }; // Modifier for type, used for both scalar and vector types. enum class TypeModifier : uint8_t { … }; class Policy { … }; // PrototypeDescriptor is used to compute type info of arguments or return // value. struct PrototypeDescriptor { … }; llvm::SmallVector<PrototypeDescriptor> parsePrototypes(llvm::StringRef Prototypes); // Basic type of vector type. enum class BasicType : uint8_t { … }; // Type of vector type. enum ScalarTypeKind : uint8_t { … }; // Exponential LMUL struct LMULType { … }; class RVVType; RVVTypePtr; RVVTypes; class RVVTypeCache; // This class is compact representation of a valid and invalid RVVType. class RVVType { … }; // This class is used to manage RVVType, RVVType should only created by this // class, also provided thread-safe cache capability. class RVVTypeCache { … }; enum PolicyScheme : uint8_t { … }; // TODO refactor RVVIntrinsic class design after support all intrinsic // combination. This represents an instantiation of an intrinsic with a // particular type and prototype class RVVIntrinsic { … }; // RVVRequire should be sync'ed with target features, but only // required features used in riscv_vector.td. enum RVVRequire : uint32_t { … }; // Raw RVV intrinsic info, used to expand later. // This struct is highly compact for minimized code size. struct RVVIntrinsicRecord { … }; llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const RVVIntrinsicRecord &RVVInstrRecord); LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE(…); } // end namespace RISCV } // end namespace clang #endif // CLANG_SUPPORT_RISCVVINTRINSICUTILS_H