|
clang 24.0.0git
|
#include "CIRGenBuilder.h"#include "CIRGenFunction.h"#include "CIRGenModule.h"#include "mlir/IR/Attributes.h"#include "mlir/IR/BuiltinAttributes.h"#include "mlir/IR/Location.h"#include "mlir/IR/Types.h"#include "mlir/IR/ValueRange.h"#include "clang/Basic/Builtins.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/CIR/Dialect/IR/CIRAttrs.h"#include "clang/CIR/Dialect/IR/CIRTypes.h"#include "clang/CIR/MissingFeatures.h"#include "clang/CodeGenUtils/TargetUtils.h"#include "llvm/ADT/Sequence.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/TargetParser/X86TargetParser.h"#include <string>#include "llvm/TargetParser/X86TargetParser.def"Go to the source code of this file.
Classes | |
| struct | X86FCmpInfo |
Macros | |
| #define | X86_VENDOR(ENUM, STRING, ABI_VALUE) |
| #define | X86_CPU_TYPE(ENUM, STR, ABI_VALUE) |
| #define | X86_CPU_SUBTYPE(ENUM, STR, ABI_VALUE) |
Functions | |
| static mlir::Value | emitVectorFCmp (CIRGenFunction &cgf, const CallExpr &expr, llvm::SmallVector< mlir::Value > &ops, cir::FCmpOpKind pred, bool signaling) |
| static X86FCmpInfo | getX86FCmpInfo (unsigned cc) |
| Decodes comparison condition of x86 cmppps/cmppd* builtins which is an integer in the range [0, 31]. | |
| static llvm::StringRef | getX86FCmpIntrinsicName (unsigned builtinID) |
| Returns the legacy x86 intrinsic that implements the given x86 cmppps/cmppd* builtin. | |
| static mlir::Value | getMaskVecValue (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value mask, unsigned numElems) |
| static mlir::Value | emitX86Round (CIRGenFunction &cgf, unsigned builtinID, const CallExpr *expr, SmallVector< mlir::Value > &ops) |
| static mlir::Value | emitX86CompressStore (CIRGenBuilderTy &builder, mlir::Location loc, ArrayRef< mlir::Value > ops) |
| static cir::VecShuffleOp | emitPshufWord (CIRGenBuilderTy &builder, const mlir::Value vec, const mlir::Value immediate, const mlir::Location loc, const bool isLow) |
| static void | computeFullLaneShuffleMask (CIRGenFunction &cgf, const mlir::Value vec, uint32_t imm, const bool isShufP, llvm::SmallVectorImpl< int64_t > &outIndices) |
| static mlir::Value | emitPrefetch (CIRGenFunction &cgf, unsigned builtinID, const CallExpr *e, const SmallVector< mlir::Value > &ops) |
| static mlir::Value | emitX86CompressExpand (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value source, mlir::Value mask, mlir::Value inputVector, const std::string &id) |
| static mlir::Value | emitEncodeKey (mlir::MLIRContext *context, CIRGenBuilderTy &builder, const mlir::Location &location, mlir::ValueRange inputOperands, mlir::Value outputOperand, std::uint8_t vecOutputCount, const std::string &intrinsicName, std::uint8_t numResults) |
| static mlir::Value | emitX86Select (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value mask, mlir::Value op0, mlir::Value op1) |
| static mlir::Value | getMaskZeroBitAsBool (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value mask) |
| static mlir::Value | emitX86ScalarSelect (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value mask, mlir::Value op0, mlir::Value op1) |
| static mlir::Value | emitX86MaskAddLogic (CIRGenBuilderTy &builder, mlir::Location loc, const std::string &intrinsicName, SmallVectorImpl< mlir::Value > &ops) |
| static mlir::Value | emitX86MaskUnpack (CIRGenBuilderTy &builder, mlir::Location loc, const std::string &intrinsicName, SmallVectorImpl< mlir::Value > &ops) |
| template<typename BinOp> | |
| static mlir::Value | emitX86MaskLogic (CIRGenBuilderTy &builder, mlir::Location loc, SmallVectorImpl< mlir::Value > &ops, bool invertLHS=false) |
| static mlir::Value | emitX86MaskTest (CIRGenBuilderTy &builder, mlir::Location loc, const std::string &intrinsicName, SmallVectorImpl< mlir::Value > &ops) |
| static mlir::Value | emitX86MaskedCompareResult (CIRGenBuilderTy &builder, mlir::Value cmp, unsigned numElts, mlir::Value maskIn, mlir::Location loc) |
| static std::optional< mlir::Value > | emitX86MaskedCompare (CIRGenBuilderTy &builder, unsigned cc, bool isSigned, ArrayRef< mlir::Value > ops, mlir::Location loc) |
| static std::optional< mlir::Value > | emitX86ConvertToMask (CIRGenFunction &cgf, CIRGenBuilderTy &builder, mlir::Value in, mlir::Location loc) |
| static std::optional< mlir::Value > | emitX86SExtMask (CIRGenBuilderTy &builder, mlir::Value op, mlir::Type dstTy, mlir::Location loc) |
| static mlir::Value | emitVecInsert (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value vec, mlir::Value value, mlir::Value indexOp) |
| static mlir::Value | emitX86FunnelShift (CIRGenBuilderTy &builder, mlir::Location location, mlir::Value &op0, mlir::Value &op1, mlir::Value &amt, bool isRight) |
| static mlir::Value | emitX86Muldq (CIRGenBuilderTy &builder, mlir::Location loc, bool isSigned, SmallVectorImpl< mlir::Value > &ops, unsigned opTypePrimitiveSizeInBits) |
| static mlir::Value | emitX86CvtF16ToFloatExpr (CIRGenBuilderTy &builder, mlir::Location loc, llvm::ArrayRef< mlir::Value > ops, mlir::Type dstTy) |
| static mlir::Value | emitX86vpcom (CIRGenBuilderTy &builder, mlir::Location loc, llvm::SmallVector< mlir::Value > ops, bool isSigned) |
| static mlir::Value | emitX86Fpclass (CIRGenBuilderTy &builder, mlir::Location loc, unsigned builtinID, SmallVectorImpl< mlir::Value > &ops) |
| static mlir::Value | emitX86Aes (CIRGenBuilderTy &builder, mlir::Location loc, llvm::StringRef intrinsicName, mlir::Type retType, llvm::ArrayRef< mlir::Value > ops) |
| static mlir::Value | emitX86Aeswide (CIRGenBuilderTy &builder, mlir::Location loc, llvm::StringRef intrinsicName, mlir::Type retType, llvm::ArrayRef< mlir::Value > ops) |
| static mlir::Value | emitX86MaskedLoad (CIRGenBuilderTy &builder, ArrayRef< mlir::Value > ops, llvm::Align alignment, mlir::Location loc) |
| static mlir::Value | emitX86VPerm2f128 (CIRGenBuilderTy &builder, mlir::Location loc, llvm::SmallVector< mlir::Value > ops) |
| static mlir::Value | emitX86PackedByteShift (CIRGenBuilderTy &builder, unsigned builtinID, mlir::Location loc, llvm::ArrayRef< mlir::Value > ops, llvm::Boolean isLeftShift) |
| #define X86_CPU_SUBTYPE | ( | ENUM, | |
| STR, | |||
| ABI_VALUE ) |
| #define X86_CPU_TYPE | ( | ENUM, | |
| STR, | |||
| ABI_VALUE ) |
| #define X86_VENDOR | ( | ENUM, | |
| STRING, | |||
| ABI_VALUE ) |
|
static |
Definition at line 295 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenModule::getDataLayout(), cir::CIRDataLayout::getTypeSizeInBits(), and uint32_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 359 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createPtrStride(), clang::CIRGen::CIRGenBuilderTy::createStore(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), cir::RecordType::getAllDataKinds(), clang::CIRGen::CIRGenBuilderTy::getSInt32(), clang::CIRGen::CIRGenBuilderTy::getUInt32Ty(), clang::CIRGen::CIRGenBuilderTy::getUInt64Ty(), and clang::CharUnits::One().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 319 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createPtrBitcast(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::Expr::getExprLoc(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenFunction::getSExtIntValueFromConstOp(), and clang::CIRGen::CIRGenBuilderTy::getVoidTy().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 263 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), clang::CIRGen::CIRGenFunction::getZExtIntValueFromConstOp(), int64_t, and uint32_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 613 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::getUInt64(), and uint64_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 36 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createVecFCompare(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getLoc(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 847 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createCast(), clang::CIRGen::CIRGenBuilderTy::createStore(), cir::CIRBaseBuilderTy::createYield(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), clang::CharUnits::fromQuantity(), cir::RecordType::getAllDataKinds(), clang::CIRGen::CIRGenBuilderTy::getAnonRecordTy(), cir::CIRBaseBuilderTy::getBoolTy(), cir::CIRBaseBuilderTy::getNullValue(), getType(), clang::CIRGen::CIRGenBuilderTy::getUIntNTy(), and clang::out.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 890 of file CIRGenBuiltinX86.cpp.
References clang::CIRGen::CIRGenBuilderTy::createAlignedLoad(), cir::CIRBaseBuilderTy::createCast(), clang::CIRGen::CIRGenBuilderTy::createStore(), cir::CIRBaseBuilderTy::createYield(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), clang::CharUnits::fromQuantity(), cir::RecordType::getAllDataKinds(), clang::CIRGen::CIRGenBuilderTy::getAnonRecordTy(), clang::CIRGen::CIRGenBuilderTy::getArrayElement(), cir::CIRBaseBuilderTy::getBoolTy(), cir::CIRBaseBuilderTy::getNullValue(), getType(), clang::CIRGen::CIRGenBuilderTy::getUInt32(), clang::CIRGen::CIRGenBuilderTy::getUIntNTy(), and clang::out.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 345 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), and getMaskVecValue().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 244 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), getMaskVecValue(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 595 of file CIRGenBuiltinX86.cpp.
References emitX86MaskedCompare(), cir::CIRBaseBuilderTy::getNullValue(), and clang::in.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 697 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createCast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), and emitX86Select().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 792 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), emitX86MaskedCompareResult(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 628 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createIntCast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), clang::CIRGen::CIRGenBuilderTy::getUIntNTy(), and uint64_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 433 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), getMaskVecValue(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 541 of file CIRGenBuiltinX86.cpp.
References clang::cast(), emitX86MaskedCompareResult(), cir::CIRBaseBuilderTy::getConstAPInt(), cir::CIRBaseBuilderTy::getNullValue(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr(), and emitX86ConvertToMask().
|
static |
Definition at line 512 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createAnd(), cir::CIRBaseBuilderTy::createBitcast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), getMaskVecValue(), cir::CIRBaseBuilderTy::getNullValue(), clang::CIRGen::CIRGenBuilderTy::getSInt64Ty(), and clang::CIRGen::CIRGenBuilderTy::getUIntNTy().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr(), emitX86Fpclass(), and emitX86MaskedCompare().
|
static |
Definition at line 964 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::createMaskedLoad(), and getMaskVecValue().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 488 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createNot(), getMaskVecValue(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 500 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), getMaskVecValue(), clang::CIRGen::CIRGenBuilderTy::getSInt32Ty(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 448 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), getMaskVecValue(), clang::CIRGen::CIRGenBuilderTy::getSInt32Ty(), and getType().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 662 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createAnd(), cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createMul(), cir::CIRBaseBuilderTy::createShift(), cir::CIRBaseBuilderTy::getConstant(), and clang::CIRGen::CIRGenBuilderTy::getSInt64Ty().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 1019 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), getType(), clang::CIRGen::CIRGenBuilderTy::getZero(), clang::CIRGen::CIRGenFunction::getZExtIntValueFromConstOp(), and uint64_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 151 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createExtractElement(), cir::CIRBaseBuilderTy::createInsertElement(), clang::CIRGen::CIRGenBuilderTy::emitIntrinsicCallOp(), clang::ast_matchers::expr, clang::LangOptionsBase::FPE_Ignore, clang::CIRGen::CIRGenFunction::getBuilder(), cir::CIRBaseBuilderTy::getConstrainedFPAttr(), cir::CIRBaseBuilderTy::getIsFPConstrained(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenFunction::getZExtIntValueFromConstOp(), and cir::CIRBaseBuilderTy::setDefaultConstrainedExcept().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 420 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createSelect(), and getMaskZeroBitAsBool().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 386 of file CIRGenBuiltinX86.cpp.
References clang::cast(), and getMaskVecValue().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr(), and emitX86CvtF16ToFloatExpr().
|
static |
Definition at line 603 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createCast(), and getMaskVecValue().
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 737 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createVecCompare(), cir::CIRBaseBuilderTy::getConstAPInt(), cir::CIRBaseBuilderTy::getNullValue(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), clang::CIRGen::CIRGenBuilderTy::getUIntNTy(), clang::CIRGen::CIRGenFunction::getZExtIntValueFromConstOp(), and uint64_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 976 of file CIRGenBuiltinX86.cpp.
References clang::cast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), clang::CIRGen::CIRGenBuilderTy::getSInt32Ty(), getType(), clang::CIRGen::CIRGenBuilderTy::getZero(), clang::CIRGen::CIRGenFunction::getZExtIntValueFromConstOp(), and uint8_t.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Definition at line 132 of file CIRGenBuiltinX86.cpp.
References clang::cast(), cir::CIRBaseBuilderTy::createBitcast(), clang::CIRGen::CIRGenBuilderTy::createVecShuffle(), clang::CIRGen::CIRGenBuilderTy::getSInt32Ty(), and clang::CIRGen::CIRGenBuilderTy::getSIntNTy().
Referenced by clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr(), emitX86CompressExpand(), emitX86CompressStore(), emitX86MaskAddLogic(), emitX86MaskedCompareResult(), emitX86MaskedLoad(), emitX86MaskLogic(), emitX86MaskTest(), emitX86MaskUnpack(), emitX86Select(), and emitX86SExtMask().
|
static |
Definition at line 401 of file CIRGenBuiltinX86.cpp.
References cir::CIRBaseBuilderTy::createBitcast(), cir::CIRBaseBuilderTy::createExtractElement(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), and uint64_t.
Referenced by emitX86ScalarSelect().
|
static |
Decodes comparison condition of x86 cmppps/cmppd* builtins which is an integer in the range [0, 31].
Predicates for 16-31 repeat the 0-15 predicates and differ only in signaling behavior.
Definition at line 54 of file CIRGenBuiltinX86.cpp.
References kind.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().
|
static |
Returns the legacy x86 intrinsic that implements the given x86 cmppps/cmppd* builtin.
Definition at line 99 of file CIRGenBuiltinX86.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr().