@@ -2726,6 +2726,8 @@ const char *AArch64TargetLowering::getTargetNodeName(unsigned Opcode) const {
27262726 MAKE_CASE(AArch64ISD::VG_RESTORE)
27272727 MAKE_CASE(AArch64ISD::SMSTART)
27282728 MAKE_CASE(AArch64ISD::SMSTOP)
2729+ MAKE_CASE(AArch64ISD::COND_SMSTART)
2730+ MAKE_CASE(AArch64ISD::COND_SMSTOP)
27292731 MAKE_CASE(AArch64ISD::RESTORE_ZA)
27302732 MAKE_CASE(AArch64ISD::RESTORE_ZT)
27312733 MAKE_CASE(AArch64ISD::SAVE_ZT)
@@ -6033,14 +6035,12 @@ SDValue AArch64TargetLowering::LowerINTRINSIC_VOID(SDValue Op,
60336035 return DAG.getNode(
60346036 AArch64ISD::SMSTART, DL, MVT::Other,
60356037 Op->getOperand(0), // Chain
6036- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
6037- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
6038+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
60386039 case Intrinsic::aarch64_sme_za_disable:
60396040 return DAG.getNode(
60406041 AArch64ISD::SMSTOP, DL, MVT::Other,
60416042 Op->getOperand(0), // Chain
6042- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
6043- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
6043+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
60446044 }
60456045}
60466046
@@ -8927,18 +8927,22 @@ SDValue AArch64TargetLowering::changeStreamingMode(SelectionDAG &DAG, SDLoc DL,
89278927 SDValue RegMask = DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask());
89288928 SDValue MSROp =
89298929 DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32);
8930- SDValue ConditionOp = DAG.getTargetConstant(Condition, DL, MVT::i64) ;
8931- SmallVector<SDValue> Ops = {Chain, MSROp, ConditionOp} ;
8930+ SmallVector< SDValue> Ops = {Chain, MSROp} ;
8931+ unsigned Opcode ;
89328932 if (Condition != AArch64SME::Always) {
8933+ SDValue ConditionOp = DAG.getTargetConstant(Condition, DL, MVT::i64);
8934+ Opcode = Enable ? AArch64ISD::COND_SMSTART : AArch64ISD::COND_SMSTOP;
89338935 assert(PStateSM && "PStateSM should be defined");
8936+ Ops.push_back(ConditionOp);
89348937 Ops.push_back(PStateSM);
8938+ } else {
8939+ Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
89358940 }
89368941 Ops.push_back(RegMask);
89378942
89388943 if (InGlue)
89398944 Ops.push_back(InGlue);
89408945
8941- unsigned Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
89428946 return DAG.getNode(Opcode, DL, DAG.getVTList(MVT::Other, MVT::Glue), Ops);
89438947}
89448948
@@ -9203,9 +9207,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
92039207
92049208 if (DisableZA)
92059209 Chain = DAG.getNode(
9206- AArch64ISD::SMSTOP, DL, MVT::Other, Chain,
9207- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
9208- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
9210+ AArch64ISD::SMSTOP, DL, DAG.getVTList(MVT::Other, MVT::Glue), Chain,
9211+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
92099212
92109213 // Adjust the stack pointer for the new arguments...
92119214 // These operations are automatically eliminated by the prolog/epilog pass
@@ -9682,9 +9685,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
96829685 if (CallAttrs.requiresEnablingZAAfterCall())
96839686 // Unconditionally resume ZA.
96849687 Result = DAG.getNode(
9685- AArch64ISD::SMSTART, DL, MVT::Other, Result,
9686- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
9687- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
9688+ AArch64ISD::SMSTART, DL, DAG.getVTList(MVT::Other, MVT::Glue), Result,
9689+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
96889690
96899691 if (ShouldPreserveZT0)
96909692 Result =
0 commit comments