Lines Matching defs:RxSBG

275   // Try to update RxSBG so that only the bits of RxSBG.Input in Mask are used.
277 bool refineRxSBGMask(RxSBGOperands &RxSBG, uint64_t Mask) const;
279 // Try to fold some of RxSBG.Input into other fields of RxSBG.
281 bool expandRxSBG(RxSBGOperands &RxSBG) const;
777 bool SystemZDAGToDAGISel::refineRxSBGMask(RxSBGOperands &RxSBG,
780 if (RxSBG.Rotate != 0)
781 Mask = (Mask << RxSBG.Rotate) | (Mask >> (64 - RxSBG.Rotate));
782 Mask &= RxSBG.Mask;
783 if (TII->isRxSBGMask(Mask, RxSBG.BitSize, RxSBG.Start, RxSBG.End)) {
784 RxSBG.Mask = Mask;
790 // Return true if any bits of (RxSBG.Input & Mask) are significant.
791 static bool maskMatters(RxSBGOperands &RxSBG, uint64_t Mask) {
792 // Rotate the mask in the same way as RxSBG.Input is rotated.
793 if (RxSBG.Rotate != 0)
794 Mask = ((Mask << RxSBG.Rotate) | (Mask >> (64 - RxSBG.Rotate)));
795 return (Mask & RxSBG.Mask) != 0;
798 bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) const {
799 SDValue N = RxSBG.Input;
803 if (RxSBG.Opcode == SystemZ::RNSBG)
809 if (!refineRxSBGMask(RxSBG, Mask))
811 RxSBG.Input = N.getOperand(0);
815 if (RxSBG.Opcode == SystemZ::RNSBG)
824 if (!refineRxSBGMask(RxSBG, Mask)) {
830 if (!refineRxSBGMask(RxSBG, Mask))
833 RxSBG.Input = Input;
838 if (RxSBG.Opcode != SystemZ::RNSBG)
847 if (!refineRxSBGMask(RxSBG, Mask)) {
853 if (!refineRxSBGMask(RxSBG, Mask))
856 RxSBG.Input = Input;
861 // Any 64-bit rotate left can be merged into the RxSBG.
862 if (RxSBG.BitSize != 64 || N.getValueType() != MVT::i64)
868 RxSBG.Rotate = (RxSBG.Rotate + CountNode->getZExtValue()) & 63;
869 RxSBG.Input = N.getOperand(0);
875 RxSBG.Input = N.getOperand(0);
879 if (RxSBG.Opcode != SystemZ::RNSBG) {
882 if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize)))
885 RxSBG.Input = N.getOperand(0);
895 if (maskMatters(RxSBG, allOnes(BitSize) - allOnes(InnerBitSize))) {
898 if (RxSBG.Mask == 1 && RxSBG.Rotate == 1)
899 RxSBG.Rotate += (BitSize - InnerBitSize);
904 RxSBG.Input = N.getOperand(0);
918 if (RxSBG.Opcode == SystemZ::RNSBG) {
920 // count bits from RxSBG.Input are ignored.
921 if (maskMatters(RxSBG, allOnes(Count)))
925 if (!refineRxSBGMask(RxSBG, allOnes(BitSize - Count) << Count))
929 RxSBG.Rotate = (RxSBG.Rotate + Count) & 63;
930 RxSBG.Input = N.getOperand(0);
945 if (RxSBG.Opcode == SystemZ::RNSBG || Opcode == ISD::SRA) {
947 // count bits from RxSBG.Input are ignored.
948 if (maskMatters(RxSBG, allOnes(Count) << (BitSize - Count)))
953 if (!refineRxSBGMask(RxSBG, allOnes(BitSize - Count)))
957 RxSBG.Rotate = (RxSBG.Rotate - Count) & 63;
958 RxSBG.Input = N.getOperand(0);
1097 // Try treating each operand of N as the second operand of the RxSBG
1099 RxSBGOperands RxSBG[] = {
1105 while (RxSBG[I].Input->hasOneUse() && expandRxSBG(RxSBG[I]))
1112 if (RxSBG[I].Input.getOpcode() != ISD::ANY_EXTEND &&
1113 RxSBG[I].Input.getOpcode() != ISD::TRUNCATE)
1125 if (Opcode == SystemZ::ROSBG && (RxSBG[I].Mask & 0xff) == 0)
1132 if (Opcode == SystemZ::ROSBG && detectOrAndInsertion(Op0, RxSBG[I].Mask)) {
1141 convertTo(DL, MVT::i64, RxSBG[I].Input),
1142 CurDAG->getTargetConstant(RxSBG[I].Start, DL, MVT::i32),
1143 CurDAG->getTargetConstant(RxSBG[I].End, DL, MVT::i32),
1144 CurDAG->getTargetConstant(RxSBG[I].Rotate, DL, MVT::i32)