Home | History | Annotate | Download | only in SystemZ

Lines Matching refs:RXSBG

263   // Try to update RxSBG so that only the bits of RxSBG.Input in Mask are used.
265 bool refineRxSBGMask(RxSBGOperands &RxSBG, uint64_t Mask) const;
267 // Try to fold some of RxSBG.Input into other fields of RxSBG.
269 bool expandRxSBG(RxSBGOperands &RxSBG) const;
679 bool SystemZDAGToDAGISel::refineRxSBGMask(RxSBGOperands &RxSBG,
682 if (RxSBG.Rotate != 0)
683 Mask = (Mask << RxSBG.Rotate) | (Mask >> (64 - RxSBG.Rotate));
684 Mask &= RxSBG.Mask;
685 if (TII->isRxSBGMask(Mask, RxSBG.BitSize, RxSBG.Start, RxSBG.End)) {
686 RxSBG.Mask = Mask;
692 // Return true if any bits of (RxSBG.Input & Mask) are significant.
693 static bool maskMatters(RxSBGOperands &RxSBG, uint64_t Mask) {
694 // Rotate the mask in the same way as RxSBG.Input is rotated.
695 if (RxSBG.Rotate != 0)
696 Mask = ((Mask << RxSBG.Rotate) | (Mask >> (64 - RxSBG.Rotate)));
697 return (Mask & RxSBG.Mask) != 0;
700 bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) const {
701 SDValue N = RxSBG.Input;
705 if (RxSBG.Opcode == SystemZ::RNSBG)
714 if (!refineRxSBGMask(RxSBG, Mask)) {
721 if (!refineRxSBGMask(RxSBG, Mask))
724 RxSBG.Input = Input;
729 if (RxSBG.Opcode != SystemZ::RNSBG)
738 if (!refineRxSBGMask(RxSBG, Mask)) {
745 if (!refineRxSBGMask(RxSBG, Mask))
748 RxSBG.Input = Input;
753 // Any 64-bit rotate left can be merged into the RxSBG.
754 if (RxSBG.BitSize != 64 || N.getValueType() != MVT::i64)
760 RxSBG.Rotate = (RxSBG.Rotate + CountNode->getZExtValue()) & 63;
761 RxSBG.Input = N.getOperand(0);
767 RxSBG.Input = N.getOperand(0);
771 if (RxSBG.Opcode != SystemZ::RNSBG) {
774 if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize)))
777 RxSBG.Input = N.getOperand(0);
786 if (maskMatters(RxSBG, allOnes(RxSBG.BitSize) - allOnes(InnerBitSize)))
789 RxSBG.Input = N.getOperand(0);
803 if (RxSBG.Opcode == SystemZ::RNSBG) {
805 // count bits from RxSBG.Input are ignored.
806 if (maskMatters(RxSBG, allOnes(Count)))
810 if (!refineRxSBGMask(RxSBG, allOnes(BitSize - Count) << Count))
814 RxSBG.Rotate = (RxSBG.Rotate + Count) & 63;
815 RxSBG.Input = N.getOperand(0);
830 if (RxSBG.Opcode == SystemZ::RNSBG || Opcode == ISD::SRA) {
832 // count bits from RxSBG.Input are ignored.
833 if (maskMatters(RxSBG, allOnes(Count) << (BitSize - Count)))
838 if (!refineRxSBGMask(RxSBG, allOnes(BitSize - Count)))
842 RxSBG.Rotate = (RxSBG.Rotate - Count) & 63;
843 RxSBG.Input = N.getOperand(0);
923 // Try treating each operand of N as the second operand of the RxSBG
925 RxSBGOperands RxSBG[] = {
931 while (expandRxSBG(RxSBG[I]))
932 if (RxSBG[I].Input.getOpcode() != ISD::ANY_EXTEND)
944 if (Opcode == SystemZ::ROSBG && (RxSBG[I].Mask & 0xff) == 0)
951 if (Opcode == SystemZ::ROSBG && detectOrAndInsertion(Op0, RxSBG[I].Mask)) {
961 convertTo(SDLoc(N), MVT::i64, RxSBG[I].Input),
962 CurDAG->getTargetConstant(RxSBG[I].Start, MVT::i32),
963 CurDAG->getTargetConstant(RxSBG[I].End, MVT::i32),
964 CurDAG->getTargetConstant(RxSBG[I].Rotate, MVT::i32)
1064 ResNode = tryRxSBG(Node, SystemZ::RXSBG);