Commit 1fa8fd4c authored by Craig Topper's avatar Craig Topper
Browse files

Recommit "[TargetLowering][RISCV][X86] Support even divisors in expandDIVREMByConstant."

This reverts commit 65aaecca.

There was an ordering problem in the calculation of the partial
remainder.

Original commit message:

If the divisor is even, we can first shift the dividend and divisor
right by the number of trailing zeros. Now the divisor is odd and we
can do the original algorithm to calculate a remainder. Then we shift
that remainder left by the number of trailing zeros and add the bits
that were shifted out of the dividend.

Differential Revision: https://reviews.llvm.org/D135541
parent da4baa9e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment