@@ -5707,14 +5707,12 @@ SDValue AArch64TargetLowering::LowerINTRINSIC_VOID(SDValue Op,
5707
5707
return DAG.getNode(
5708
5708
AArch64ISD::SMSTART, DL, DAG.getVTList(MVT::Other, MVT::Glue),
5709
5709
Op->getOperand(0), // Chain
5710
- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
5711
- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
5710
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
5712
5711
case Intrinsic::aarch64_sme_za_disable:
5713
5712
return DAG.getNode(
5714
5713
AArch64ISD::SMSTOP, DL, DAG.getVTList(MVT::Other, MVT::Glue),
5715
5714
Op->getOperand(0), // Chain
5716
- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
5717
- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
5715
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
5718
5716
}
5719
5717
}
5720
5718
@@ -8587,18 +8585,22 @@ SDValue AArch64TargetLowering::changeStreamingMode(SelectionDAG &DAG, SDLoc DL,
8587
8585
SDValue RegMask = DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask());
8588
8586
SDValue MSROp =
8589
8587
DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32);
8590
- SDValue ConditionOp = DAG.getTargetConstant(Condition, DL, MVT::i64) ;
8591
- SmallVector<SDValue> Ops = {Chain, MSROp, ConditionOp} ;
8588
+ SmallVector< SDValue> Ops = {Chain, MSROp} ;
8589
+ unsigned Opcode ;
8592
8590
if (Condition != AArch64SME::Always) {
8591
+ SDValue ConditionOp = DAG.getTargetConstant(Condition, DL, MVT::i64);
8592
+ Opcode = Enable ? AArch64ISD::COND_SMSTART : AArch64ISD::COND_SMSTOP;
8593
8593
assert(PStateSM && "PStateSM should be defined");
8594
+ Ops.push_back(ConditionOp);
8594
8595
Ops.push_back(PStateSM);
8596
+ } else {
8597
+ Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
8595
8598
}
8596
8599
Ops.push_back(RegMask);
8597
8600
8598
8601
if (InGlue)
8599
8602
Ops.push_back(InGlue);
8600
8603
8601
- unsigned Opcode = Enable ? AArch64ISD::SMSTART : AArch64ISD::SMSTOP;
8602
8604
return DAG.getNode(Opcode, DL, DAG.getVTList(MVT::Other, MVT::Glue), Ops);
8603
8605
}
8604
8606
@@ -8864,8 +8866,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
8864
8866
if (DisableZA)
8865
8867
Chain = DAG.getNode(
8866
8868
AArch64ISD::SMSTOP, DL, DAG.getVTList(MVT::Other, MVT::Glue), Chain,
8867
- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
8868
- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
8869
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
8869
8870
8870
8871
// Adjust the stack pointer for the new arguments...
8871
8872
// These operations are automatically eliminated by the prolog/epilog pass
@@ -9343,8 +9344,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
9343
9344
// Unconditionally resume ZA.
9344
9345
Result = DAG.getNode(
9345
9346
AArch64ISD::SMSTART, DL, DAG.getVTList(MVT::Other, MVT::Glue), Result,
9346
- DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
9347
- DAG.getConstant(AArch64SME::Always, DL, MVT::i64));
9347
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32));
9348
9348
9349
9349
if (ShouldPreserveZT0)
9350
9350
Result =
0 commit comments