Lines Matching refs:RXSBG
247 // Try to update RxSBG so that only the bits of RxSBG.Input in Mask are used.
249 bool refineRxSBGMask(RxSBGOperands &RxSBG, uint64_t Mask);
251 // Try to fold some of RxSBG.Input into other fields of RxSBG.
253 bool expandRxSBG(RxSBGOperands &RxSBG);
622 bool SystemZDAGToDAGISel::refineRxSBGMask(RxSBGOperands &RxSBG, uint64_t Mask) {
624 if (RxSBG.Rotate != 0)
625 Mask = (Mask << RxSBG.Rotate) | (Mask >> (64 - RxSBG.Rotate));
626 Mask &= RxSBG.Mask;
627 if (TII->isRxSBGMask(Mask, RxSBG.BitSize, RxSBG.Start, RxSBG.End)) {
628 RxSBG.Mask = Mask;
634 // RxSBG.Input is a shift of Count bits in the direction given by IsLeft.
637 static bool shiftedInBitsMatter(RxSBGOperands &RxSBG, uint64_t Count,
642 ShiftedIn <<= RxSBG.BitSize - Count;
644 // Rotate that mask in the same way as RxSBG.Input is rotated.
645 if (RxSBG.Rotate != 0)
646 ShiftedIn = ((ShiftedIn << RxSBG.Rotate) |
647 (ShiftedIn >> (64 - RxSBG.Rotate)));
650 return (ShiftedIn & RxSBG.Mask) != 0;
653 bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) {
654 SDValue N = RxSBG.Input;
658 if (RxSBG.Opcode == SystemZ::RNSBG)
668 if (!refineRxSBGMask(RxSBG, Mask)) {
675 if (!refineRxSBGMask(RxSBG, Mask))
678 RxSBG.Input = Input;
683 if (RxSBG.Opcode != SystemZ::RNSBG)
693 if (!refineRxSBGMask(RxSBG, Mask)) {
700 if (!refineRxSBGMask(RxSBG, Mask))
703 RxSBG.Input = Input;
708 // Any 64-bit rotate left can be merged into the RxSBG.
709 if (RxSBG.BitSize != 64)
716 RxSBG.Rotate = (RxSBG.Rotate + CountNode->getZExtValue()) & 63;
717 RxSBG.Input = N.getOperand(0);
728 if (Count < 1 || Count >= RxSBG.BitSize)
731 if (RxSBG.Opcode == SystemZ::RNSBG) {
733 // count bits from RxSBG.Input are ignored.
734 if (shiftedInBitsMatter(RxSBG, Count, true))
738 if (!refineRxSBGMask(RxSBG, allOnes(RxSBG.BitSize - Count) << Count))
742 RxSBG.Rotate = (RxSBG.Rotate + Count) & 63;
743 RxSBG.Input = N.getOperand(0);
755 if (Count < 1 || Count >= RxSBG.BitSize)
758 if (RxSBG.Opcode == SystemZ::RNSBG || Opcode == ISD::SRA) {
760 // count bits from RxSBG.Input are ignored.
761 if (shiftedInBitsMatter(RxSBG, Count, false))
766 if (!refineRxSBGMask(RxSBG, allOnes(RxSBG.BitSize - Count)))
770 RxSBG.Rotate = (RxSBG.Rotate - Count) & 63;
771 RxSBG.Input = N.getOperand(0);
846 // Try treating each operand of N as the second operand of the RxSBG
848 RxSBGOperands RxSBG[] = {
854 while (expandRxSBG(RxSBG[I]))
866 if (Opcode == SystemZ::ROSBG && (RxSBG[I].Mask & 0xff) == 0)
873 if (Opcode == SystemZ::ROSBG && detectOrAndInsertion(Op0, RxSBG[I].Mask))
879 convertTo(SDLoc(N), MVT::i64, RxSBG[I].Input),
880 CurDAG->getTargetConstant(RxSBG[I].Start, MVT::i32),
881 CurDAG->getTargetConstant(RxSBG[I].End, MVT::i32),
882 CurDAG->getTargetConstant(RxSBG[I].Rotate, MVT::i32)
966 ResNode = tryRxSBG(Node, SystemZ::RXSBG);