Lines Matching full:gpr

254     : RVInstIUnary<imm12, funct3, opcode, (outs GPR:$rd), (ins GPR:$rs1),
260 : RVInstIShift<imm11_7, funct3, opcode, (outs GPR:$rd),
261 (ins GPR:$rs1, uimmlog2xlen:$shamt), opcodestr,
267 : RVInstIShiftW<imm11_5, funct3, opcode, (outs GPR:$rd),
268 (ins GPR:$rs1, uimm5:$shamt), opcodestr,
460 def : InstAlias<"zext.w $rd, $rs", (ADD_UW GPR:$rd, GPR:$rs, X0)>;
465 (RORI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
470 (RORIW GPR:$rd, GPR:$rs1, uimm5:$shamt), 0>;
475 (BSETI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
477 (BCLRI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
479 (BINVI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
481 (BEXTI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
485 def : InstAlias<"zext.h $rd, $rs", (PACK GPR:$rd, GPR:$rs, X0)>;
489 def : InstAlias<"zext.h $rd, $rs", (PACKW GPR:$rd, GPR:$rs, X0)>;
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)>;
533 def : Pat<(XLenVT (shiftop<shl> 1, (XLenVT GPR:$rs2))),
534 (BSET (XLenVT X0), GPR:$rs2)>;
535 def : Pat<(XLenVT (not (shiftop<shl> -1, (XLenVT GPR:$rs2)))),
536 (ADDI (XLenVT (BSET (XLenVT X0), GPR:$rs2)), -1)>;
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)>;
551 def : Pat<(XLenVT (or GPR:$r, BSETINVTwoBitsMask:$i)),
552 (BSETI (XLenVT (BSETI GPR:$r, (TrailingZeros BSETINVTwoBitsMask:$i))),
554 def : Pat<(XLenVT (xor GPR:$r, BSETINVTwoBitsMask:$i)),
555 (BINVI (XLenVT (BINVI GPR:$r, (TrailingZeros BSETINVTwoBitsMask:$i))),
557 def : Pat<(XLenVT (or GPR:$r, BSETINVORIMask:$i)),
558 (BSETI (XLenVT (ORI GPR:$r, (BSETINVORIMaskLow BSETINVORIMask:$i))),
560 def : Pat<(XLenVT (xor GPR:$r, BSETINVORIMask:$i)),
561 (BINVI (XLenVT (XORI GPR:$r, (BSETINVORIMaskLow BSETINVORIMask:$i))),
563 def : Pat<(XLenVT (and GPR:$r, BCLRITwoBitsMask:$i)),
564 (BCLRI (XLenVT (BCLRI GPR:$r, (BCLRITwoBitsMaskLow BCLRITwoBitsMask:$i))),
566 def : Pat<(XLenVT (and GPR:$r, BCLRIANDIMask:$i)),
567 (BCLRI (XLenVT (ANDI GPR:$r, (BCLRIANDIMaskLow BCLRIANDIMask:$i))),
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)>;
617 def : Pat<(or (and (shl GPR:$rs2, (XLenVT 8)), 0xFFFF),
618 (zexti8 (XLenVT GPR:$rs1))),
619 (PACKH GPR:$rs1, GPR:$rs2)>;
620 def : Pat<(or (shl (zexti8 (XLenVT GPR:$rs2)), (XLenVT 8)),
621 (zexti8 (XLenVT GPR:$rs1))),
622 (PACKH GPR:$rs1, GPR:$rs2)>;
623 def : Pat<(and (or (shl GPR:$rs2, (XLenVT 8)),
624 (zexti8 (XLenVT GPR:$rs1))), 0xFFFF),
625 (PACKH GPR:$rs1, GPR:$rs2)>;
627 def : Pat<(binop_allhusers<or> (shl GPR:$rs2, (XLenVT 8)),
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)>;
640 def : Pat<(binop_allwusers<or> (shl GPR:$rs2, (i64 16)),
641 (zexti16 (i64 GPR:$rs1))),
642 (PACKW GPR:$rs1, GPR:$rs2)>;
643 def : Pat<(i64 (or (sext_inreg (shl GPR:$rs2, (i64 16)), i32),
644 (zexti16 (i64 GPR:$rs1)))),
645 (PACKW GPR:$rs1, GPR:$rs2)>;
649 def : Pat<(i32 (and GPR:$rs, 0xFFFF)), (ZEXT_H_RV32 GPR:$rs)>;
651 def : Pat<(i64 (and GPR:$rs, 0xFFFF)), (ZEXT_H_RV64 GPR:$rs)>;
654 def : Pat<(i32 (and GPR:$rs, 0xFFFF)), (PACK GPR:$rs, (XLenVT X0))>;
656 def : Pat<(i64 (and GPR:$rs, 0xFFFF)), (PACKW GPR:$rs, (XLenVT X0))>;
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)>;
673 def : Pat<(add_like (XLenVT GPR:$r), CSImm12MulBy4:$i),
675 GPR:$r)>;
676 def : Pat<(add_like (XLenVT GPR:$r), CSImm12MulBy8:$i),
678 GPR:$r)>;
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)>;
692 def : Pat<(i64 (and GPR:$rs, 0xFFFFFFFF)), (ADD_UW GPR:$rs, (XLenVT X0))>;
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)>;
765 def : Pat<(i32 (and GPR:$rs, 0xFFFF)), (ZEXT_H_RV64 GPR:$rs)>;
769 def : Pat<(i32 (and GPR:$rs, 0xFFFF)), (PACKW GPR:$rs, (XLenVT X0))>;
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))>;
786 def : Pat<(or (and (shl GPR:$rs2, (i64 8)), 0xFFFF),
787 (zexti8i32 (i32 GPR:$rs1))),
788 (PACKH GPR:$rs1, GPR:$rs2)>;
789 def : Pat<(or (shl (zexti8i32 (i32 GPR:$rs2)), (i64 8)),
790 (zexti8i32 (i32 GPR:$rs1))),
791 (PACKH GPR:$rs1, GPR:$rs2)>;
792 def : Pat<(and (anyext (or (shl GPR:$rs2, (XLenVT 8)),
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)>;
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)>;
806 def : Pat<(zext GPR:$src), (ADD_UW GPR:$src, (XLenVT X0))>;
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)>;
831 def : Pat<(i32 (shiftop<shl> 1, (i64 GPR:$rs2))),
832 (BSET (XLenVT X0), GPR:$rs2)>;
833 def : Pat<(i32 (not (shiftop<shl> -1, (i64 GPR:$rs2)))),
834 (ADDI (i32 (BSET (XLenVT X0), GPR:$rs2)), -1)>;
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)))>;