@@ -5027,8 +5027,8 @@ static SDValue lowerVZIP(unsigned Opc, SDValue Op0, SDValue Op1,
50275027 const SDLoc &DL, SelectionDAG &DAG,
50285028 const RISCVSubtarget &Subtarget) {
50295029 assert(RISCVISD::RI_VZIPEVEN_VL == Opc || RISCVISD::RI_VZIPODD_VL == Opc ||
5030- RISCVISD::RI_VZIP2A_VL == Opc || RISCVISD::RI_VUNZIP2A_VL == Opc ||
5031- RISCVISD::RI_VUNZIP2B_VL == Opc);
5030+ RISCVISD::RI_VZIP2A_VL == Opc || RISCVISD::RI_VZIP2B_VL == Opc ||
5031+ RISCVISD::RI_VUNZIP2A_VL == Opc || RISCVISD:: RI_VUNZIP2B_VL == Opc);
50325032 assert(Op0.getSimpleValueType() == Op1.getSimpleValueType());
50335033
50345034 MVT VT = Op0.getSimpleValueType();
@@ -6944,7 +6944,7 @@ static bool hasPassthruOp(unsigned Opcode) {
69446944 Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
69456945 "not a RISC-V target specific op");
69466946 static_assert(
6947- RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 132 &&
6947+ RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 133 &&
69486948 RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
69496949 "adding target specific op should update this function");
69506950 if (Opcode >= RISCVISD::ADD_VL && Opcode <= RISCVISD::VFMAX_VL)
@@ -6968,7 +6968,7 @@ static bool hasMaskOp(unsigned Opcode) {
69686968 Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
69696969 "not a RISC-V target specific op");
69706970 static_assert(
6971- RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 132 &&
6971+ RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 133 &&
69726972 RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
69736973 "adding target specific op should update this function");
69746974 if (Opcode >= RISCVISD::TRUNCATE_VECTOR_VL && Opcode <= RISCVISD::SETCC_VL)
@@ -11762,6 +11762,17 @@ SDValue RISCVTargetLowering::lowerVECTOR_INTERLEAVE(SDValue Op,
1176211762 return DAG.getMergeValues(Loads, DL);
1176311763 }
1176411764
11765+ // Use ri.vzip2{a,b} if available
11766+ // TODO: Figure out the best lowering for the spread variants
11767+ if (Subtarget.hasVendorXRivosVizip() && !Op.getOperand(0).isUndef() &&
11768+ !Op.getOperand(1).isUndef()) {
11769+ SDValue V1 = Op->getOperand(0);
11770+ SDValue V2 = Op->getOperand(1);
11771+ SDValue Lo = lowerVZIP(RISCVISD::RI_VZIP2A_VL, V1, V2, DL, DAG, Subtarget);
11772+ SDValue Hi = lowerVZIP(RISCVISD::RI_VZIP2B_VL, V1, V2, DL, DAG, Subtarget);
11773+ return DAG.getMergeValues({Lo, Hi}, DL);
11774+ }
11775+
1176511776 // If the element type is smaller than ELEN, then we can interleave with
1176611777 // vwaddu.vv and vwmaccu.vx
1176711778 if (VecVT.getScalarSizeInBits() < Subtarget.getELen()) {
@@ -22265,6 +22276,7 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
2226522276 NODE_NAME_CASE(RI_VZIPEVEN_VL)
2226622277 NODE_NAME_CASE(RI_VZIPODD_VL)
2226722278 NODE_NAME_CASE(RI_VZIP2A_VL)
22279+ NODE_NAME_CASE(RI_VZIP2B_VL)
2226822280 NODE_NAME_CASE(RI_VUNZIP2A_VL)
2226922281 NODE_NAME_CASE(RI_VUNZIP2B_VL)
2227022282 NODE_NAME_CASE(READ_CSR)
0 commit comments