Home | History | Annotate | Download | only in compiler

Lines Matching full:divisor

89 Node* MachineOperatorReducer::Int32Div(Node* dividend, int32_t divisor) {
90 DCHECK_NE(0, divisor);
91 DCHECK_NE(std::numeric_limits<int32_t>::min(), divisor);
93 base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor));
96 if (divisor > 0 && bit_cast<int32_t>(mag.multiplier) < 0) {
98 } else if (divisor < 0 && bit_cast<int32_t>(mag.multiplier) > 0) {
105 Node* MachineOperatorReducer::Uint32Div(Node* dividend, uint32_t divisor) {
106 DCHECK_LT(0u, divisor);
107 // If the divisor is even, we can avoid using the expensive fixup by shifting
109 unsigned const shift = base::bits::CountTrailingZeros32(divisor);
111 divisor >>= shift;
112 // Compute the magic number for the (shifted) divisor.
114 base::UnsignedDivisionByConstant(divisor, shift);
524 int32_t const divisor = m.right().Value();
527 if (base::bits::IsPowerOfTwo32(Abs(divisor))) {
528 uint32_t const shift = WhichPowerOf2Abs(divisor);
536 quotient = Int32Div(quotient, Abs(divisor));
538 if (divisor < 0) {
566 uint32_t const divisor = m.right().Value();
567 if (base::bits::IsPowerOfTwo32(divisor)) { // x / 2^n => x >> n
573 return Replace(Uint32Div(dividend, divisor));
593 int32_t const divisor = Abs(m.right().Value());
594 if (base::bits::IsPowerOfTwo32(divisor)) {
595 uint32_t const mask = divisor - 1;
606 Node* quotient = Int32Div(dividend, divisor);
608 node->ReplaceInput(1, Int32Mul(quotient, Int32Constant(divisor)));
630 uint32_t const divisor = m.right().Value();
631 if (base::bits::IsPowerOfTwo32(divisor)) { // x % 2^n => x & 2^n-1
636 Node* quotient = Uint32Div(dividend, divisor);
638 node->ReplaceInput(1, Int32Mul(quotient, Uint32Constant(divisor)));