@@ -5018,8 +5018,8 @@ static SDValue lowerVZIP(unsigned Opc, SDValue Op0, SDValue Op1,
50185018 const SDLoc &DL, SelectionDAG &DAG,
50195019 const RISCVSubtarget &Subtarget) {
50205020 assert(RISCVISD::RI_VZIPEVEN_VL == Opc || RISCVISD::RI_VZIPODD_VL == Opc ||
5021- RISCVISD::RI_VZIP2A_VL == Opc || RISCVISD::RI_VUNZIP2A_VL == Opc ||
5022- RISCVISD::RI_VUNZIP2B_VL == Opc);
5021+ RISCVISD::RI_VZIP2A_VL == Opc || RISCVISD::RI_VZIP2B_VL == Opc ||
5022+ RISCVISD::RI_VUNZIP2A_VL == Opc || RISCVISD:: RI_VUNZIP2B_VL == Opc);
50235023 assert(Op0.getSimpleValueType() == Op1.getSimpleValueType());
50245024
50255025 MVT VT = Op0.getSimpleValueType();
@@ -6935,7 +6935,7 @@ static bool hasPassthruOp(unsigned Opcode) {
69356935 Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
69366936 "not a RISC-V target specific op");
69376937 static_assert(
6938- RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 132 &&
6938+ RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 133 &&
69396939 RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
69406940 "adding target specific op should update this function");
69416941 if (Opcode >= RISCVISD::ADD_VL && Opcode <= RISCVISD::VFMAX_VL)
@@ -6959,7 +6959,7 @@ static bool hasMaskOp(unsigned Opcode) {
69596959 Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
69606960 "not a RISC-V target specific op");
69616961 static_assert(
6962- RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 132 &&
6962+ RISCVISD::LAST_VL_VECTOR_OP - RISCVISD::FIRST_VL_VECTOR_OP == 133 &&
69636963 RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
69646964 "adding target specific op should update this function");
69656965 if (Opcode >= RISCVISD::TRUNCATE_VECTOR_VL && Opcode <= RISCVISD::SETCC_VL)
@@ -11753,6 +11753,17 @@ SDValue RISCVTargetLowering::lowerVECTOR_INTERLEAVE(SDValue Op,
1175311753 return DAG.getMergeValues(Loads, DL);
1175411754 }
1175511755
11756+ // Use ri.vzip2{a,b} if available
11757+ // TODO: Figure out the best lowering for the spread variants
11758+ if (Subtarget.hasVendorXRivosVizip() &&
11759+ !Op.getOperand(0).isUndef() && !Op.getOperand(1).isUndef()) {
11760+ SDValue V1 = Op->getOperand(0);
11761+ SDValue V2 = Op->getOperand(1);
11762+ SDValue Lo = lowerVZIP(RISCVISD::RI_VZIP2A_VL, V1, V2, DL, DAG, Subtarget);
11763+ SDValue Hi = lowerVZIP(RISCVISD::RI_VZIP2B_VL, V1, V2, DL, DAG, Subtarget);
11764+ return DAG.getMergeValues({Lo, Hi}, DL);
11765+ }
11766+
1175611767 // If the element type is smaller than ELEN, then we can interleave with
1175711768 // vwaddu.vv and vwmaccu.vx
1175811769 if (VecVT.getScalarSizeInBits() < Subtarget.getELen()) {
@@ -22256,6 +22267,7 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
2225622267 NODE_NAME_CASE(RI_VZIPEVEN_VL)
2225722268 NODE_NAME_CASE(RI_VZIPODD_VL)
2225822269 NODE_NAME_CASE(RI_VZIP2A_VL)
22270+ NODE_NAME_CASE(RI_VZIP2B_VL)
2225922271 NODE_NAME_CASE(RI_VUNZIP2A_VL)
2226022272 NODE_NAME_CASE(RI_VUNZIP2B_VL)
2226122273 NODE_NAME_CASE(READ_CSR)
0 commit comments