Lines Matching defs:shift

260   return Int32Add(Word32Sar(quotient, mag.shift), Word32Shr(dividend, 31));
267 unsigned const shift = base::bits::CountTrailingZeros(divisor);
268 dividend = Word32Shr(dividend, shift);
269 divisor >>= shift;
272 base::UnsignedDivisionByConstant(divisor, shift);
276 DCHECK_LE(1u, mag.shift);
279 mag.shift - 1);
281 quotient = Word32Shr(quotient, mag.shift);
1143 uint32_t const shift = base::bits::WhichPowerOfTwo(Abs(divisor));
1144 DCHECK_NE(0u, shift);
1145 if (shift > 1) {
1148 quotient = Int32Add(Word32Shr(quotient, 32u - shift), dividend);
1149 quotient = Word32Sar(quotient, shift);
1357 // Returns true if "value << shift >> shift == value". This can be interpreted
1358 // as "left shifting |value| by |shift| doesn't shift away significant bits".
1359 // Or, equivalently, "left shifting |value| by |shift| doesn't have signed
1361 bool CanRevertLeftShiftWithRightShift(int32_t value, int32_t shift) {
1362 if (shift < 0 || shift >= 32) {
1363 // This shift would be UB in C++
1366 if (static_cast<int32_t>(static_cast<uint32_t>(value) << shift) >> shift !=
1401 auto shift = mleft.right().ResolvedValue();
1402 if (CanRevertLeftShiftWithRightShift(right, shift)) {
1404 node->ReplaceInput(1, Int32Constant(right << shift));
1417 auto shift = mright.right().ResolvedValue();
1418 if (CanRevertLeftShiftWithRightShift(left, shift)) {
1419 node->ReplaceInput(0, Int32Constant(left << shift));
1465 // This is useful for Smi untagging, which results in such a shift.
1486 // Remove the explicit 'and' with 0x1F if the shift provided by the machine
1614 uint32_t shift = m.right().ResolvedValue() & 31;
1616 if ((mask >> shift) == 0) {
1804 // 1. Single-bit checks: `(val >> shift) & 1`, where:
1805 // - the shift may be omitted, and/or
1857 // Look for the pattern `(val >> shift) & 1`. The shift may be omitted.
1864 typename WordNAdapter::UintNBinopMatcher shift(mand.left().node());
1865 if (shift.right().HasResolvedValue() &&
1866 shift.right().ResolvedValue() < 32u) {
1867 uint32_t mask = 1 << shift.right().ResolvedValue();
1868 return BitfieldCheck{shift.left().node(), mask, mask,
2362 // Make sure that we won't shift data off the end, and that all of the
2385 int32_t shift = static_cast<int32_t>(mshift.right().ResolvedValue());
2386 if (CanRevertLeftShiftWithRightShift(rhs, shift)) {
2387 return std::make_pair(mshift.left().node(), rhs << shift);