Lines Matching full:rs1
254 : RVInstIUnary<imm12, funct3, opcode, (outs GPR:$rd), (ins GPR:$rs1),
255 opcodestr, "$rd, $rs1">;
261 (ins GPR:$rs1, uimmlog2xlen:$shamt), opcodestr,
262 "$rd, $rs1, $shamt">;
268 (ins GPR:$rs1, uimm5:$shamt), opcodestr,
269 "$rd, $rs1, $shamt">;
464 def : InstAlias<"ror $rd, $rs1, $shamt",
465 (RORI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
469 def : InstAlias<"rorw $rd, $rs1, $shamt",
470 (RORIW GPR:$rd, GPR:$rs1, uimm5:$shamt), 0>;
474 def : InstAlias<"bset $rd, $rs1, $shamt",
475 (BSETI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
476 def : InstAlias<"bclr $rd, $rs1, $shamt",
477 (BCLRI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
478 def : InstAlias<"binv $rd, $rs1, $shamt",
479 (BINVI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
480 def : InstAlias<"bext $rd, $rs1, $shamt",
481 (BEXTI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
497 def : Pat<(XLenVT (and GPR:$rs1, (not GPR:$rs2))), (ANDN GPR:$rs1, GPR:$rs2)>;
498 def : Pat<(XLenVT (or GPR:$rs1, (not GPR:$rs2))), (ORN GPR:$rs1, GPR:$rs2)>;
499 def : Pat<(XLenVT (xor GPR:$rs1, (not GPR:$rs2))), (XNOR GPR:$rs1, GPR:$rs2)>;
509 def : Pat<(XLenVT (rotl GPR:$rs1, uimmlog2xlen:$shamt)),
510 (RORI GPR:$rs1, (ImmSubFromXLen uimmlog2xlen:$shamt))>;
517 def : Pat<(riscv_rolw GPR:$rs1, uimm5:$rs2),
518 (RORIW GPR:$rs1, (ImmSubFrom32 uimm5:$rs2))>;
522 def : Pat<(XLenVT (and (not (shiftop<shl> 1, (XLenVT GPR:$rs2))), GPR:$rs1)),
523 (BCLR GPR:$rs1, GPR:$rs2)>;
524 def : Pat<(XLenVT (and (rotl -2, (XLenVT GPR:$rs2)), GPR:$rs1)),
525 (BCLR GPR:$rs1, GPR:$rs2)>;
526 def : Pat<(XLenVT (or (shiftop<shl> 1, (XLenVT GPR:$rs2)), GPR:$rs1)),
527 (BSET GPR:$rs1, GPR:$rs2)>;
528 def : Pat<(XLenVT (xor (shiftop<shl> 1, (XLenVT GPR:$rs2)), GPR:$rs1)),
529 (BINV GPR:$rs1, GPR:$rs2)>;
530 def : Pat<(XLenVT (and (shiftop<srl> GPR:$rs1, (XLenVT GPR:$rs2)), 1)),
531 (BEXT GPR:$rs1, GPR:$rs2)>;
538 def : Pat<(XLenVT (and GPR:$rs1, BCLRMask:$mask)),
539 (BCLRI GPR:$rs1, BCLRMask:$mask)>;
540 def : Pat<(XLenVT (or GPR:$rs1, SingleBitSetMask:$mask)),
541 (BSETI GPR:$rs1, SingleBitSetMask:$mask)>;
542 def : Pat<(XLenVT (xor GPR:$rs1, SingleBitSetMask:$mask)),
543 (BINVI GPR:$rs1, SingleBitSetMask:$mask)>;
545 def : Pat<(XLenVT (and (srl GPR:$rs1, uimmlog2xlen:$shamt), (XLenVT 1))),
546 (BEXTI GPR:$rs1, uimmlog2xlen:$shamt)>;
548 def : Pat<(XLenVT (seteq (XLenVT (and GPR:$rs1, SingleBitSetMask:$mask)), 0)),
549 (BEXTI (XLenVT (XORI GPR:$rs1, -1)), SingleBitSetMask:$mask)>;
592 def : Pat<(i64 (ctpop (i64 (zexti32 (i64 GPR:$rs1))))), (CPOPW GPR:$rs1)>;
594 def : Pat<(i64 (riscv_absw GPR:$rs1)),
595 (MAX GPR:$rs1, (XLenVT (SUBW (XLenVT X0), GPR:$rs1)))>;
599 def : Pat<(XLenVT (sext_inreg GPR:$rs1, i8)), (SEXT_B GPR:$rs1)>;
600 def : Pat<(XLenVT (sext_inreg GPR:$rs1, i16)), (SEXT_H GPR:$rs1)>;
618 (zexti8 (XLenVT GPR:$rs1))),
619 (PACKH GPR:$rs1, GPR:$rs2)>;
621 (zexti8 (XLenVT GPR:$rs1))),
622 (PACKH GPR:$rs1, GPR:$rs2)>;
624 (zexti8 (XLenVT GPR:$rs1))), 0xFFFF),
625 (PACKH GPR:$rs1, GPR:$rs2)>;
628 (zexti8 (XLenVT GPR:$rs1))),
629 (PACKH GPR:$rs1, GPR:$rs2)>;
633 def : Pat<(i32 (or (zexti16 (i32 GPR:$rs1)), (shl GPR:$rs2, (i32 16)))),
634 (PACK GPR:$rs1, GPR:$rs2)>;
637 def : Pat<(i64 (or (zexti32 (i64 GPR:$rs1)), (shl GPR:$rs2, (i64 32)))),
638 (PACK GPR:$rs1, GPR:$rs2)>;
641 (zexti16 (i64 GPR:$rs1))),
642 (PACKW GPR:$rs1, GPR:$rs2)>;
644 (zexti16 (i64 GPR:$rs1)))),
645 (PACKW GPR:$rs1, GPR:$rs2)>;
662 def : Pat<(XLenVT (add_like_non_imm12 (shl GPR:$rs1, (XLenVT i)), GPR:$rs2)),
663 (shxadd GPR:$rs1, GPR:$rs2)>;
664 def : Pat<(XLenVT (riscv_shl_add GPR:$rs1, (XLenVT i), GPR:$rs2)),
665 (shxadd GPR:$rs1, GPR:$rs2)>;
669 def : Pat<(XLenVT (add_like_non_imm12 pat:$rs1, GPR:$rs2)),
670 (shxadd pat:$rs1, GPR:$rs2)>;
683 def : Pat<(i64 (shl (and GPR:$rs1, 0xFFFFFFFF), uimm5:$shamt)),
684 (SLLI_UW GPR:$rs1, uimm5:$shamt)>;
687 def : Pat<(i64 (and GPR:$rs1, Shifted32OnesMask:$mask)),
688 (SLLI_UW (XLenVT (SRLI GPR:$rs1, Shifted32OnesMask:$mask)),
690 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0xFFFFFFFF), GPR:$rs2)),
691 (ADD_UW GPR:$rs1, GPR:$rs2)>;
696 def : Pat<(i64 (add_like_non_imm12 (shl (and GPR:$rs1, 0xFFFFFFFF), (i64 i)), (XLenVT GPR:$rs2))),
697 (shxadd_uw GPR:$rs1, GPR:$rs2)>;
698 def : Pat<(i64 (riscv_shl_add (and GPR:$rs1, 0xFFFFFFFF), (i64 i), GPR:$rs2)),
699 (shxadd_uw GPR:$rs1, GPR:$rs2)>;
702 def : Pat<(i64 (add_like_non_imm12 (and (shl GPR:$rs1, (i64 1)), 0x1FFFFFFFF), (XLenVT GPR:$rs2))),
703 (SH1ADD_UW GPR:$rs1, GPR:$rs2)>;
704 def : Pat<(i64 (add_like_non_imm12 (and (shl GPR:$rs1, (i64 2)), 0x3FFFFFFFF), (XLenVT GPR:$rs2))),
705 (SH2ADD_UW GPR:$rs1, GPR:$rs2)>;
706 def : Pat<(i64 (add_like_non_imm12 (and (shl GPR:$rs1, (i64 3)), 0x7FFFFFFFF), (XLenVT GPR:$rs2))),
707 (SH3ADD_UW GPR:$rs1, GPR:$rs2)>;
712 def : Pat<(i64 (add_like_non_imm12 pat:$rs1, (XLenVT GPR:$rs2))),
713 (!cast<Instruction>("SH"#i#"ADD_UW") pat:$rs1, GPR:$rs2)>;
716 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0xFFFFFFFE), (XLenVT GPR:$rs2))),
717 (SH1ADD (XLenVT (SRLIW GPR:$rs1, 1)), GPR:$rs2)>;
718 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0xFFFFFFFC), (XLenVT GPR:$rs2))),
719 (SH2ADD (XLenVT (SRLIW GPR:$rs1, 2)), GPR:$rs2)>;
720 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0xFFFFFFF8), (XLenVT GPR:$rs2))),
721 (SH3ADD (XLenVT (SRLIW GPR:$rs1, 3)), GPR:$rs2)>;
724 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0x1FFFFFFFE), (XLenVT GPR:$rs2))),
725 (SH1ADD_UW (XLenVT (SRLI GPR:$rs1, 1)), GPR:$rs2)>;
726 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0x3FFFFFFFC), (XLenVT GPR:$rs2))),
727 (SH2ADD_UW (XLenVT (SRLI GPR:$rs1, 2)), GPR:$rs2)>;
728 def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0x7FFFFFFF8), (XLenVT GPR:$rs2))),
729 (SH3ADD_UW (XLenVT (SRLI GPR:$rs1, 3)), GPR:$rs2)>;
762 def : Pat<(i32 (sext_inreg GPR:$rs1, i8)), (SEXT_B GPR:$rs1)>;
763 def : Pat<(i32 (sext_inreg GPR:$rs1, i16)), (SEXT_H GPR:$rs1)>;
773 def : Pat<(i32 (and GPR:$rs1, (not GPR:$rs2))), (ANDN GPR:$rs1, GPR:$rs2)>;
774 def : Pat<(i32 (or GPR:$rs1, (not GPR:$rs2))), (ORN GPR:$rs1, GPR:$rs2)>;
775 def : Pat<(i32 (xor GPR:$rs1, (not GPR:$rs2))), (XNOR GPR:$rs1, GPR:$rs2)>;
781 def : Pat<(i32 (rotl GPR:$rs1, uimm5:$rs2)),
782 (RORIW GPR:$rs1, (ImmSubFrom32 uimm5:$rs2))>;
787 (zexti8i32 (i32 GPR:$rs1))),
788 (PACKH GPR:$rs1, GPR:$rs2)>;
790 (zexti8i32 (i32 GPR:$rs1))),
791 (PACKH GPR:$rs1, GPR:$rs2)>;
793 (zexti8i32 (i32 GPR:$rs1)))), 0xFFFF),
794 (PACKH GPR:$rs1, GPR:$rs2)>;
796 def : Pat<(i32 (or (shl GPR:$rs2, (i64 16)), (zexti16i32 (i32 GPR:$rs1)))),
797 (PACKW GPR:$rs1, GPR:$rs2)>;
801 def : Pat<(shl (i64 (zext i32:$rs1)), uimm5:$shamt),
802 (SLLI_UW GPR:$rs1, uimm5:$shamt)>;
804 def : Pat<(i64 (add_like_non_imm12 (zext GPR:$rs1), GPR:$rs2)),
805 (ADD_UW GPR:$rs1, GPR:$rs2)>;
810 def : Pat<(i32 (add_like_non_imm12 (shl GPR:$rs1, (i64 i)), GPR:$rs2)),
811 (shxadd GPR:$rs1, GPR:$rs2)>;
812 def : Pat<(i32 (riscv_shl_add GPR:$rs1, (i32 i), GPR:$rs2)),
813 (shxadd GPR:$rs1, GPR:$rs2)>;
818 def : Pat<(i32 (and (not (shiftop<shl> 1, (i64 GPR:$rs2))), GPR:$rs1)),
819 (BCLR GPR:$rs1, GPR:$rs2)>;
820 def : Pat<(i32 (and (rotl -2, (i64 GPR:$rs2)), GPR:$rs1)),
821 (BCLR GPR:$rs1, GPR:$rs2)>;
822 def : Pat<(i32 (or (shiftop<shl> 1, (i64 GPR:$rs2)), GPR:$rs1)),
823 (BSET GPR:$rs1, GPR:$rs2)>;
824 def : Pat<(i32 (xor (shiftop<shl> 1, (i64 GPR:$rs2)), GPR:$rs1)),
825 (BINV GPR:$rs1, GPR:$rs2)>;
826 def : Pat<(i32 (and (shiftop<srl> GPR:$rs1, (i64 GPR:$rs2)), 1)),
827 (BEXT GPR:$rs1, GPR:$rs2)>;
828 def : Pat<(i64 (and (anyext (i32 (shiftop<srl> GPR:$rs1, (i64 GPR:$rs2)))), 1)),
829 (BEXT GPR:$rs1, GPR:$rs2)>;
836 def : Pat<(i32 (and (srl GPR:$rs1, uimm5:$shamt), (i32 1))),
837 (BEXTI GPR:$rs1, uimm5:$shamt)>;
839 def : Pat<(i32 (and GPR:$rs1, BCLRMaski32:$mask)),
840 (BCLRI GPR:$rs1, (i64 (BCLRXForm $mask)))>;
841 def : Pat<(i32 (or GPR:$rs1, SingleBitSetMaski32:$mask)),
842 (BSETI GPR:$rs1, (i64 (SingleBitSetMaskToIndex $mask)))>;
843 def : Pat<(i32 (xor GPR:$rs1, SingleBitSetMaski32:$mask)),
844 (BINVI GPR:$rs1, (i64 (SingleBitSetMaskToIndex $mask)))>;