15#ifndef LLVM_CLANG_BASIC_TARGETBUILTINS_H
16#define LLVM_CLANG_BASIC_TARGETBUILTINS_H
21#include "llvm/Support/MathExtras.h"
29#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
30#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BI##ID,
31#include "clang/Basic/BuiltinsNEON.def"
41#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
42#include "clang/Basic/BuiltinsARM.def"
50#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
51#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BI##ID,
52#include "clang/Basic/BuiltinsSVE.def"
60#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
61#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BI##ID,
62#include "clang/Basic/BuiltinsSME.def"
76 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
77 #include "clang/Basic/BuiltinsAArch64.def"
86 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
87 #include "clang/Basic/BuiltinsBPF.inc"
96#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
97#include "clang/Basic/BuiltinsPPC.def"
106#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
107#include "clang/Basic/BuiltinsNVPTX.def"
116 #define BUILTIN(ID, TYPE, ATTRS) BI##ID,
117 #include "clang/Basic/BuiltinsAMDGPU.def"
126#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
127#include "clang/Basic/BuiltinsX86.def"
130#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
131#include "clang/Basic/BuiltinsX86_64.def"
140#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
141#include "clang/Basic/BuiltinsVE.def"
146 namespace RISCVVector {
149#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
150#include "clang/Basic/BuiltinsRISCVVector.def"
161#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
162#include "clang/Basic/BuiltinsRISCV.inc"
168 namespace LoongArch {
171#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
172#include "clang/Basic/BuiltinsLoongArch.def"
207 Flags |= UnsignedFlag;
217 bool isUnsigned()
const {
return (Flags & UnsignedFlag) != 0; }
218 bool isQuad()
const {
return (Flags & QuadFlag) != 0; }
224 unsigned EltTypeShift;
225 unsigned MemEltTypeShift;
226 unsigned MergeTypeShift;
227 unsigned SplatOperandMaskShift;
230#define LLVM_GET_SVE_TYPEFLAGS
231#include "clang/Basic/arm_sve_typeflags.inc"
232#undef LLVM_GET_SVE_TYPEFLAGS
235#define LLVM_GET_SVE_ELTTYPES
236#include "clang/Basic/arm_sve_typeflags.inc"
237#undef LLVM_GET_SVE_ELTTYPES
241#define LLVM_GET_SVE_MEMELTTYPES
242#include "clang/Basic/arm_sve_typeflags.inc"
243#undef LLVM_GET_SVE_MEMELTTYPES
247#define LLVM_GET_SVE_MERGETYPES
248#include "clang/Basic/arm_sve_typeflags.inc"
249#undef LLVM_GET_SVE_MERGETYPES
253#define LLVM_GET_SVE_IMMCHECKTYPES
254#include "clang/Basic/arm_sve_typeflags.inc"
255#undef LLVM_GET_SVE_IMMCHECKTYPES
259 EltTypeShift = llvm::countr_zero(EltTypeMask);
260 MemEltTypeShift = llvm::countr_zero(MemEltTypeMask);
261 MergeTypeShift = llvm::countr_zero(MergeTypeMask);
262 SplatOperandMaskShift = llvm::countr_zero(SplatOperandMask);
266 return (
EltType)((Flags & EltTypeMask) >> EltTypeShift);
270 return (
MemEltType)((Flags & MemEltTypeMask) >> MemEltTypeShift);
274 return (
MergeType)((Flags & MergeTypeMask) >> MergeTypeShift);
278 return ((Flags & SplatOperandMask) >> SplatOperandMaskShift) - 1;
282 return Flags & SplatOperandMask;
285 bool isLoad()
const {
return Flags & IsLoad; }
286 bool isStore()
const {
return Flags & IsStore; }
295 return Flags & IsOverloadWhileOrMultiVecCvt;
308 bool isUndef()
const {
return Flags & IsUndef; }
316 bool isFlagSet(uint64_t Flag)
const {
return Flags & Flag; }
323#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
324#include "clang/Basic/BuiltinsHexagon.def"
333#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
334#include "clang/Basic/BuiltinsMips.def"
343#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
344#include "clang/Basic/BuiltinsXCore.def"
353#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
354#include "clang/Basic/BuiltinsSystemZ.def"
360 namespace WebAssembly {
363#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
364#include "clang/Basic/BuiltinsWebAssembly.def"
Defines enum values for all the target-independent builtin functions.
Flags to identify the types for overloaded Neon builtins.
NeonTypeFlags(unsigned F)
EltType getEltType() const
NeonTypeFlags(EltType ET, bool IsUnsigned, bool IsQuad)
Flags to identify the types for overloaded SVE builtins.
bool isZExtReturn() const
bool isReverseUSDOT() const
bool isOverloadNone() const
MemEltType getMemEltType() const
bool isGatherLoad() const
bool isOverloadCvt() const
EltType getEltType() const
bool isOverloadDefault() const
bool isOverloadWhileRW() const
bool isReverseMergeAnyAccOp() const
bool isReductionQV() const
bool isFlagSet(uint64_t Flag) const
bool isInsertOp1SVALL() const
bool isAppendSVALL() const
bool isReverseMergeAnyBinOp() const
bool isStructStore() const
bool isTupleCreate() const
bool isGatherPrefetch() const
bool hasSplatOperand() const
MergeType getMergeType() const
bool isByteIndexed() const
bool isStructLoad() const
bool isOverloadWhileOrMultiVecCvt() const
unsigned getSplatOperand() const
bool isScatterStore() const
bool isReverseCompare() const
The JSON file list parser is used to communicate input to InstallAPI.
static constexpr uint64_t LargestBuiltinID