|
clang 23.0.0git
|
#include "CIRGenBuilder.h"#include "CIRGenFunction.h"#include "clang/Basic/AArch64CodeGenUtils.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/CIR/MissingFeatures.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/IntrinsicsAArch64.h"#include "mlir/IR/Value.h"#include "clang/AST/GlobalDecl.h"#include "clang/Basic/Builtins.h"#include "clang/Basic/arm_sve_builtin_cg.inc"#include "clang/Basic/arm_fp16.inc"#include "clang/Basic/arm_neon.inc"Go to the source code of this file.
Macros | |
| #define | SVEMAP1(NameBase, LLVMIntrinsic, TypeModifier) |
| #define | SVEMAP2(NameBase, TypeModifier) |
| #define | GET_SVE_LLVM_INTRINSIC_MAP |
| #define | GET_NEON_OVERLOAD_CHECK |
Functions | |
| static mlir::Value | genVscaleTimesFactor (mlir::Location loc, CIRGenBuilderTy builder, mlir::Type cirTy, int32_t scalingFactor) |
| static const ARMVectorIntrinsicInfo * | findARMVectorIntrinsicInMap (ArrayRef< ARMVectorIntrinsicInfo > intrinsicMap, unsigned builtinID, bool &mapProvenSorted) |
| static mlir::Value | emitAArch64CompareBuiltinExpr (CIRGenFunction &cgf, CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value src, mlir::Type retTy, const cir::CmpOpKind kind) |
| static cir::VectorType | getNeonType (CIRGenFunction *cgf, NeonTypeFlags typeFlags, mlir::Location loc, bool hasLegalHalfType=true, bool v1Ty=false, bool allowBFloatArgsAndRet=true) |
| static int64_t | getIntValueFromConstOp (mlir::Value val) |
| static mlir::Value | emitNeonSplat (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value v, mlir::Value lane, unsigned int resEltCnt) |
| static mlir::Value | emitCommonNeonBuiltinExpr (CIRGenFunction &cgf, unsigned builtinID, unsigned llvmIntrinsic, unsigned altLLVMIntrinsic, const char *nameHint, unsigned modifier, const CallExpr *expr, llvm::SmallVectorImpl< mlir::Value > &ops) |
| static mlir::Value | emitCallMaybeConstrainedBuiltin (CIRGenBuilderTy &builder, mlir::Location loc, StringRef intrName, mlir::Type retTy, llvm::SmallVector< mlir::Value > &ops) |
| static llvm::StringRef | getLLVMIntrNameNoPrefix (llvm::Intrinsic::ID intrID) |
| static unsigned | getSVEMinEltCount (clang::SVETypeFlags::EltType sveType) |
| static cir::VectorType | getSVEVectorForElementType (CIRGenModule &cgm, mlir::Type eltTy) |
| static bool | hasExtraNeonArgument (unsigned builtinID) |
| Return true if BuiltinID is an overloaded Neon intrinsic with an extra argument that specifies the vector type. | |
| template<typename Operation> | |
| static mlir::Value | emitNeonCallToOp (CIRGenModule &cgm, CIRGenBuilderTy &builder, llvm::SmallVector< mlir::Type > argTypes, llvm::SmallVectorImpl< mlir::Value > &args, std::optional< llvm::StringRef > intrinsicName, mlir::Type funcResTy, mlir::Location loc, bool isConstrainedFPIntrinsic=false, unsigned shift=0, bool rightshift=false) |
| static mlir::Value | emitNeonCall (CIRGenModule &cgm, CIRGenBuilderTy &builder, llvm::SmallVector< mlir::Type > argTypes, llvm::SmallVectorImpl< mlir::Value > &args, llvm::StringRef intrinsicName, mlir::Type funcResTy, mlir::Location loc, bool isConstrainedFPIntrinsic=false, unsigned shift=0, bool rightshift=false) |
| static mlir::Value | emitCommonNeonSISDBuiltinExpr (CIRGenFunction &cgf, const ARMVectorIntrinsicInfo &info, llvm::SmallVectorImpl< mlir::Value > &ops, const CallExpr *expr) |
Variables | |
| static const ARMVectorIntrinsicInfo | aarch64SVEIntrinsicMap [] |
| static bool | aarch64SIMDIntrinsicsProvenSorted = false |
| static bool | aarch64SISDIntrinsicsProvenSorted = false |
| static bool | aarch64SVEIntrinsicsProvenSorted = false |
| constexpr unsigned | sveBitsPerBlock = 128 |
| static const std::pair< unsigned, unsigned > | neonEquivalentIntrinsicMap [] |
| #define GET_NEON_OVERLOAD_CHECK |
| #define GET_SVE_LLVM_INTRINSIC_MAP |
| #define SVEMAP1 | ( | NameBase, | |
| LLVMIntrinsic, | |||
| TypeModifier ) |
Definition at line 45 of file CIRGenBuiltinAArch64.cpp.
| #define SVEMAP2 | ( | NameBase, | |
| TypeModifier ) |
Definition at line 49 of file CIRGenBuiltinAArch64.cpp.
|
static |
Definition at line 87 of file CIRGenBuiltinAArch64.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createCompare(), cir::CIRBaseBuilderTy::createVecCompare(), cir::CIRBaseBuilderTy::getNullValue(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), clang::isa(), and kind.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr(), and emitCommonNeonBuiltinExpr().
|
static |
Definition at line 505 of file CIRGenBuiltinAArch64.cpp.
References cir::MissingFeatures::emitConstrainedFPCall(), and clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp().
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
|
static |
Definition at line 185 of file CIRGenBuiltinAArch64.cpp.
References clang::ASTContext::BuiltinInfo, clang::CIRGen::CIRGenFunction::cgm, cir::CIRBaseBuilderTy::createBitcast(), emitAArch64CompareBuiltinExpr(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), emitNeonSplat(), clang::CIRGen::CIRGenModule::errorNYI(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getContext(), clang::CIRGen::CIRGenFunction::getLoc(), clang::Builtin::Context::getName(), getNeonType(), clang::CIRGen::CIRGenFunction::getTarget(), and clang::TargetInfo::hasFastHalfType().
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
|
static |
Definition at line 722 of file CIRGenBuiltinAArch64.cpp.
References clang::aarch64::ARMVectorIntrinsicInfo::BuiltinID, clang::ASTContext::BuiltinInfo, clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::convertType(), emitNeonCall(), clang::CIRGen::CIRGenModule::errorNYI(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getContext(), getLLVMIntrNameNoPrefix(), clang::CIRGen::CIRGenFunction::getLoc(), clang::Builtin::Context::getName(), and clang::aarch64::ARMVectorIntrinsicInfo::LLVMIntrinsic.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
|
static |
Definition at line 710 of file CIRGenBuiltinAArch64.cpp.
References emitNeonCallToOp().
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr(), and emitCommonNeonSISDBuiltinExpr().
|
static |
Definition at line 672 of file CIRGenBuiltinAArch64.cpp.
References cir::CIRBaseBuilderTy::createBitcast(), cir::MissingFeatures::emitConstrainedFPCall(), and clang::CIRGen::CIRGenModule::errorNYI().
Referenced by emitNeonCall().
|
static |
Definition at line 175 of file CIRGenBuiltinAArch64.cpp.
References clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), getIntValueFromConstOp(), and clang::isa().
Referenced by emitCommonNeonBuiltinExpr().
|
static |
Definition at line 64 of file CIRGenBuiltinAArch64.cpp.
References clang::aarch64::ARMVectorIntrinsicInfo::BuiltinID.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAArch64SMEBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAArch64SVEBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
|
static |
Definition at line 36 of file CIRGenBuiltinAArch64.cpp.
References cir::CIRBaseBuilderTy::createNUWAMul(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), and clang::CIRGen::CIRGenBuilderTy::getUInt64().
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr().
|
static |
Definition at line 171 of file CIRGenBuiltinAArch64.cpp.
Referenced by emitNeonSplat().
|
static |
Definition at line 540 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr(), emitCommonNeonSISDBuiltinExpr(), and clang::CIRGen::CIRGenFunction::emitSVEPredicateCast().
|
static |
Definition at line 115 of file CIRGenBuiltinAArch64.cpp.
References clang::NeonTypeFlags::BFloat16, clang::CIRGen::CIRGenTypeCache::bFloat16Ty, clang::CIRGen::CIRGenTypeCache::doubleTy, clang::CIRGen::CIRGenModule::errorNYI(), clang::NeonTypeFlags::Float16, clang::NeonTypeFlags::Float32, clang::NeonTypeFlags::Float64, clang::CIRGen::CIRGenTypeCache::floatTy, clang::CIRGen::CIRGenFunction::getCIRGenModule(), clang::NeonTypeFlags::getEltType(), clang::NeonTypeFlags::Int16, clang::NeonTypeFlags::Int32, clang::NeonTypeFlags::Int64, clang::NeonTypeFlags::Int8, clang::NeonTypeFlags::isQuad(), clang::NeonTypeFlags::isUnsigned(), clang::NeonTypeFlags::MFloat8, clang::NeonTypeFlags::Poly128, clang::NeonTypeFlags::Poly16, clang::NeonTypeFlags::Poly64, clang::NeonTypeFlags::Poly8, clang::CIRGen::CIRGenTypeCache::sInt16Ty, clang::CIRGen::CIRGenTypeCache::sInt32Ty, clang::CIRGen::CIRGenTypeCache::sInt64Ty, clang::CIRGen::CIRGenTypeCache::sInt8Ty, clang::CIRGen::CIRGenTypeCache::uInt16Ty, clang::CIRGen::CIRGenTypeCache::uInt32Ty, clang::CIRGen::CIRGenTypeCache::uInt64Ty, and clang::CIRGen::CIRGenTypeCache::uInt8Ty.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr(), and emitCommonNeonBuiltinExpr().
|
static |
Definition at line 587 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr().
|
static |
Definition at line 625 of file CIRGenBuiltinAArch64.cpp.
References clang::CIRGen::CIRGenModule::getDataLayout(), cir::CIRDataLayout::getTypeSizeInBits(), and sveBitsPerBlock.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64SVEBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitSMELd1St1(), and clang::CodeGen::CodeGenFunction::EmitSVEPrefetchLoad().
Return true if BuiltinID is an overloaded Neon intrinsic with an extra argument that specifies the vector type.
The additional argument is meant for Sema checking (see CheckNeonBuiltinFunctionCall) and this function should be kept consistent with the logic in Sema. TODO: Make this return false for SISD builtins. TODO(cir): Share this with ARM.cpp
Definition at line 641 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
Definition at line 57 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
Definition at line 58 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
|
static |
Definition at line 51 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr().
Definition at line 59 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64SVEBuiltinExpr().
Definition at line 1061 of file CIRGenBuiltinAArch64.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr().
|
constexpr |
Definition at line 623 of file CIRGenBuiltinAArch64.cpp.
Referenced by getSVEVectorForElementType().