clang API Documentation
#include "CodeGenFunction.h"#include "CGObjCRuntime.h"#include "CodeGenModule.h"#include "TargetInfo.h"#include "clang/AST/ASTContext.h"#include "clang/AST/Decl.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/Basic/TargetInfo.h"#include "clang/CodeGen/CGFunctionInfo.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Intrinsics.h"
Go to the source code of this file.
Classes | |
| struct | NeonIntrinsicInfo |
Defines | |
| #define | NEONMAP0(NameBase) { NEON::BI__builtin_neon_ ## NameBase, 0, 0, #NameBase, 0 } |
| #define | NEONMAP1(NameBase, LLVMIntrinsic, TypeModifier) |
| #define | NEONMAP2(NameBase, LLVMIntrinsic, AltLLVMIntrinsic, TypeModifier) |
Enumerations | |
| enum | { AddRetType = (1 << 0), Add1ArgType = (1 << 1), Add2ArgTypes = (1 << 2), VectorizeRetType = (1 << 3), VectorizeArgTypes = (1 << 4), InventFloatType = (1 << 5), UnsignedAlts = (1 << 6), Use64BitVectors = (1 << 7), Use128BitVectors = (1 << 8), Vectorize1ArgType = Add1ArgType | VectorizeArgTypes, VectorRet = AddRetType | VectorizeRetType, VectorRetGetArgs01, FpCmpzModifiers } |
Functions | |
| static Value * | EmitToInt (CodeGenFunction &CGF, llvm::Value *V, QualType T, llvm::IntegerType *IntType) |
| static Value * | EmitFromInt (CodeGenFunction &CGF, llvm::Value *V, QualType T, llvm::Type *ResultType) |
| static RValue | EmitBinaryAtomic (CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const CallExpr *E) |
| static RValue | EmitBinaryAtomicPost (CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const CallExpr *E, Instruction::BinaryOps Op, bool Invert=false) |
| static Value * | EmitFAbs (CodeGenFunction &CGF, Value *V) |
| EmitFAbs - Emit a call to .fabs(). | |
| static RValue | emitLibraryCall (CodeGenFunction &CGF, const FunctionDecl *Fn, const CallExpr *E, llvm::Value *calleeValue) |
| static llvm::Value * | EmitOverflowIntrinsic (CodeGenFunction &CGF, const llvm::Intrinsic::ID IntrinsicID, llvm::Value *X, llvm::Value *Y, llvm::Value *&Carry) |
| Emit a call to llvm.{sadd,uadd,ssub,usub,smul,umul}.with.overflow.* depending on IntrinsicID. | |
| static llvm::VectorType * | GetNeonType (CodeGenFunction *CGF, NeonTypeFlags TypeFlags, bool V1Ty=false) |
| static const NeonIntrinsicInfo * | findNeonIntrinsicInMap (ArrayRef< NeonIntrinsicInfo > IntrinsicMap, unsigned BuiltinID, bool &MapProvenSorted) |
| static Value * | EmitCommonNeonSISDBuiltinExpr (CodeGenFunction &CGF, const NeonIntrinsicInfo &SISDInfo, SmallVectorImpl< Value * > &Ops, const CallExpr *E) |
| static Value * | packTBLDVectorList (CodeGenFunction &CGF, ArrayRef< Value * > Ops, Value *ExtOp, Value *IndexOp, llvm::Type *ResTy, unsigned IntID, const char *Name) |
| static Value * | EmitAArch64TblBuiltinExpr (CodeGenFunction &CGF, unsigned BuiltinID, const CallExpr *E, SmallVectorImpl< Value * > &Ops) |
| static Value * | emitUnaryFPBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
| static Value * | emitTernaryFPBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
| static Value * | emitFPIntBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
Variables | |
| static NeonIntrinsicInfo | ARMSIMDIntrinsicMap [] |
| static NeonIntrinsicInfo | AArch64SIMDIntrinsicMap [] |
| static NeonIntrinsicInfo | AArch64SISDIntrinsicMap [] |
| static bool | NEONSIMDIntrinsicsProvenSorted = false |
| static bool | AArch64SIMDIntrinsicsProvenSorted = false |
| static bool | AArch64SISDIntrinsicsProvenSorted = false |
| #define NEONMAP0 | ( | NameBase | ) | { NEON::BI__builtin_neon_ ## NameBase, 0, 0, #NameBase, 0 } |
Definition at line 1942 of file CGBuiltin.cpp.
| #define NEONMAP1 | ( | NameBase, | |
| LLVMIntrinsic, | |||
| TypeModifier | |||
| ) |
{ NEON:: BI__builtin_neon_ ## NameBase, \
Intrinsic::LLVMIntrinsic, 0, #NameBase, TypeModifier }
Definition at line 1945 of file CGBuiltin.cpp.
| #define NEONMAP2 | ( | NameBase, | |
| LLVMIntrinsic, | |||
| AltLLVMIntrinsic, | |||
| TypeModifier | |||
| ) |
{ NEON:: BI__builtin_neon_ ## NameBase, \
Intrinsic::LLVMIntrinsic, Intrinsic::AltLLVMIntrinsic, \
#NameBase, TypeModifier }
Definition at line 1949 of file CGBuiltin.cpp.
| anonymous enum |
| AddRetType | |
| Add1ArgType | |
| Add2ArgTypes | |
| VectorizeRetType | |
| VectorizeArgTypes | |
| InventFloatType | |
| UnsignedAlts | |
| Use64BitVectors | |
| Use128BitVectors | |
| Vectorize1ArgType | |
| VectorRet | |
| VectorRetGetArgs01 | |
| FpCmpzModifiers |
Definition at line 1908 of file CGBuiltin.cpp.
| static Value* EmitAArch64TblBuiltinExpr | ( | CodeGenFunction & | CGF, |
| unsigned | BuiltinID, | ||
| const CallExpr * | E, | ||
| SmallVectorImpl< Value * > & | Ops | ||
| ) | [static] |
Definition at line 3686 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getIntrinsic(), GetNeonType(), clang::CallExpr::getNumArgs(), clang::Expr::isIntegerConstantExpr(), and packTBLDVectorList().
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr().
| static RValue EmitBinaryAtomic | ( | CodeGenFunction & | CGF, |
| llvm::AtomicRMWInst::BinOp | Kind, | ||
| const CallExpr * | E | ||
| ) | [static] |
Utility to insert an atomic instruction based on Instrinsic::ID and the expression node.
Definition at line 80 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CodeGen::RValue::get(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Type::isPointerType().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static RValue EmitBinaryAtomicPost | ( | CodeGenFunction & | CGF, |
| llvm::AtomicRMWInst::BinOp | Kind, | ||
| const CallExpr * | E, | ||
| Instruction::BinaryOps | Op, | ||
| bool | Invert = false |
||
| ) | [static] |
Utility to insert an atomic instruction based Instrinsic::ID and the expression node, where the return value is the result of the operation.
Definition at line 113 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CodeGen::RValue::get(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Type::isPointerType().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static Value* EmitCommonNeonSISDBuiltinExpr | ( | CodeGenFunction & | CGF, |
| const NeonIntrinsicInfo & | SISDInfo, | ||
| SmallVectorImpl< Value * > & | Ops, | ||
| const CallExpr * | E | ||
| ) | [static] |
Definition at line 2552 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, NeonIntrinsicInfo::BuiltinID, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CallExpr::getArg(), clang::Expr::getType(), NeonIntrinsicInfo::LLVMIntrinsic, clang::CodeGen::CodeGenFunction::LookupNeonLLVMIntrinsic(), NeonIntrinsicInfo::NameHint, clang::CodeGen::CodeGenTypeCache::SizeTy, and NeonIntrinsicInfo::TypeModifier.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr().
| static Value* EmitFAbs | ( | CodeGenFunction & | CGF, |
| Value * | V | ||
| ) | [static] |
EmitFAbs - Emit a call to .fabs().
Definition at line 150 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, fabs, and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static Value* emitFPIntBuiltin | ( | CodeGenFunction & | CGF, |
| const CallExpr * | E, | ||
| unsigned | IntrinsicID | ||
| ) | [static] |
Definition at line 6146 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitR600BuiltinExpr().
| static Value* EmitFromInt | ( | CodeGenFunction & | CGF, |
| llvm::Value * | V, | ||
| QualType | T, | ||
| llvm::Type * | ResultType | ||
| ) | [static] |
Definition at line 67 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CodeGenFunction::EmitFromMemory().
Referenced by EmitBinaryAtomic(), EmitBinaryAtomicPost(), and clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static RValue emitLibraryCall | ( | CodeGenFunction & | CGF, |
| const FunctionDecl * | Fn, | ||
| const CallExpr * | E, | ||
| llvm::Value * | calleeValue | ||
| ) | [static] |
Definition at line 157 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::EmitCall(), clang::CallExpr::getCallee(), and clang::Expr::getType().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static llvm::Value* EmitOverflowIntrinsic | ( | CodeGenFunction & | CGF, |
| const llvm::Intrinsic::ID | IntrinsicID, | ||
| llvm::Value * | X, | ||
| llvm::Value * | Y, | ||
| llvm::Value *& | Carry | ||
| ) | [static] |
Emit a call to llvm.{sadd,uadd,ssub,usub,smul,umul}.with.overflow.* depending on IntrinsicID.
Definition at line 172 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static Value* emitTernaryFPBuiltin | ( | CodeGenFunction & | CGF, |
| const CallExpr * | E, | ||
| unsigned | IntrinsicID | ||
| ) | [static] |
Definition at line 6134 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitR600BuiltinExpr().
| static Value* EmitToInt | ( | CodeGenFunction & | CGF, |
| llvm::Value * | V, | ||
| QualType | T, | ||
| llvm::IntegerType * | IntType | ||
| ) | [static] |
Emit the conversions required to turn the given value into an integer of the given size.
Definition at line 56 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CodeGenFunction::EmitToMemory().
Referenced by EmitBinaryAtomic(), EmitBinaryAtomicPost(), and clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
| static Value* emitUnaryFPBuiltin | ( | CodeGenFunction & | CGF, |
| const CallExpr * | E, | ||
| unsigned | IntrinsicID | ||
| ) | [static] |
Definition at line 6124 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitR600BuiltinExpr().
| static const NeonIntrinsicInfo* findNeonIntrinsicInMap | ( | ArrayRef< NeonIntrinsicInfo > | IntrinsicMap, |
| unsigned | BuiltinID, | ||
| bool & | MapProvenSorted | ||
| ) | [static] |
Definition at line 2492 of file CGBuiltin.cpp.
References NeonIntrinsicInfo::BuiltinID.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
| static llvm::VectorType* GetNeonType | ( | CodeGenFunction * | CGF, |
| NeonTypeFlags | TypeFlags, | ||
| bool | V1Ty = false |
||
| ) | [static] |
Definition at line 1761 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenTypeCache::DoubleTy, clang::NeonTypeFlags::Float16, clang::NeonTypeFlags::Float32, clang::NeonTypeFlags::Float64, clang::CodeGen::CodeGenTypeCache::FloatTy, clang::NeonTypeFlags::getEltType(), clang::NeonTypeFlags::Int16, clang::CodeGen::CodeGenTypeCache::Int16Ty, clang::NeonTypeFlags::Int32, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::NeonTypeFlags::Int64, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::NeonTypeFlags::Int8, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::NeonTypeFlags::isQuad(), clang::NeonTypeFlags::Poly128, clang::NeonTypeFlags::Poly16, clang::NeonTypeFlags::Poly64, and clang::NeonTypeFlags::Poly8.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAArch64TblBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr().
| static Value* packTBLDVectorList | ( | CodeGenFunction & | CGF, |
| ArrayRef< Value * > | Ops, | ||
| Value * | ExtOp, | ||
| Value * | IndexOp, | ||
| llvm::Type * | ResTy, | ||
| unsigned | IntID, | ||
| const char * | Name | ||
| ) | [static] |
Definition at line 3086 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CodeGen::CodeGenModule::getIntrinsic(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by EmitAArch64TblBuiltinExpr().
NeonIntrinsicInfo AArch64SIMDIntrinsicMap[] [static] |
Definition at line 2171 of file CGBuiltin.cpp.
bool AArch64SIMDIntrinsicsProvenSorted = false [static] |
Definition at line 2487 of file CGBuiltin.cpp.
NeonIntrinsicInfo AArch64SISDIntrinsicMap[] [static] |
Definition at line 2286 of file CGBuiltin.cpp.
bool AArch64SISDIntrinsicsProvenSorted = false [static] |
Definition at line 2488 of file CGBuiltin.cpp.
NeonIntrinsicInfo ARMSIMDIntrinsicMap[] [static] |
Definition at line 1954 of file CGBuiltin.cpp.
bool NEONSIMDIntrinsicsProvenSorted = false [static] |
Definition at line 2485 of file CGBuiltin.cpp.