[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-10-03 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/109420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-03 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/110281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-10-03 Thread Paul Walker via cfe-commits
@@ -953,9 +953,20 @@ Intrinsic::Intrinsic(StringRef Name, StringRef Proto, uint64_t MergeTy, SVEEmitter &Emitter, StringRef SVEGuard, StringRef SMEGuard) : Name(Name.str()), LLVMName(LLVMName), Proto(Proto.str()), - BaseTypeSp

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-02 Thread Paul Walker via cfe-commits
@@ -1003,6 +998,13 @@ defm SVFCVT_F32_F64 : SInstCvtMXZ<"svcvt_f32[_f64]", "MMPd", "MPd", "d", "aarc defm SVFCVT_F64_F16 : SInstCvtMXZ<"svcvt_f64[_f16]", "ddPO", "dPO", "d", "aarch64_sve_fcvt_f64f16">; defm SVFCVT_F64_F32 : SInstCvtMXZ<"svcvt_f64[_f32]", "ddPM", "dPM", "

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-02 Thread Paul Walker via cfe-commits
@@ -5553,6 +5553,14 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) { if (InVT == VT) return Op; + // Look through casts to when their input has more lanes than paulwalker-arm wrote: Done, plus removed another redundan

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-02 Thread Paul Walker via cfe-commits
@@ -4072,6 +4078,30 @@ static Value *upgradeX86IntrinsicCall(StringRef Name, CallBase *CI, Function *F, return Rep; } +static Value *upgradeAArch64IntrinsicCall(StringRef Name, CallBase *CI, + Function *F, IRBuilder<> &Builder) { +

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-02 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/110281 >From 7fd66c7630ec03db05203c7ffdf8e36e23e30d93 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Thu, 26 Sep 2024 18:07:52 +0100 Subject: [PATCH 1/2] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-01 Thread Paul Walker via cfe-commits
@@ -5553,6 +5553,14 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) { if (InVT == VT) return Op; + // Look through casts to when their input has more lanes than + // VT. This will increase the chances of removing casts that introduce n

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-10-01 Thread Paul Walker via cfe-commits
@@ -5553,6 +5553,14 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) { if (InVT == VT) return Op; + // Look through casts to when their input has more lanes than paulwalker-arm wrote: I knew something was odd when I was

[clang] [llvm] [AArch64][SVE] Fix definition of bfloat fcvt intrinsics. (PR #110281)

2024-09-27 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/110281 Affected intrinsics: llvm.aarch64.sve.fcvt.bf16f32 llvm.aarch64.sve.fcvtnt.bf16f32 The named intrinsics took a predicate based on the smallest element type when it should be based on the largest.

[clang] [Clang][SME2] Use tuple result of SME builtins directly. (PR #109423)

2024-09-25 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/109423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -2986,6 +2986,14 @@ void CastOperation::CheckCStyleCast() { return; } + if ((DestType->isArmMFloat8Type() && !SrcType->isArmMFloat8Type()) || + (!DestType->isArmMFloat8Type() && SrcType->isArmMFloat8Type())) { paulwalker-arm wrote: `DestType->i

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/97277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -2644,6 +2644,8 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { bool isQueueT() const;// OpenCL queue_t bool isReserveIDT() const;// OpenCL reserve_id_t + bool isArmMFloat8Type() const; // AARCH64_OPAQ

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -3437,9 +3446,19 @@ StringRef BuiltinType::getName(const PrintingPolicy &Policy) const { case Id: \ return #ExtType; #include "clang/Basic/OpenCLExtensionTypes.def" -#define SVE_TYPE(Name, Id, SingletonId) \ - case Id: \ +#define SVE_VECTOR_TYPE(Name, MangledName, Id

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -97,6 +97,12 @@ SVE_TYPE(Name, Id, SingletonId) #endif +#ifndef AARCH64_OPAQUE_TYPE +#define AARCH64_OPAQUE_TYPE(Name, MangledName, Id, SingletonId, NumEls, \ +ElBits, NF) \ + SVE_TYPE(Name, Id, SingletonId) +#endif + paulwalk

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -782,6 +782,13 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) { #define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include "clang/Basic/AArch64SVEACLETypes.def" { + if (BT->getKind() == BuiltinType::ArmMFloat8) { +Encoding = llv

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -325,6 +325,8 @@ class DeclSpec { #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \ static const TST TST_##Name = clang::TST_##Name; #include "clang/Basic/HLSLIntangibleTypes.def" + // AARCH64_OPAQUE_TYPE + static const TST TST_ArmMFloat8_

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -2218,6 +2219,12 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { Width = 0; \ Align = 16; \ break; +#define AARCH64_OP

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-09-24 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm commented: Sorry, my comments are a bit all over the place, but I'm concerned we've not defined enough (and/or I need to understand what it means to be a storage only type) for me to confidently accept this PR. If possible, my suggestion is to detach the scala

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -1802,9 +1854,29 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { if (Def->isFlagSet(IsStreamingFlag)) StreamingMap["ArmStreaming"].insert(Def->getMangledName()); -else if (Def->isFlagSet(VerifyRuntimeMode)) +else if (Def->isFlag

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-24 Thread Paul Walker via cfe-commits
@@ -1802,9 +1854,29 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { if (Def->isFlagSet(IsStreamingFlag)) StreamingMap["ArmStreaming"].insert(Def->getMangledName()); -else if (Def->isFlagSet(VerifyRuntimeMode)) +else if (Def->isFlag

[clang] [Clang][Driver][AArch64] Add support for aarch64-amazon-linux triple (PR #109263)

2024-09-23 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/109263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver][AArch64] Add support for aarch64-amazon-linux triple (PR #109263)

2024-09-23 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. Whilst I understand the rational for requesting an alternate solution, it feels unfair. If the PR was to add a new OS or Vendor I'd have more sympathy but here we're talking about extending the existing OS-Vendor support to cover a

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-20 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/109420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-20 Thread Paul Walker via cfe-commits
@@ -567,23 +567,28 @@ static bool checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, // * When compiling for SVE only, the caller must be in non-streaming mode. // * When compiling for both SVE and SME, the caller can be in either mode. if (BuiltinType == SemaARM::Veri

[clang] [Clang][SVE] Change LLVM representation of ACLE tuple types to be struct based. (PR #108008)

2024-09-13 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/108008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SVE] Change LLVM representation of ACLE tuple types to be struct based. (PR #108008)

2024-09-11 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/108008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][SVE] Refactor AArch64SVEACLETypes.def to enabled more uses. (PR #107599)

2024-09-11 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/107599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TBAA] Emit "omnipotent char" for intrinsics with type cast (PR #107793)

2024-09-10 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: I'll need to look to see if the TBAA metadata we're adding matches what we initially envisaged but my gut feeling matches @arsenm. I'm assuming the original code emitted an error, something along the lines of "no version of svst1 available for long long*", which you've "f

[clang] [Clang][SVE] Change LLVM representation of ACLE tuple types to be struct based. (PR #108008)

2024-09-10 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/108008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SVE] Change LLVM representation of ACLE tuple types to be struct based. (PR #108008)

2024-09-10 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/108008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SVE] Change LLVM representation of ACLE tuple types to be struct based. (PR #108008)

2024-09-10 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/108008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][SVE] Refactor AArch64SVEACLETypes.def to enabled more uses. (PR #107599)

2024-09-10 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/107599 >From 05670ea720be07ff8c1645ca90fff00460029de7 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 6 Sep 2024 12:10:19 +0100 Subject: [PATCH] [NFC][Clang][SVE] Refactor AArch64SVEACLETypes.def to enable

[clang] [NFC][Clang][SVE] Refactor AArch64SVEACLETypes.def to enabled more uses. (PR #107599)

2024-09-06 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/107599 Some switch statements require all SVE builtin types to be manually specified. This patch refactors the SVE_*_TYPE macros so that such code can be generated during preprocessing. I've tried to establish

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-29 Thread Paul Walker via cfe-commits
@@ -717,6 +717,11 @@ let Predicates = [HasSVEorSME] in { defm FDIV_ZPZZ : sve_fp_bin_pred_hfd; } // End HasSVEorSME +let Predicates = [HasSVE2orSME2, HasFAMINMAX] in { + defm FAMAX_ZPZZ : sve_fp_bin_pred_hfd; + defm FAMIN_ZPZZ : sve_fp_bin_pred_hfd; +} +

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-29 Thread Paul Walker via cfe-commits
@@ -0,0 +1,115 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 +; RUN: llc -mattr=+sve2 < %s | FileCheck %s +; RUN: llc -mattr=+sme2 -force-streaming < %s | FileCheck %s + +target triple = "aarch64-linux" + +define @famin_f

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-29 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. A couple of suggestions but otherwise this looks good to me. https://github.com/llvm/llvm-project/pull/99042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-29 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/99042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-28 Thread Paul Walker via cfe-commits
@@ -135,6 +135,8 @@ enum NodeType : unsigned { UDIV_PRED, UMAX_PRED, UMIN_PRED, + FAMAX_PRED, + FAMIN_PRED, paulwalker-arm wrote: Yep, the latter. We use it here because the ISD node exists for other reasons and so was convenient to reuse here. In ge

[clang] [llvm] [AArch64] Implement intrinsics for SVE FAMIN/FAMAX (PR #99042)

2024-08-13 Thread Paul Walker via cfe-commits
@@ -135,6 +135,8 @@ enum NodeType : unsigned { UDIV_PRED, UMAX_PRED, UMIN_PRED, + FAMAX_PRED, + FAMIN_PRED, paulwalker-arm wrote: Is it necessary to create dedicated AArch64ISD nodes? We normally reserve that for cases where additional DAG combines ar

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-08-06 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Just to add the commit message needs updating to reflect the updated specification. https://github.com/llvm/llvm-project/pull/97277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-08-06 Thread Paul Walker via cfe-commits
@@ -3197,6 +3197,13 @@ void CastOperation::CheckCStyleCast() { } } + if ((DestType->isMFloat8Type() && !SrcType->isMFloat8Type()) || + (!DestType->isMFloat8Type() && SrcType->isMFloat8Type())) { paulwalker-arm wrote: `DestType->isMFloat8Type() !=

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-08-06 Thread Paul Walker via cfe-commits
@@ -1139,6 +1139,7 @@ class ASTContext : public RefCountedBase { CanQualType SatShortFractTy, SatFractTy, SatLongFractTy; CanQualType SatUnsignedShortFractTy, SatUnsignedFractTy, SatUnsignedLongFractTy; + CanQualType MFloat8Ty; paulwalker-arm wrote:

[clang] [CLANG][AArch64] Add the modal 8 bit floating-point scalar type (PR #97277)

2024-08-06 Thread Paul Walker via cfe-commits
@@ -221,6 +221,10 @@ FLOATING_TYPE(Float128, Float128Ty) // '__ibm128' FLOATING_TYPE(Ibm128, Ibm128Ty) + +// '__fpm8' paulwalker-arm wrote: __mfp8 https://github.com/llvm/llvm-project/pull/97277 ___ cfe-commits mai

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-26 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/100740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][AArch64]Add Neon vectors for fpm8_t (PR #99865)

2024-07-26 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Sorry for the noise but I think I've a more wellformed question this time. Is it be possible to use `AArch64SVEACLETypes.def` to reduce some of the boilerplate changes? I'm not sure how much of this is tied to SVE (or rather scalable types) but I'm wondering if clang can

[clang] [CLANG][AArch64]Add Neon vectors for fpm8_t (PR #99865)

2024-07-26 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Is it possible to use TargetExtType for the scalar type given this is a target specific type. I fully expect LLVM not to support vector's of TargetExtType but I wonder if that can be relaxed given our only use case is to pass them to intrinsics. For anything more exotic

[clang] [Clang][SveEmitter] Split up TargetGuard into SVE and SME component. (PR #96482)

2024-06-24 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. This is certainly a step in the right direction. https://github.com/llvm/llvm-project/pull/96482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/95787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
@@ -1781,7 +1781,13 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { uint64_t VerifyRuntimeMode = getEnumValueForFlag("VerifyRuntimeMode"); uint64_t IsStreamingCompatibleFlag = getEnumValueForFlag("IsStreamingCompatible"); + for (auto &De

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
@@ -2264,6 +2278,18 @@ let TargetGuard = "sve2p1" in { defm SVPMOV_TO_VEC_LANE_D : PMOV_TO_VEC<"svpmov", "lUl", "aarch64_sve_pmov_to_vector_lane" ,[], ImmCheck1_7>; } +let TargetGuard = "sve2p1|sme2p1" in { + // DUPQ + def SVDUP_LANEQ_B : SInst<"svdup_laneq[_{d}]", "ddi"

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm commented: With the change of default it's very hard to check everything but we've already agreed there'll need to be a full audit once all the inflight work has landed. I did spot one thing though: Should the integer svclamp and svrevd builtins be protected

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
@@ -286,17 +290,20 @@ let TargetGuard = "sve,f64mm,bf16" in { } let TargetGuard = "sve,bf16" in { + def SVBFMMLA : SInst<"svbfmmla[_{0}]", "MMdd", "b", MergeNone, "aarch64_sve_bfmmla", [IsOverloadNone]>; +} + +let TargetGuard = "(sve|sme),bf16" in { def

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/95787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-20 Thread Paul Walker via cfe-commits
@@ -17,7 +25,7 @@ // CPP-CHECK-NEXT:[[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4 // CPP-CHECK-NEXT:ret i64 [[TMP1]] // -uint64_t test_svcntb() +uint64_t test_svcntb(void) MODE_ATTR paulwalker-arm wrote: Is there a problem we need to worry about with usin

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/95787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/95787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
@@ -286,10 +290,13 @@ let TargetGuard = "sve,f64mm,bf16" in { } let TargetGuard = "sve,bf16" in { + def SVBFMMLA : SInst<"svbfmmla[_{0}]", "MMdd", "b", MergeNone, "aarch64_sve_bfmmla", [IsOverloadNone]>; +} + +let TargetGuard = "(sve,bf16)|sme" in { --

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
@@ -1781,7 +1781,12 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { uint64_t VerifyRuntimeMode = getEnumValueForFlag("VerifyRuntimeMode"); uint64_t IsStreamingCompatibleFlag = getEnumValueForFlag("IsStreamingCompatible"); + for (auto &De

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/95787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
@@ -2264,6 +2278,18 @@ let TargetGuard = "sve2p1" in { defm SVPMOV_TO_VEC_LANE_D : PMOV_TO_VEC<"svpmov", "lUl", "aarch64_sve_pmov_to_vector_lane" ,[], ImmCheck1_7>; } +let TargetGuard = "sve2p1|sme2" in { paulwalker-arm wrote: I think this is a sme2p1 feat

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-18 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm commented: Not for this patch but I do wonder if there's value in protecting non-bf16 instruction backed builtins (e.g. loadstone and shuffles) with the bf16 target guard. I figure we'll either error on the use of the `svbfloat` type or the code generation sh

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-15 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-14 Thread Paul Walker via cfe-commits
@@ -559,31 +559,76 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-06 Thread Paul Walker via cfe-commits
@@ -622,7 +679,8 @@ bool SemaARM::CheckSMEBuiltinFunctionCall(unsigned BuiltinID, } if (BuiltinType) - checkArmStreamingBuiltin(SemaRef, TheCall, FD, *BuiltinType); + HasError |= checkArmStreamingBuiltin(SemaRef, TheCall, FD, *BuiltinType, p

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-06 Thread Paul Walker via cfe-commits
@@ -559,31 +559,86 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-06 Thread Paul Walker via cfe-commits
@@ -559,31 +559,86 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] [llvm] [AArch64] Fix feature flags dependecies (PR #90612)

2024-06-05 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: @momchil-velikov's commentary applies globally and is not specific to FPMR. Which is to say, Arm switched a while back from "all system register need to be protected by their feature flag" to "only protect system registers where there is a need". The rational is that we

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
@@ -561,16 +561,61 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, const FunctionDecl *FD, - SemaARM::ArmStre

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
@@ -225,7 +225,7 @@ def IsStreamingCompatible : FlagType<0x40>; def IsReadZA: FlagType<0x80>; def IsWriteZA : FlagType<0x100>; def IsReductionQV : FlagType<0x200>; -def Is

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm requested changes to this pull request. https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Use __clang_arm_builtin_alias for overloaded svreinterpret's (PR #92427)

2024-05-22 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/92427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/91356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/91356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm commented: After further discussion I know understand the `__arm_streaming_compatible` keyword has no affect on the target features in play and only tells the compiler not to emit any SM state changing instructions as part of the calling convention. https://g

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
@@ -8982,11 +8982,18 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { const FunctionDecl *FD = cast(CurContext); llvm::StringMap CallerFeatureMap; Context.getFunctionFeatureMap(CallerFeatureMap, FD); -if (!Builtin::evaluateRequiredTargetFeatures( -

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
@@ -9,6 +9,12 @@ #include +#if defined __ARM_FEATURE_SME +#define MODE_ATTR __arm_streaming +#else +#define MODE_ATTR __arm_streaming_compatible paulwalker-arm wrote: Do you need to use `__arm_streaming_compatible` here? Now we've agreed this keyword has

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/91356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-08 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm requested changes to this pull request. As discussed offline, I don't think we want to be this strict. As demonstrated by the changes to the ACLE tests, this change makes it impossible to distribute a library in binary form that can work for both SVE and InStr

[clang] [llvm] [mlir] Move several vector intrinsics out of experimental namespace (PR #88748)

2024-04-26 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/88748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][SVE] Seperate the int and floating-point variants of addqv. (PR #89762)

2024-04-26 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/89762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][SVE] Seperate the int and floating-point variants of addqv. (PR #89762)

2024-04-23 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/89762 We only use common intrinsics for operations that treat their element type as a container of bits. >From ed27a2d1406dccf70e7189578cd6950b61961c1b Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 23

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

2024-02-28 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/82810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

2024-02-26 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/82810 >From a4c46459564bd8a8e5ca2a56fa643f866b7e869a Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 23 Feb 2024 18:26:10 + Subject: [PATCH] [LLVM][TypeSize] Remove default constructor. --- clang/lib

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

2024-02-23 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/82810 Implements the follow-on work requesting on https://github.com/llvm/llvm-project/pull/75614. >From a75304dffb77be1fb15f268000bfbdd07be774e1 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 23 Feb 20

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-19 Thread Paul Walker via cfe-commits
@@ -10570,6 +10570,26 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, return Builder.CreateCall(F, llvm::ConstantInt::get(Int32Ty, HintID)); } + if (BuiltinID == clang::AArch64::BI__builtin_arm_get_sme_state) { +// Create call to __arm_sme_sta

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-19 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/75791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-19 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. https://github.com/llvm/llvm-project/pull/75791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-19 Thread Paul Walker via cfe-commits
@@ -1600,6 +1600,25 @@ void SVEEmitter::createSMEHeader(raw_ostream &OS) { OS << "extern \"C\" {\n"; OS << "#endif\n\n"; + OS << "void __arm_za_disable(void) __arm_streaming_compatible;\n\n"; + + OS << "__ai bool __arm_has_sme(void) __arm_streaming_compatible {\n"; + OS

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-19 Thread Paul Walker via cfe-commits
@@ -10570,6 +10570,26 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, return Builder.CreateCall(F, llvm::ConstantInt::get(Int32Ty, HintID)); } + if (BuiltinID == clang::AArch64::BI__builtin_arm_get_sme_state) { +// Create call to __arm_sme_sta

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-18 Thread Paul Walker via cfe-commits
@@ -10570,6 +10570,26 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, return Builder.CreateCall(F, llvm::ConstantInt::get(Int32Ty, HintID)); } + if (BuiltinID == clang::AArch64::BI__builtin_arm_get_sme_state) { +// Create call to __arm_sme_sta

[clang] [Clang][AArch64] Add missing SME functions to header file. (PR #75791)

2023-12-18 Thread Paul Walker via cfe-commits
@@ -1600,6 +1600,25 @@ void SVEEmitter::createSMEHeader(raw_ostream &OS) { OS << "extern \"C\" {\n"; OS << "#endif\n\n"; + OS << "void __arm_za_disable(void) __arm_streaming_compatible;\n\n"; + + OS << "__ai bool __arm_has_sme(void) __arm_streaming_compatible {\n"; + OS

[llvm] [mlir] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-18 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm closed https://github.com/llvm/llvm-project/pull/75217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-15 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Turns out there was just a single extra instance, within MLIR. It's an interesting one though and I've noted it as it looks like I'll need to extend `ModuleImport::getConstantAsAttr` as part of the patch that enables direct VectorType support for ConstantInt/FP. https:/

[llvm] [clang] [mlir] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-15 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/75217 >From d19e9e20432c0dfe50bfba7cd782179653f42b2b Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 29 Nov 2023 14:45:06 + Subject: [PATCH] [LLVM][IR] Replace ConstantInt's specialisation of getType()

[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-13 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Just a note to say the PR is not complete because there are uses outside of clang and llvm that I need to port. https://github.com/llvm/llvm-project/pull/75217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-13 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/75217 >From b484b3c60b172fadb6fa600cdc15a865750867a8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 29 Nov 2023 14:45:06 + Subject: [PATCH] [LLVM][IR] Replace ConstantInt's specialisation of getType()

  1   2   >