@@ -5027,8 +5027,8 @@ static SDValue lowerVZIP(unsigned Opc, SDValue Op0, SDValue Op1,
5027
5027
const SDLoc &DL, SelectionDAG &DAG,
5028
5028
const RISCVSubtarget &Subtarget) {
5029
5029
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);
5032
5032
assert(Op0.getSimpleValueType() == Op1.getSimpleValueType());
5033
5033
5034
5034
MVT VT = Op0.getSimpleValueType();
@@ -6944,7 +6944,7 @@ static bool hasPassthruOp(unsigned Opcode) {
6944
6944
Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
6945
6945
"not a RISC-V target specific op");
6946
6946
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 &&
6948
6948
RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
6949
6949
"adding target specific op should update this function");
6950
6950
if (Opcode >= RISCVISD::ADD_VL && Opcode <= RISCVISD::VFMAX_VL)
@@ -6968,7 +6968,7 @@ static bool hasMaskOp(unsigned Opcode) {
6968
6968
Opcode <= RISCVISD::LAST_STRICTFP_OPCODE &&
6969
6969
"not a RISC-V target specific op");
6970
6970
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 &&
6972
6972
RISCVISD::LAST_STRICTFP_OPCODE - RISCVISD::FIRST_STRICTFP_OPCODE == 21 &&
6973
6973
"adding target specific op should update this function");
6974
6974
if (Opcode >= RISCVISD::TRUNCATE_VECTOR_VL && Opcode <= RISCVISD::SETCC_VL)
@@ -11762,6 +11762,17 @@ SDValue RISCVTargetLowering::lowerVECTOR_INTERLEAVE(SDValue Op,
11762
11762
return DAG.getMergeValues(Loads, DL);
11763
11763
}
11764
11764
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
+
11765
11776
// If the element type is smaller than ELEN, then we can interleave with
11766
11777
// vwaddu.vv and vwmaccu.vx
11767
11778
if (VecVT.getScalarSizeInBits() < Subtarget.getELen()) {
@@ -22265,6 +22276,7 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
22265
22276
NODE_NAME_CASE(RI_VZIPEVEN_VL)
22266
22277
NODE_NAME_CASE(RI_VZIPODD_VL)
22267
22278
NODE_NAME_CASE(RI_VZIP2A_VL)
22279
+ NODE_NAME_CASE(RI_VZIP2B_VL)
22268
22280
NODE_NAME_CASE(RI_VUNZIP2A_VL)
22269
22281
NODE_NAME_CASE(RI_VUNZIP2B_VL)
22270
22282
NODE_NAME_CASE(READ_CSR)
0 commit comments