@@ -5664,15 +5664,23 @@ RISCVTargetLowering::lowerFixedLengthVectorLoadToRVV(SDValue Op,
5664
5664
" Expecting a correctly-aligned load" );
5665
5665
5666
5666
MVT VT = Op.getSimpleValueType ();
5667
+ MVT XLenVT = Subtarget.getXLenVT ();
5667
5668
MVT ContainerVT = getContainerForFixedLengthVector (VT);
5668
5669
5669
- SDValue VL =
5670
- DAG.getConstant (VT.getVectorNumElements (), DL, Subtarget.getXLenVT ());
5670
+ SDValue VL = DAG.getConstant (VT.getVectorNumElements (), DL, XLenVT);
5671
5671
5672
+ bool IsMaskOp = VT.getVectorElementType () == MVT::i1;
5673
+ SDValue IntID = DAG.getTargetConstant (
5674
+ IsMaskOp ? Intrinsic::riscv_vlm : Intrinsic::riscv_vle, DL, XLenVT);
5675
+ SmallVector<SDValue, 4 > Ops{Load->getChain (), IntID};
5676
+ if (!IsMaskOp)
5677
+ Ops.push_back (DAG.getUNDEF (ContainerVT));
5678
+ Ops.push_back (Load->getBasePtr ());
5679
+ Ops.push_back (VL);
5672
5680
SDVTList VTs = DAG.getVTList ({ContainerVT, MVT::Other});
5673
- SDValue NewLoad = DAG. getMemIntrinsicNode (
5674
- RISCVISD::VLE_VL , DL, VTs, {Load-> getChain (), Load-> getBasePtr (), VL} ,
5675
- Load->getMemoryVT (), Load->getMemOperand ());
5681
+ SDValue NewLoad =
5682
+ DAG. getMemIntrinsicNode (ISD::INTRINSIC_W_CHAIN , DL, VTs, Ops ,
5683
+ Load->getMemoryVT (), Load->getMemOperand ());
5676
5684
5677
5685
SDValue Result = convertFromScalableVector (VT, NewLoad, DAG, Subtarget);
5678
5686
return DAG.getMergeValues ({Result, Load->getChain ()}, DL);
@@ -5691,6 +5699,7 @@ RISCVTargetLowering::lowerFixedLengthVectorStoreToRVV(SDValue Op,
5691
5699
5692
5700
SDValue StoreVal = Store->getValue ();
5693
5701
MVT VT = StoreVal.getSimpleValueType ();
5702
+ MVT XLenVT = Subtarget.getXLenVT ();
5694
5703
5695
5704
// If the size less than a byte, we need to pad with zeros to make a byte.
5696
5705
if (VT.getVectorElementType () == MVT::i1 && VT.getVectorNumElements () < 8 ) {
@@ -5702,14 +5711,17 @@ RISCVTargetLowering::lowerFixedLengthVectorStoreToRVV(SDValue Op,
5702
5711
5703
5712
MVT ContainerVT = getContainerForFixedLengthVector (VT);
5704
5713
5705
- SDValue VL =
5706
- DAG.getConstant (VT.getVectorNumElements (), DL, Subtarget.getXLenVT ());
5714
+ SDValue VL = DAG.getConstant (VT.getVectorNumElements (), DL, XLenVT);
5707
5715
5708
5716
SDValue NewValue =
5709
5717
convertToScalableVector (ContainerVT, StoreVal, DAG, Subtarget);
5718
+
5719
+ bool IsMaskOp = VT.getVectorElementType () == MVT::i1;
5720
+ SDValue IntID = DAG.getTargetConstant (
5721
+ IsMaskOp ? Intrinsic::riscv_vsm : Intrinsic::riscv_vse, DL, XLenVT);
5710
5722
return DAG.getMemIntrinsicNode (
5711
- RISCVISD::VSE_VL , DL, DAG.getVTList (MVT::Other),
5712
- {Store->getChain (), NewValue, Store->getBasePtr (), VL},
5723
+ ISD::INTRINSIC_VOID , DL, DAG.getVTList (MVT::Other),
5724
+ {Store->getChain (), IntID, NewValue, Store->getBasePtr (), VL},
5713
5725
Store->getMemoryVT (), Store->getMemOperand ());
5714
5726
}
5715
5727
@@ -10826,8 +10838,6 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
10826
10838
NODE_NAME_CASE (VSEXT_VL)
10827
10839
NODE_NAME_CASE (VZEXT_VL)
10828
10840
NODE_NAME_CASE (VCPOP_VL)
10829
- NODE_NAME_CASE (VLE_VL)
10830
- NODE_NAME_CASE (VSE_VL)
10831
10841
NODE_NAME_CASE (READ_CSR)
10832
10842
NODE_NAME_CASE (WRITE_CSR)
10833
10843
NODE_NAME_CASE (SWAP_CSR)
0 commit comments