Lines Matching defs:Neg

552     SDValue MatchRotatePosNeg(SDValue Shifted, SDValue Pos, SDValue Neg,
6118 // Return true if we can prove that, whenever Neg and Pos are both in the
6119 // range [0, EltSize), Neg == (Pos == 0 ? 0 : EltSize - Pos). This means that
6122 // (or (shift1 X, Neg), (shift2 X, Pos))
6125 // in direction shift1 by Neg. The range [0, EltSize) means that we only need
6127 static bool matchRotateSub(SDValue Pos, SDValue Neg, unsigned EltSize,
6132 // (b) Neg == Neg & (EltSize - 1) whenever Neg is in [0, EltSize).
6134 // So if EltSize is a power of 2 and Neg is (and Neg', EltSize-1), we check
6137 // Neg & (EltSize - 1) == (EltSize - Pos) & (EltSize - 1) [A]
6139 // for all Neg and Pos. Since Neg & (EltSize - 1) == Neg' & (EltSize - 1)
6140 // we can just replace Neg with Neg' for the rest of the function.
6144 // Neg == EltSize - Pos [B]
6146 // for all Neg and Pos. Note that the (or ...) then invokes undefined
6147 // behavior if Pos == 0 (and consequently Neg == EltSize).
6151 // where Neg and Pos are never in range at the same time. E.g. for
6152 // EltSize == 32, using [A] would allow a Neg of the form (sub 64, Pos)
6161 if (Neg.getOpcode() == ISD::AND && isPowerOf2_64(EltSize)) {
6162 if (ConstantSDNode *NegC = isConstOrConstSplat(Neg.getOperand(1))) {
6163 KnownBits Known = DAG.computeKnownBits(Neg.getOperand(0));
6167 Neg = Neg.getOperand(0);
6173 // Check whether Neg has the form (sub NegC, NegOp1) for some NegC and NegOp1.
6174 if (Neg.getOpcode() != ISD::SUB)
6176 ConstantSDNode *NegC = isConstOrConstSplat(Neg.getOperand(0));
6179 SDValue NegOp1 = Neg.getOperand(1);
6231 // shifts of Shifted. If Neg == <operand size> - Pos then the OR reduces
6232 // to both (PosOpcode Shifted, Pos) and (NegOpcode Shifted, Neg), with the
6234 // Neg with outer conversions stripped away.
6236 SDValue Neg, SDValue InnerPos,
6250 HasPos ? Pos : Neg);