@@ -2726,6 +2726,8 @@ const char *AArch64TargetLowering::getTargetNodeName(unsigned Opcode) const {
2726
2726
MAKE_CASE(AArch64ISD::VG_RESTORE)
2727
2727
MAKE_CASE(AArch64ISD::SMSTART)
2728
2728
MAKE_CASE(AArch64ISD::SMSTOP)
2729
+ MAKE_CASE(AArch64ISD::COND_SMSTART)
2730
+ MAKE_CASE(AArch64ISD::COND_SMSTOP)
2729
2731
MAKE_CASE(AArch64ISD::RESTORE_ZA)
2730
2732
MAKE_CASE(AArch64ISD::RESTORE_ZT)
2731
2733
MAKE_CASE(AArch64ISD::SAVE_ZT)
@@ -6033,14 +6035,12 @@ SDValue AArch64TargetLowering::LowerINTRINSIC_VOID(SDValue Op,
6033
6035
return DAG.getNode(
6034
6036
AArch64ISD::SMSTART, DL, MVT::Other,
6035
6037
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));
6038
6039
case Intrinsic::aarch64_sme_za_disable:
6039
6040
return DAG.getNode(
6040
6041
AArch64ISD::SMSTOP, DL, MVT::Other,
6041
6042
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));
6044
6044
}
6045
6045
}
6046
6046
@@ -8927,18 +8927,22 @@ SDValue AArch64TargetLowering::changeStreamingMode(SelectionDAG &DAG, SDLoc DL,
8927
8927
SDValue RegMask = DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask());
8928
8928
SDValue MSROp =
8929
8929
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 ;
8932
8932
if (Condition != AArch64SME::Always) {
8933
+ SDValue ConditionOp = DAG.getTargetConstant(Condition, DL, MVT::i64);
8934
+ Opcode = Enable ? AArch64ISD::COND_SMSTART : AArch64ISD::COND_SMSTOP;
8933
8935
assert(PStateSM && "PStateSM should be defined");
8936
+ Ops.push_back(ConditionOp);
8934
8937
Ops.push_back(PStateSM);
8938
+ } else {
8939
+ Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
8935
8940
}
8936
8941
Ops.push_back(RegMask);
8937
8942
8938
8943
if (InGlue)
8939
8944
Ops.push_back(InGlue);
8940
8945
8941
- unsigned Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
8942
8946
return DAG.getNode(Opcode, DL, DAG.getVTList(MVT::Other, MVT::Glue), Ops);
8943
8947
}
8944
8948
@@ -9203,9 +9207,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
9203
9207
9204
9208
if (DisableZA)
9205
9209
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));
9209
9212
9210
9213
// Adjust the stack pointer for the new arguments...
9211
9214
// These operations are automatically eliminated by the prolog/epilog pass
@@ -9682,9 +9685,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
9682
9685
if (CallAttrs.requiresEnablingZAAfterCall())
9683
9686
// Unconditionally resume ZA.
9684
9687
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));
9688
9690
9689
9691
if (ShouldPreserveZT0)
9690
9692
Result =
0 commit comments