Lines Matching defs:divisor

248 Node* MachineOperatorReducer::Int32Div(Node* dividend, int32_t divisor) {
249 DCHECK_NE(0, divisor);
250 DCHECK_NE(std::numeric_limits<int32_t>::min(), divisor);
252 base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor));
255 if (divisor > 0 && bit_cast<int32_t>(mag.multiplier) < 0) {
257 } else if (divisor < 0 && bit_cast<int32_t>(mag.multiplier) > 0) {
263 Node* MachineOperatorReducer::Uint32Div(Node* dividend, uint32_t divisor) {
264 DCHECK_LT(0u, divisor);
265 // If the divisor is even, we can avoid using the expensive fixup by shifting
267 unsigned const shift = base::bits::CountTrailingZeros(divisor);
269 divisor >>= shift;
270 // Compute the magic number for the (shifted) divisor.
272 base::UnsignedDivisionByConstant(divisor, shift);
1139 int32_t const divisor = m.right().ResolvedValue();
1142 if (base::bits::IsPowerOfTwo(Abs(divisor))) {
1143 uint32_t const shift = base::bits::WhichPowerOfTwo(Abs(divisor));
1151 quotient = Int32Div(quotient, Abs(divisor));
1153 if (divisor < 0) {
1180 uint32_t const divisor = m.right().ResolvedValue();
1181 if (base::bits::IsPowerOfTwo(divisor)) { // x / 2^n => x >> n
1188 return Replace(Uint32Div(dividend, divisor));
1207 uint32_t const divisor = Abs(m.right().ResolvedValue());
1208 if (base::bits::IsPowerOfTwo(divisor)) {
1209 uint32_t const mask = divisor - 1;
1219 Node* quotient = Int32Div(dividend, divisor);
1221 node->ReplaceInput(1, Int32Mul(quotient, Int32Constant(divisor)));
1242 uint32_t const divisor = m.right().ResolvedValue();
1243 if (base::bits::IsPowerOfTwo(divisor)) { // x % 2^n => x & 2^n-1
1248 Node* quotient = Uint32Div(dividend, divisor);
1250 node->ReplaceInput(1, Int32Mul(quotient, Uint32Constant(divisor)));