@@ -1513,26 +1513,55 @@ let Predicates = [HasStdExtP] in {
15131513 def: Pat<(XLenVecI16VT (abds GPR:$rs1, GPR:$rs2)), (PABD_H GPR:$rs1, GPR:$rs2)>;
15141514 def: Pat<(XLenVecI16VT (abdu GPR:$rs1, GPR:$rs2)), (PABDU_H GPR:$rs1, GPR:$rs2)>;
15151515
1516- // 8-bit logical shift left patterns
1516+ // 8-bit logical shift left/right patterns
15171517 def: Pat<(XLenVecI8VT (shl GPR:$rs1, (XLenVecI8VT (splat_vector uimm3:$shamt)))),
15181518 (PSLLI_B GPR:$rs1, uimm3:$shamt)>;
1519+ def: Pat<(XLenVecI8VT (srl GPR:$rs1, (XLenVecI8VT (splat_vector uimm3:$shamt)))),
1520+ (PSRLI_B GPR:$rs1, uimm3:$shamt)>;
15191521
1520- // 16-bit logical shift left patterns
1522+ // 16-bit logical shift left/right patterns
15211523 def: Pat<(XLenVecI16VT (shl GPR:$rs1, (XLenVecI16VT (splat_vector uimm4:$shamt)))),
15221524 (PSLLI_H GPR:$rs1, uimm4:$shamt)>;
1525+ def: Pat<(XLenVecI16VT (srl GPR:$rs1, (XLenVecI16VT (splat_vector uimm4:$shamt)))),
1526+ (PSRLI_H GPR:$rs1, uimm4:$shamt)>;
1527+
1528+ // 8-bit arithmetic shift right patterns
1529+ def: Pat<(XLenVecI8VT (sra GPR:$rs1, (XLenVecI8VT (splat_vector uimm3:$shamt)))),
1530+ (PSRAI_B GPR:$rs1, uimm3:$shamt)>;
1531+
1532+ // 16-bit arithmetic shift right patterns
1533+ def: Pat<(XLenVecI16VT (sra GPR:$rs1, (XLenVecI16VT (splat_vector uimm4:$shamt)))),
1534+ (PSRAI_H GPR:$rs1, uimm4:$shamt)>;
15231535
15241536 // 16-bit signed saturation shift left patterns
15251537 def: Pat<(XLenVecI16VT (sshlsat GPR:$rs1, (XLenVecI16VT (splat_vector uimm4:$shamt)))),
15261538 (PSSLAI_H GPR:$rs1, uimm4:$shamt)>;
15271539
1528- // 8-bit logical shift left
1540+ // 8-bit logical shift left/right
15291541 def: Pat<(XLenVecI8VT (shl GPR:$rs1,
15301542 (XLenVecI8VT (splat_vector (XLenVT GPR:$rs2))))),
15311543 (PSLL_BS GPR:$rs1, GPR:$rs2)>;
1532- // 16-bit logical shift left
1544+ def: Pat<(XLenVecI8VT (srl GPR:$rs1,
1545+ (XLenVecI8VT (splat_vector (XLenVT GPR:$rs2))))),
1546+ (PSRL_BS GPR:$rs1, GPR:$rs2)>;
1547+
1548+ // 8-bit arithmetic shift left/right
1549+ def: Pat<(XLenVecI8VT (sra GPR:$rs1,
1550+ (XLenVecI8VT (splat_vector (XLenVT GPR:$rs2))))),
1551+ (PSRA_BS GPR:$rs1, GPR:$rs2)>;
1552+
1553+ // 16-bit logical shift left/right
15331554 def: Pat<(XLenVecI16VT (shl GPR:$rs1,
15341555 (XLenVecI16VT (splat_vector (XLenVT GPR:$rs2))))),
15351556 (PSLL_HS GPR:$rs1, GPR:$rs2)>;
1557+ def: Pat<(XLenVecI16VT (srl GPR:$rs1,
1558+ (XLenVecI16VT (splat_vector (XLenVT GPR:$rs2))))),
1559+ (PSRL_HS GPR:$rs1, GPR:$rs2)>;
1560+
1561+ // 16-bit arithmetic shift left/right
1562+ def: Pat<(XLenVecI16VT (sra GPR:$rs1,
1563+ (XLenVecI16VT (splat_vector (XLenVT GPR:$rs2))))),
1564+ (PSRA_HS GPR:$rs1, GPR:$rs2)>;
15361565
15371566 // 8-bit PLI SD node pattern
15381567 def: Pat<(XLenVecI8VT (splat_vector simm8_unsigned:$imm8)), (PLI_B simm8_unsigned:$imm8)>;
@@ -1580,16 +1609,28 @@ let Predicates = [HasStdExtP, IsRV64] in {
15801609 def: Pat<(v2i32 (riscv_pasub GPR:$rs1, GPR:$rs2)), (PASUB_W GPR:$rs1, GPR:$rs2)>;
15811610 def: Pat<(v2i32 (riscv_pasubu GPR:$rs1, GPR:$rs2)), (PASUBU_W GPR:$rs1, GPR:$rs2)>;
15821611
1583- // 32-bit logical shift left
1612+ // 32-bit logical shift left/right
15841613 def: Pat<(v2i32 (shl GPR:$rs1, (v2i32 (splat_vector (XLenVT GPR:$rs2))))),
15851614 (PSLL_WS GPR:$rs1, GPR:$rs2)>;
1615+ def: Pat<(v2i32 (srl GPR:$rs1, (v2i32 (splat_vector (XLenVT GPR:$rs2))))),
1616+ (PSRL_WS GPR:$rs1, GPR:$rs2)>;
1617+
1618+ // 32-bit arithmetic shift left/right
1619+ def: Pat<(v2i32 (sra GPR:$rs1, (v2i32 (splat_vector (XLenVT GPR:$rs2))))),
1620+ (PSRA_WS GPR:$rs1, GPR:$rs2)>;
15861621
15871622 // splat pattern
15881623 def: Pat<(v2i32 (splat_vector (XLenVT GPR:$rs2))), (PADD_WS (XLenVT X0), GPR:$rs2)>;
15891624
1590- // 32-bit logical shift left patterns
1625+ // 32-bit logical shift left/right patterns
15911626 def: Pat<(v2i32 (shl GPR:$rs1, (v2i32 (splat_vector uimm5:$shamt)))),
15921627 (PSLLI_W GPR:$rs1, uimm5:$shamt)>;
1628+ def: Pat<(v2i32 (srl GPR:$rs1, (v2i32 (splat_vector uimm5:$shamt)))),
1629+ (PSRLI_W GPR:$rs1, uimm5:$shamt)>;
1630+
1631+ // 32-bit arithmetic shift left/right patterns
1632+ def: Pat<(v2i32 (sra GPR:$rs1, (v2i32 (splat_vector uimm5:$shamt)))),
1633+ (PSRAI_W GPR:$rs1, uimm5:$shamt)>;
15931634
15941635 // 32-bit signed saturation shift left patterns
15951636 def: Pat<(v2i32 (sshlsat GPR:$rs1, (v2i32 (splat_vector uimm5:$shamt)))),
0 commit comments