30 if (BuiltinID == AArch64::BI__builtin_arm_irg) {
31 if (
SemaRef.checkArgCount(TheCall, 2))
41 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
46 Context, Context.getIntTypeForBitwidth(64,
false),
49 SemaRef.PerformCopyInitialization(Entity,
60 if (BuiltinID == AArch64::BI__builtin_arm_addg) {
61 if (
SemaRef.checkArgCount(TheCall, 2))
70 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
78 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 15);
81 if (BuiltinID == AArch64::BI__builtin_arm_gmi) {
82 if (
SemaRef.checkArgCount(TheCall, 2))
92 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
97 Context, Context.getIntTypeForBitwidth(64,
false),
100 SemaRef.PerformCopyInitialization(Entity,
109 if (BuiltinID == AArch64::BI__builtin_arm_ldg ||
110 BuiltinID == AArch64::BI__builtin_arm_stg) {
111 if (
SemaRef.checkArgCount(TheCall, 1))
120 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
125 if (BuiltinID == AArch64::BI__builtin_arm_ldg)
126 TheCall->
setType(FirstArgType);
130 if (BuiltinID == AArch64::BI__builtin_arm_subp) {
143 auto isNull = [&](
Expr *E) ->
bool {
144 return E->isNullPointerConstant(Context,
150 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_null_or_pointer)
154 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_null_or_pointer)
162 if (!Context.typesAreCompatible(
163 Context.getCanonicalType(pointeeA).getUnqualifiedType(),
164 Context.getCanonicalType(pointeeB).getUnqualifiedType())) {
166 diag::err_typecheck_sub_ptr_compatible)
179 SemaRef.ImpCastExprToType(ArgExprA.
get(), ArgTypeB, CK_NullToPointer);
183 SemaRef.ImpCastExprToType(ArgExprB.
get(), ArgTypeA, CK_NullToPointer);
189 assert(
false &&
"Unhandled ARM MTE intrinsic");
196 int ArgNum,
unsigned ExpectedFieldNum,
198 bool IsARMBuiltin = BuiltinID == ARM::BI__builtin_arm_rsr64 ||
199 BuiltinID == ARM::BI__builtin_arm_wsr64 ||
200 BuiltinID == ARM::BI__builtin_arm_rsr ||
201 BuiltinID == ARM::BI__builtin_arm_rsrp ||
202 BuiltinID == ARM::BI__builtin_arm_wsr ||
203 BuiltinID == ARM::BI__builtin_arm_wsrp;
204 bool IsAArch64Builtin = BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
205 BuiltinID == AArch64::BI__builtin_arm_wsr64 ||
206 BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
207 BuiltinID == AArch64::BI__builtin_arm_wsr128 ||
208 BuiltinID == AArch64::BI__builtin_arm_rsr ||
209 BuiltinID == AArch64::BI__builtin_arm_rsrp ||
210 BuiltinID == AArch64::BI__builtin_arm_wsr ||
211 BuiltinID == AArch64::BI__builtin_arm_wsrp;
212 assert((IsARMBuiltin || IsAArch64Builtin) &&
"Unexpected ARM builtin.");
227 Reg.split(Fields,
":");
229 if (Fields.size() != ExpectedFieldNum && !(AllowName && Fields.size() == 1))
237 if (Fields.size() > 1) {
238 bool FiveFields = Fields.size() == 5;
240 bool ValidString =
true;
242 ValidString &= Fields[0].starts_with_insensitive(
"cp") ||
243 Fields[0].starts_with_insensitive(
"p");
245 Fields[0] = Fields[0].drop_front(
246 Fields[0].starts_with_insensitive(
"cp") ? 2 : 1);
248 ValidString &= Fields[2].starts_with_insensitive(
"c");
250 Fields[2] = Fields[2].drop_front(1);
253 ValidString &= Fields[3].starts_with_insensitive(
"c");
255 Fields[3] = Fields[3].drop_front(1);
261 FieldBitWidths.append({IsAArch64Builtin ? 2 : 4, 3, 4, 4, 3});
263 FieldBitWidths.append({4, 3, 4});
265 for (
unsigned i = 0; i < Fields.size(); ++i) {
267 ValidString &= !Fields[i].getAsInteger(10, IntField);
268 ValidString &= (IntField >= 0 && IntField < (1 << FieldBitWidths[i]));
274 }
else if (IsAArch64Builtin && Fields.size() == 1) {
282 if (BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
283 BuiltinID == AArch64::BI__builtin_arm_wsr128)
288 auto MaxLimit = llvm::StringSwitch<std::optional<unsigned>>(Reg)
289 .CaseLower(
"spsel", 15)
290 .CaseLower(
"daifclr", 15)
291 .CaseLower(
"daifset", 15)
292 .CaseLower(
"pan", 15)
293 .CaseLower(
"uao", 15)
294 .CaseLower(
"dit", 15)
295 .CaseLower(
"ssbs", 15)
296 .CaseLower(
"tco", 15)
297 .CaseLower(
"allint", 1)
299 .Default(std::nullopt);
319 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, *MaxLimit);
329 bool IsPolyUnsigned,
bool IsInt64Long) {
332 return Flags.
isUnsigned() ? Context.UnsignedCharTy : Context.SignedCharTy;
334 return Flags.
isUnsigned() ? Context.UnsignedShortTy : Context.ShortTy;
336 return Flags.
isUnsigned() ? Context.UnsignedIntTy : Context.IntTy;
339 return Flags.
isUnsigned() ? Context.UnsignedLongTy : Context.LongTy;
341 return Flags.
isUnsigned() ? Context.UnsignedLongLongTy
342 : Context.LongLongTy;
344 return IsPolyUnsigned ? Context.UnsignedCharTy : Context.SignedCharTy;
346 return IsPolyUnsigned ? Context.UnsignedShortTy : Context.ShortTy;
349 return Context.UnsignedLongTy;
351 return Context.UnsignedLongLongTy;
355 return Context.HalfTy;
357 return Context.FloatTy;
359 return Context.DoubleTy;
361 return Context.BFloat16Ty;
363 return Context.MFloat8Ty;
365 llvm_unreachable(
"Invalid NeonTypeFlag!");
383 unsigned ArgIdx,
unsigned EltBitWidth,
384 unsigned ContainerBitWidth) {
387 auto CheckImmediateInSet = [&](std::initializer_list<int64_t>
Set,
388 int ErrDiag) ->
bool {
396 if (
SemaRef.BuiltinConstantArg(TheCall, ArgIdx, Imm))
399 if (!llvm::is_contained(
Set, Imm.getSExtValue()))
405 case ImmCheckType::ImmCheck0_31:
406 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 31))
409 case ImmCheckType::ImmCheck0_13:
410 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 13))
413 case ImmCheckType::ImmCheck0_63:
414 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 63))
417 case ImmCheckType::ImmCheck1_16:
418 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 16))
421 case ImmCheckType::ImmCheck0_7:
422 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 7))
425 case ImmCheckType::ImmCheck1_1:
426 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 1))
429 case ImmCheckType::ImmCheck1_3:
430 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 3))
433 case ImmCheckType::ImmCheck1_7:
434 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 7))
437 case ImmCheckType::ImmCheckExtract:
438 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0,
439 (2048 / EltBitWidth) - 1))
442 case ImmCheckType::ImmCheckCvt:
443 case ImmCheckType::ImmCheckShiftRight:
444 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, EltBitWidth))
447 case ImmCheckType::ImmCheckShiftRightNarrow:
448 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, EltBitWidth / 2))
451 case ImmCheckType::ImmCheckShiftLeft:
452 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, EltBitWidth - 1))
455 case ImmCheckType::ImmCheckShiftLeftLong:
456 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, (EltBitWidth / 2)))
459 case ImmCheckType::ImmCheckLaneIndex:
460 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0,
461 (ContainerBitWidth / EltBitWidth) - 1))
464 case ImmCheckType::ImmCheckLaneIndexCompRotate:
465 if (
SemaRef.BuiltinConstantArgRange(
466 TheCall, ArgIdx, 0, (ContainerBitWidth / (2 * EltBitWidth)) - 1))
469 case ImmCheckType::ImmCheckLaneIndexDot:
470 if (
SemaRef.BuiltinConstantArgRange(
471 TheCall, ArgIdx, 0, (ContainerBitWidth / (4 * EltBitWidth)) - 1))
474 case ImmCheckType::ImmCheckComplexRot90_270:
475 if (CheckImmediateInSet({90, 270}, diag::err_rotation_argument_to_cadd))
478 case ImmCheckType::ImmCheckComplexRotAll90:
479 if (CheckImmediateInSet({0, 90, 180, 270},
480 diag::err_rotation_argument_to_cmla))
483 case ImmCheckType::ImmCheck0_1:
484 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 1))
487 case ImmCheckType::ImmCheck0_2:
488 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 2))
491 case ImmCheckType::ImmCheck0_3:
492 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 3))
495 case ImmCheckType::ImmCheck0_0:
496 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 0))
499 case ImmCheckType::ImmCheck0_15:
500 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 15))
503 case ImmCheckType::ImmCheck0_255:
504 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0, 255))
507 case ImmCheckType::ImmCheck1_32:
508 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 32))
511 case ImmCheckType::ImmCheck1_64:
512 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 1, 64))
515 case ImmCheckType::ImmCheck2_4_Mul2:
516 if (
SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 2, 4) ||
517 SemaRef.BuiltinConstantArgMultiple(TheCall, ArgIdx, 2))
528 bool HasError =
false;
530 for (
const auto &I : ImmChecks) {
531 auto [ArgIdx, CheckTy, ElementBitWidth, VecBitWidth] = I;
533 if (OverloadType >= 0)
545 bool HasError =
false;
547 for (
const auto &I : ImmChecks) {
548 auto [ArgIdx, CheckTy, ElementBitWidth] = I;
557 if (FD->
hasAttr<ArmLocallyStreamingAttr>())
561 if (FPT->getAArch64SMEAttributes() &
564 if (FPT->getAArch64SMEAttributes() &
575 unsigned BuiltinID) {
583 llvm::StringMap<bool> CallerFeatures;
590 const auto FindTopLevelPipe = [](
const char *S) {
592 unsigned I = 0, E = strlen(S);
594 if (S[I] ==
'|' && Depth == 0)
598 else if (S[I] ==
')')
604 const char *RequiredFeatures =
606 unsigned PipeIdx = FindTopLevelPipe(RequiredFeatures);
607 assert(PipeIdx != 0 && PipeIdx != strlen(RequiredFeatures) &&
608 "Expected feature string of the form 'SVE-EXPR|SME-EXPR'");
609 StringRef NonStreamingBuiltinGuard = StringRef(RequiredFeatures, PipeIdx);
610 StringRef StreamingBuiltinGuard = StringRef(RequiredFeatures + PipeIdx + 1);
613 NonStreamingBuiltinGuard, CallerFeatures);
615 StreamingBuiltinGuard, CallerFeatures);
617 if (SatisfiesSVE && SatisfiesSME)
620 else if (SatisfiesSVE)
622 else if (SatisfiesSME)
631 S.
Diag(TheCall->
getBeginLoc(), diag::err_attribute_arm_sm_incompat_builtin)
635 S.
Diag(TheCall->
getBeginLoc(), diag::err_attribute_arm_sm_incompat_builtin)
647#define GET_SME_BUILTIN_GET_STATE
648#include "clang/Basic/arm_sme_builtins_za_state.inc"
649#undef GET_SME_BUILTIN_GET_STATE
656 SemaRef.getCurFunctionDecl(
true)) {
660#define GET_SME_STREAMING_ATTRS
661#include "clang/Basic/arm_sme_streaming_attrs.inc"
662#undef GET_SME_STREAMING_ATTRS
671 diag::warn_attribute_arm_za_builtin_no_za_state)
676 diag::warn_attribute_arm_zt0_builtin_no_zt0_state)
686#define GET_SME_IMMEDIATE_CHECK
687#include "clang/Basic/arm_sme_sema_rangechecks.inc"
688#undef GET_SME_IMMEDIATE_CHECK
697 SemaRef.getCurFunctionDecl(
true)) {
701#define GET_SVE_STREAMING_ATTRS
702#include "clang/Basic/arm_sve_streaming_attrs.inc"
703#undef GET_SVE_STREAMING_ATTRS
715#define GET_SVE_IMMEDIATE_CHECK
716#include "clang/Basic/arm_sve_sema_rangechecks.inc"
717#undef GET_SVE_IMMEDIATE_CHECK
727 SemaRef.getCurFunctionDecl(
true)) {
733#define GET_NEON_STREAMING_COMPAT_FLAG
734#include "clang/Basic/arm_neon.inc"
735#undef GET_NEON_STREAMING_COMPAT_FLAG
746 bool HasConstPtr =
false;
748#define GET_NEON_OVERLOAD_CHECK
749#include "clang/Basic/arm_fp16.inc"
750#include "clang/Basic/arm_neon.inc"
751#undef GET_NEON_OVERLOAD_CHECK
763 TV =
Result.getLimitedValue(64);
764 if ((TV > 63) || (mask & (1ULL << TV)) == 0)
769 if (PtrArgNum >= 0) {
773 Arg = ICE->getSubExpr();
778 bool IsPolyUnsigned =
Arch == llvm::Triple::aarch64 ||
779 Arch == llvm::Triple::aarch64_32 ||
780 Arch == llvm::Triple::aarch64_be;
783 IsPolyUnsigned, IsInt64Long);
788 ConvTy =
SemaRef.CheckSingleAssignmentConstraints(LHSTy, RHS);
803#define GET_NEON_IMMEDIATE_CHECK
804#include "clang/Basic/arm_fp16.inc"
805#include "clang/Basic/arm_neon.inc"
806#undef GET_NEON_IMMEDIATE_CHECK
817#include "clang/Basic/arm_mve_builtin_sema.inc"
828#include "clang/Basic/arm_cde_builtin_sema.inc"
838 const Expr *CoprocArg,
841 if (
SemaRef.isConstantEvaluatedContext())
849 int64_t CoprocNo = CoprocNoAP.getExtValue();
850 assert(CoprocNo >= 0 &&
"Coprocessor immediate must be non-negative");
853 bool IsCDECoproc = CoprocNo <= 7 && (CDECoprocMask & (1 << CoprocNo));
855 if (IsCDECoproc != WantCDE)
865 assert((BuiltinID == ARM::BI__builtin_arm_ldrex ||
866 BuiltinID == ARM::BI__builtin_arm_ldrexd ||
867 BuiltinID == ARM::BI__builtin_arm_ldaex ||
868 BuiltinID == ARM::BI__builtin_arm_strex ||
869 BuiltinID == ARM::BI__builtin_arm_strexd ||
870 BuiltinID == ARM::BI__builtin_arm_stlex ||
871 BuiltinID == AArch64::BI__builtin_arm_ldrex ||
872 BuiltinID == AArch64::BI__builtin_arm_ldaex ||
873 BuiltinID == AArch64::BI__builtin_arm_strex ||
874 BuiltinID == AArch64::BI__builtin_arm_stlex) &&
875 "unexpected ARM builtin");
876 bool IsLdrex = BuiltinID == ARM::BI__builtin_arm_ldrex ||
877 BuiltinID == ARM::BI__builtin_arm_ldrexd ||
878 BuiltinID == ARM::BI__builtin_arm_ldaex ||
879 BuiltinID == AArch64::BI__builtin_arm_ldrex ||
880 BuiltinID == AArch64::BI__builtin_arm_ldaex;
881 bool IsDoubleWord = BuiltinID == ARM::BI__builtin_arm_ldrexd ||
882 BuiltinID == ARM::BI__builtin_arm_strexd;
889 if (
SemaRef.checkArgCount(TheCall, IsLdrex ? 1 : 2))
896 Expr *PointerArg = TheCall->
getArg(IsLdrex ? 0 : 1);
898 SemaRef.DefaultFunctionArrayLvalueConversion(PointerArg);
901 PointerArg = PointerArgRes.
get();
921 CastNeeded = CK_BitCast;
922 Diag(DRE->
getBeginLoc(), diag::ext_typecheck_convert_discards_qualifiers)
923 << PointerArg->
getType() << Context.getPointerType(AddrType)
928 AddrType = Context.getPointerType(AddrType);
929 PointerArgRes =
SemaRef.ImpCastExprToType(PointerArg, AddrType, CastNeeded);
932 PointerArg = PointerArgRes.
get();
934 TheCall->
setArg(IsLdrex ? 0 : 1, PointerArg);
939 Diag(DRE->
getBeginLoc(), diag::err_atomic_builtin_must_be_pointer_intfltptr)
948 unsigned Bits = Context.getTypeSize(ValType);
955 (llvm::isPowerOf2_64(Bits)) && Bits >= 8 && (Mask & (Bits / 8));
965 diag::err_atomic_exclusive_builtin_pointer_size)
967 bool Started =
false;
968 for (
unsigned Size = 1; Size <= 8; Size <<= 1) {
975 if (!(Mask & Size)) {
994 bool EmitDoubleWordDiagnostic =
997 diag::err_atomic_exclusive_builtin_pointer_size_none)
998 << (EmitDoubleWordDiagnostic ? 1 : 0)
1026 Context, ValType,
false);
1034 TheCall->
setType(Context.IntTy);
1041 if (BuiltinID == ARM::BI__builtin_arm_ldrex ||
1042 BuiltinID == ARM::BI__builtin_arm_ldrexd ||
1043 BuiltinID == ARM::BI__builtin_arm_ldaex ||
1044 BuiltinID == ARM::BI__builtin_arm_strex ||
1045 BuiltinID == ARM::BI__builtin_arm_strexd ||
1046 BuiltinID == ARM::BI__builtin_arm_stlex) {
1050 if (BuiltinID == ARM::BI__builtin_arm_prefetch) {
1051 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
1052 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 1);
1055 if (BuiltinID == ARM::BI__builtin_arm_rsr64 ||
1056 BuiltinID == ARM::BI__builtin_arm_wsr64)
1059 if (BuiltinID == ARM::BI__builtin_arm_rsr ||
1060 BuiltinID == ARM::BI__builtin_arm_rsrp ||
1061 BuiltinID == ARM::BI__builtin_arm_wsr ||
1062 BuiltinID == ARM::BI__builtin_arm_wsrp)
1075 switch (BuiltinID) {
1078 case ARM::BI__builtin_arm_ssat:
1079 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 1, 32);
1080 case ARM::BI__builtin_arm_usat:
1081 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 31);
1082 case ARM::BI__builtin_arm_ssat16:
1083 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 1, 16);
1084 case ARM::BI__builtin_arm_usat16:
1085 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 15);
1086 case ARM::BI__builtin_arm_vcvtr_f:
1087 case ARM::BI__builtin_arm_vcvtr_d:
1088 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
1089 case ARM::BI__builtin_arm_dmb:
1091 case ARM::BI__builtin_arm_dsb:
1093 case ARM::BI__builtin_arm_isb:
1095 case ARM::BI__builtin_arm_dbg:
1096 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 15);
1097 case ARM::BI__builtin_arm_cdp:
1098 case ARM::BI__builtin_arm_cdp2:
1099 case ARM::BI__builtin_arm_mcr:
1100 case ARM::BI__builtin_arm_mcr2:
1101 case ARM::BI__builtin_arm_mrc:
1102 case ARM::BI__builtin_arm_mrc2:
1103 case ARM::BI__builtin_arm_mcrr:
1104 case ARM::BI__builtin_arm_mcrr2:
1105 case ARM::BI__builtin_arm_mrrc:
1106 case ARM::BI__builtin_arm_mrrc2:
1107 case ARM::BI__builtin_arm_ldc:
1108 case ARM::BI__builtin_arm_ldcl:
1109 case ARM::BI__builtin_arm_ldc2:
1110 case ARM::BI__builtin_arm_ldc2l:
1111 case ARM::BI__builtin_arm_stc:
1112 case ARM::BI__builtin_arm_stcl:
1113 case ARM::BI__builtin_arm_stc2:
1114 case ARM::BI__builtin_arm_stc2l:
1115 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 15) ||
1124 if (BuiltinID == AArch64::BI__builtin_arm_ldrex ||
1125 BuiltinID == AArch64::BI__builtin_arm_ldaex ||
1126 BuiltinID == AArch64::BI__builtin_arm_strex ||
1127 BuiltinID == AArch64::BI__builtin_arm_stlex) {
1131 if (BuiltinID == AArch64::BI__builtin_arm_prefetch) {
1132 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
1133 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 3) ||
1134 SemaRef.BuiltinConstantArgRange(TheCall, 3, 0, 1) ||
1135 SemaRef.BuiltinConstantArgRange(TheCall, 4, 0, 1);
1138 if (BuiltinID == AArch64::BI__builtin_arm_range_prefetch_x) {
1139 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
1140 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 1) ||
1141 SemaRef.BuiltinConstantArgRange(TheCall, 3, -2097152, 2097151) ||
1142 SemaRef.BuiltinConstantArgRange(TheCall, 4, 1, 65536) ||
1143 SemaRef.BuiltinConstantArgRange(TheCall, 5, -2097152, 2097151);
1146 if (BuiltinID == AArch64::BI__builtin_arm_range_prefetch) {
1147 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
1148 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 1);
1151 if (BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
1152 BuiltinID == AArch64::BI__builtin_arm_wsr64 ||
1153 BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
1154 BuiltinID == AArch64::BI__builtin_arm_wsr128)
1158 if (BuiltinID == AArch64::BI__builtin_arm_irg ||
1159 BuiltinID == AArch64::BI__builtin_arm_addg ||
1160 BuiltinID == AArch64::BI__builtin_arm_gmi ||
1161 BuiltinID == AArch64::BI__builtin_arm_ldg ||
1162 BuiltinID == AArch64::BI__builtin_arm_stg ||
1163 BuiltinID == AArch64::BI__builtin_arm_subp) {
1167 if (BuiltinID == AArch64::BI__builtin_arm_rsr ||
1168 BuiltinID == AArch64::BI__builtin_arm_rsrp ||
1169 BuiltinID == AArch64::BI__builtin_arm_wsr ||
1170 BuiltinID == AArch64::BI__builtin_arm_wsrp)
1176 if (BuiltinID == AArch64::BI_ReadStatusReg ||
1177 BuiltinID == AArch64::BI_WriteStatusReg)
1178 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0x4000, 0x7fff);
1180 if (BuiltinID == AArch64::BI__sys)
1181 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 0x3fff);
1183 if (BuiltinID == AArch64::BI__getReg || BuiltinID == AArch64::BI__setReg ||
1184 BuiltinID == AArch64::BI__getRegFp || BuiltinID == AArch64::BI__setRegFp)
1185 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31);
1187 if (BuiltinID == AArch64::BI__prefetch2)
1188 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 31);
1190 if (BuiltinID == AArch64::BI__break)
1191 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 0xffff);
1193 if (BuiltinID == AArch64::BI__hlt)
1194 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 0xffff);
1196 if (BuiltinID == AArch64::BI__hvc || BuiltinID == AArch64::BI__svc) {
1199 if (
SemaRef.checkArgCountAtMost(TheCall, 5) ||
1200 SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 0xffff))
1203 for (
unsigned I = 1, N = TheCall->
getNumArgs(); I < N; ++I) {
1209 diag::err_aarch64_svc_hvc_invalid_arg_type)
1226 unsigned i = 0, l = 0, u = 0;
1227 switch (BuiltinID) {
1228 default:
return false;
1229 case AArch64::BI__builtin_arm_dmb:
1230 case AArch64::BI__dmb:
1231 case AArch64::BI__builtin_arm_dsb:
1232 case AArch64::BI__dsb:
1233 case AArch64::BI__builtin_arm_isb:
1234 case AArch64::BI__isb:
1240 return SemaRef.BuiltinConstantArgRange(TheCall, i, l, u + l);
1244struct IntrinToName {
1253 const char *IntrinNames) {
1254 AliasName.consume_front(
"__arm_");
1255 const IntrinToName *It =
1256 llvm::lower_bound(Map, BuiltinID, [](
const IntrinToName &L,
unsigned Id) {
1259 if (It == Map.end() || It->Id != BuiltinID)
1261 StringRef FullName(&IntrinNames[It->FullName]);
1262 if (AliasName == FullName)
1264 if (It->ShortName == -1)
1266 StringRef ShortName(&IntrinNames[It->ShortName]);
1267 return AliasName == ShortName;
1271#include "clang/Basic/arm_mve_builtin_aliases.inc"
1279#include "clang/Basic/arm_cde_builtin_aliases.inc"
1300 Diag(AL.
getLoc(), diag::err_attribute_argument_n_type)
1309 bool IsAArch64 = Context.getTargetInfo().getTriple().isAArch64();
1314 Diag(AL.
getLoc(), diag::err_attribute_arm_builtin_alias);
1318 D->
addAttr(::new (Context) ArmBuiltinAliasAttr(Context, AL, Ident));
1324 auto CheckForIncompatibleAttr =
1326 StringRef IncompatibleStateName) {
1327 if (CurrentState == IncompatibleState) {
1328 S.
Diag(AL.
getLoc(), diag::err_attributes_are_not_compatible)
1329 << (std::string(
"'__arm_new(\"") + StateName.str() +
"\")'")
1330 << (std::string(
"'") + IncompatibleStateName.str() +
"(\"" +
1331 StateName.str() +
"\")'")
1346 Diag(AL.
getLoc(), diag::err_missing_arm_state) << AL;
1351 std::vector<StringRef> NewState;
1352 if (
const auto *ExistingAttr = D->
getAttr<ArmNewAttr>()) {
1353 for (StringRef S : ExistingAttr->newArgs())
1354 NewState.push_back(S);
1358 bool HasZT0 =
false;
1359 for (
unsigned I = 0, E = AL.
getNumArgs(); I != E; ++I) {
1360 StringRef StateName;
1362 if (!
SemaRef.checkStringLiteralArgumentAttr(AL, I, StateName, &LiteralLoc))
1365 if (StateName ==
"za")
1367 else if (StateName ==
"zt0")
1370 Diag(LiteralLoc, diag::err_unknown_arm_state) << StateName;
1375 if (!llvm::is_contained(NewState, StateName))
1376 NewState.push_back(StateName);
1399 Diag(AL.
getLoc(), diag::err_attribute_not_clinkage) << AL;
1404 if (!FD->isExternallyVisible()) {
1405 Diag(AL.
getLoc(), diag::warn_attribute_cmse_entry_static);
1415 Diag(AL.
getLoc(), diag::err_attribute_too_many_arguments) << AL << 1;
1424 else if (!
SemaRef.checkStringLiteralArgumentAttr(AL, 0, Str, &ArgLoc))
1427 ARMInterruptAttr::InterruptType Kind;
1428 if (!ARMInterruptAttr::ConvertStrToInterruptType(Str, Kind)) {
1429 Diag(AL.
getLoc(), diag::warn_attribute_type_not_supported)
1430 << AL << Str << ArgLoc;
1434 if (!D->
hasAttr<ARMSaveFPAttr>()) {
1449 SemaRef.ARM().handleInterruptAttr(D, AL);
1452 if (!D->
hasAttr<ARMInterruptAttr>()) {
1458 bool VFP =
SemaRef.Context.getTargetInfo().hasFeature(
"vfp");
1471 bool UsesSM = FD->
hasAttr<ArmLocallyStreamingAttr>();
1472 bool UsesZA =
Attr &&
Attr->isNewZA();
1473 bool UsesZT0 =
Attr &&
Attr->isNewZT0();
1475 if (UsesZA || UsesZT0) {
1483 if (FD->
hasAttr<ArmLocallyStreamingAttr>()) {
1486 diag::warn_sme_locally_streaming_has_vl_args_returns)
1489 return P->getOriginalType()->isSizelessVectorType();
1492 diag::warn_sme_locally_streaming_has_vl_args_returns)
1505 if (UsesSM || UsesZA) {
1506 llvm::StringMap<bool> FeatureMap;
1507 Context.getFunctionFeatureMap(FeatureMap, FD);
1508 if (!FeatureMap.contains(
"sme")) {
1511 diag::err_sme_definition_using_sm_in_non_sme_target);
1514 diag::err_sme_definition_using_za_in_non_sme_target);
1518 llvm::StringMap<bool> FeatureMap;
1519 Context.getFunctionFeatureMap(FeatureMap, FD);
1520 if (!FeatureMap.contains(
"sme2")) {
1522 diag::err_sme_definition_using_zt0_in_non_sme2_target);
1531 uint64_t VScale = IsStreaming ? Context.getLangOpts().VScaleStreamingMin
1532 : Context.getLangOpts().VScaleMin;
1533 if (Ty->
getKind() == BuiltinType::SveBool ||
1534 Ty->
getKind() == BuiltinType::SveCount)
1535 return (VScale * 128) / Context.getCharWidth();
1536 return VScale * 128;
1540 bool IsStreaming =
false;
1544 SemaRef.getCurFunctionDecl(
true)) {
1547 if (
T->getAArch64SMEAttributes() &
1564 return BT->getKind() == BuiltinType::SveBool;
1566 return VT->getElementType().getCanonicalType() ==
1568 BT->getKind() != BuiltinType::SveBool;
1570 return Context.getTypeSize(SecondType) ==
1572 Context.hasSameType(
1573 VT->getElementType(),
1574 Context.getBuiltinVectorTypeInfo(BT).ElementType);
1580 return IsValidCast(FirstType, SecondType) ||
1581 IsValidCast(SecondType, FirstType);
1586 bool IsStreaming =
false;
1590 SemaRef.getCurFunctionDecl(
true)) {
1593 if (
T->getAArch64SMEAttributes() &
1616 if (BT->getKind() == BuiltinType::SveBool &&
1626 Context.getTypeSize(SecondType) !=
1638 return VecTy->getElementType().getCanonicalType()->isIntegerType() &&
1645 return IsLaxCompatible(FirstType, SecondType) ||
1646 IsLaxCompatible(SecondType, FirstType);
1650 if (!Buffer.empty())
1652 Buffer.append(Feat);
1657 StringRef PriorityString[8] = {
"P0",
"P1",
"P2",
"P3",
1658 "P4",
"P5",
"P6",
"P7"};
1660 assert(Priority > 0 && Priority < 256 &&
"priority out of range");
1662 for (
unsigned BitPos = 0; BitPos < 8; ++BitPos)
1663 if (Priority & (1U << BitPos))
1672 auto [LHS, RHS] = Param.split(
';');
1674 bool IsDefault =
false;
1676 LHS.split(Features,
'+');
1677 for (StringRef Feat : Features) {
1679 if (Feat ==
"default")
1681 else if (!
getASTContext().getTargetInfo().validateCpuSupports(Feat))
1682 return Diag(Loc, diag::warn_unsupported_target_attribute)
1687 if (!RHS.empty() && RHS.consume_front(
"priority=")) {
1689 Diag(Loc, diag::warn_invalid_default_version_priority);
1692 if (RHS.getAsInteger(0, Digit) || Digit < 1 || Digit > 255)
1693 Diag(Loc, diag::warn_version_priority_out_of_range) << RHS;
1709 assert(Params.size() == Locs.size() &&
1710 "Mismatch between number of string parameters and locations");
1712 bool HasDefault =
false;
1713 bool HasNonDefault =
false;
1714 for (
unsigned I = 0, E = Params.size(); I < E; ++I) {
1715 const StringRef Param = Params[I].trim();
1718 auto [LHS, RHS] = Param.split(
';');
1720 bool HasPriority = !RHS.empty() && RHS.consume_front(
"priority=");
1723 return Diag(Loc, diag::warn_unsupported_target_attribute)
1726 if (LHS ==
"default") {
1728 Diag(Loc, diag::warn_target_clone_duplicate_options);
1731 Diag(Loc, diag::warn_invalid_default_version_priority);
1732 NewParams.push_back(LHS);
1738 bool HasCodeGenImpact =
false;
1741 LHS.split(Features,
'+');
1742 for (StringRef Feat : Features) {
1744 if (!
getASTContext().getTargetInfo().validateCpuSupports(Feat)) {
1745 Diag(Loc, diag::warn_unsupported_target_attribute)
1749 if (
getASTContext().getTargetInfo().doesFeatureAffectCodeGen(Feat))
1750 HasCodeGenImpact =
true;
1751 ValidFeatures.push_back(Feat);
1755 if (!HasCodeGenImpact) {
1756 Diag(Loc, diag::warn_target_clone_no_impact_options);
1760 if (ValidFeatures.empty())
1764 llvm::sort(ValidFeatures);
1766 if (llvm::is_contained(NewParams, NewParam)) {
1767 Diag(Loc, diag::warn_target_clone_duplicate_options);
1773 if (RHS.getAsInteger(0, Digit) || Digit < 1 || Digit > 255)
1774 Diag(Loc, diag::warn_version_priority_out_of_range) << RHS;
1780 NewParams.push_back(NewParam);
1781 HasNonDefault =
true;
1784 return !HasNonDefault;
1789 const llvm::StringMap<bool> &FeatureMap) {
1793 if (FeatureMap.lookup(
"sve"))
1797 if (!FeatureMap.lookup(
"sme"))
1798 return Diag(Loc, diag::err_sve_vector_in_non_sve_target) << Ty;
1803 return Diag(Loc, diag::err_sve_vector_in_non_streaming_function) << Ty;
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
This file declares semantic analysis functions specific to ARM.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Builtin::Context & BuiltinInfo
const TargetInfo & getTargetInfo() const
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
Attr - This represents one attribute.
SourceLocation getLoc() const
This class is used for builtin types like 'int'.
unsigned getAuxBuiltinID(unsigned ID) const
Return real builtin ID (i.e.
const char * getRequiredFeatures(unsigned ID) const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getBeginLoc() const
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
bool isExternCContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
A reference to a declared variable, function, enum, etc.
SourceLocation getBeginLoc() const
Decl - This represents one declaration (or definition), e.g.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible.
SourceLocation getLocation() const
DeclContext * getDeclContext()
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
@ NPC_ValueDependentIsNotNull
Specifies that a value-dependent expression should be considered to never be a null pointer constant.
Represents a function declaration or definition.
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
Represents a prototype with parameter type info, e.g.
@ SME_PStateSMEnabledMask
@ SME_PStateSMCompatibleMask
@ SME_AgnosticZAStateMask
static ArmStateValue getArmZT0State(unsigned AttrBits)
static ArmStateValue getArmZAState(unsigned AttrBits)
One of these records is kept for each identifier that is lexed.
unsigned getBuiltinID() const
Return a value indicating whether this is a builtin function.
IdentifierInfo * getIdentifierInfo() const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Describes an entity that is being initialized.
static InitializedEntity InitializeParameter(ASTContext &Context, ParmVarDecl *Parm)
Create the initialization entity for a parameter.
@ Integer
Permit vector bitcasts between integer vectors with different numbers of elements but the same total ...
@ All
Permit vector bitcasts between all vectors with the same total bit-width.
Flags to identify the types for overloaded Neon builtins.
unsigned getEltSizeInBits() const
EltType getEltType() const
Represents a parameter to a function.
ParsedAttr - Represents a syntactic attribute.
IdentifierLoc * getArgAsIdent(unsigned Arg) const
void setInvalid(bool b=true) const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
bool isArgIdent(unsigned Arg) const
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
QualType withConst() const
void addConst()
Add the const type qualifier to this QualType.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType withVolatile() const
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
const Type * getTypePtrOrNull() const
bool isAtLeastAsQualifiedAs(QualType Other, const ASTContext &Ctx) const
Determine whether this type is at least as qualified as the other given type, requiring exact equalit...
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
@ OCL_ExplicitNone
This object can be modified without requiring retains or releases.
@ OCL_None
There is no lifetime qualification on this type.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ OCL_Autoreleasing
Assigning into this object requires a lifetime extension.
void CheckSMEFunctionDefAttributes(const FunctionDecl *FD)
bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
void handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL)
bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg, bool WantCDE)
bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool PerformNeonImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int, int > > &ImmChecks, int OverloadType=-1)
bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
bool PerformSVEImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int > > &ImmChecks)
void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL)
@ ArmStreaming
Intrinsic is only available in normal mode.
@ VerifyRuntimeMode
Intrinsic is available both in normal and Streaming-SVE mode.
@ ArmStreamingCompatible
Intrinsic is only available in Streaming-SVE mode.
void handleNewAttr(Decl *D, const ParsedAttr &AL)
bool CheckARMBuiltinExclusiveCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool areCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representat...
bool checkTargetVersionAttr(const StringRef Param, const SourceLocation Loc, SmallString< 64 > &NewParam)
bool checkSVETypeSupport(QualType Ty, SourceLocation Loc, const FunctionDecl *FD, const llvm::StringMap< bool > &FeatureMap)
bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall)
BuiltinARMMemoryTaggingCall - Handle calls of memory tagging extensions.
void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL)
bool CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, unsigned ArgIdx, unsigned EltBitWidth, unsigned VecBitWidth)
bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum, unsigned ExpectedFieldNum, bool AllowName)
BuiltinARMSpecialReg - Handle a check if argument ArgNum of CallExpr TheCall is an ARM/AArch64 specia...
bool SmeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool checkTargetClonesAttr(SmallVectorImpl< StringRef > &Params, SmallVectorImpl< SourceLocation > &Locs, SmallVectorImpl< SmallString< 64 > > &NewParams)
bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
ASTContext & getASTContext() const
const LangOptions & getLangOpts() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
Exposes information about the current target.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
IntType getInt64Type() const
@ ARM_LDREX_D
word (32-bit)
virtual unsigned getARMLDREXMask() const
uint32_t getARMCDECoprocMask() const
For ARM targets returns a mask defining which coprocessors are configured as Custom Datapath.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
The base class of the type hierarchy.
bool isBlockPointerType() const
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isSVESizelessBuiltinType() const
Returns true for SVE scalable vector types.
bool isSveVLSBuiltinType() const
Determines if this is a sizeless type supported by the 'arm_sve_vector_bits' type attribute,...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
QualType getSveEltType(const ASTContext &Ctx) const
Returns the representative type for the element of an SVE builtin type.
bool isFloatingType() const
bool isAnyPointerType() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isSizelessVectorType() const
Returns true for all scalable vector types.
Represents a GCC generic vector type.
Defines the clang::TargetInfo interface.
bool evaluateRequiredTargetFeatures(llvm::StringRef RequiredFatures, const llvm::StringMap< bool > &TargetFetureMap)
Returns true if the required target features of a builtin function are enabled.
Enums for the diagnostics of target, target_version and target_clones.
const AstTypeMatcher< PointerType > pointerType
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)
static void convertPriorityString(unsigned Priority, SmallString< 64 > &NewParam)
static bool BuiltinAliasValid(unsigned BuiltinID, StringRef AliasName, ArrayRef< IntrinToName > Map, const char *IntrinNames)
static ArmSMEState getSMEState(unsigned BuiltinID)
static bool checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, const FunctionDecl *FD, SemaARM::ArmStreamingType BuiltinType, unsigned BuiltinID)
SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD)
static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty, bool IsStreaming)
getSVETypeSize - Return SVE vector or predicate register size.
@ AANT_ArgumentIdentifier
@ Result
The result type of a method or function.
const FunctionProtoType * T
AssignConvertType
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the ...
bool hasArmZT0State(const FunctionDecl *FD)
Returns whether the given FunctionDecl has Arm ZT0 state.
CastKind
CastKind - The kind of operation required for a conversion.
static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context, bool IsPolyUnsigned, bool IsInt64Long)
getNeonEltType - Return the QualType corresponding to the elements of the vector type specified by th...
static bool checkNewAttrMutualExclusion(Sema &S, const ParsedAttr &AL, const FunctionProtoType *FPT, FunctionType::ArmStateValue CurrentState, StringRef StateName)
static void appendFeature(StringRef Feat, SmallString< 64 > &Buffer)
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ Generic
not a target-specific vector type
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
U cast(CodeGen::Address addr)
@ None
The alignment was not explicit in code.
bool IsArmStreamingFunction(const FunctionDecl *FD, bool IncludeLocallyStreaming)
Returns whether the given FunctionDecl has an __arm[_locally]_streaming attribute.
ActionResult< Expr * > ExprResult
bool hasArmZAState(const FunctionDecl *FD)
Returns whether the given FunctionDecl has Arm ZA state.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 int32_t
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 uint32_t
Extra information about a function prototype.
unsigned AArch64SMEAttributes