APInt uses Knuth's D algorithm for long division. In rare cases the implementation applied a transformation that was not needed.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Minor nitpicks, LGTM.
lib/Support/APInt.cpp | ||
---|---|---|
1510 | Could b be LLVM_CONSTEXPR ? | |
1583 | The parenthesis around the shift make the expression more readable, even if not required. You flipped the | arguments so they would consistent with the usual u[j+n], u[j+n-1]...u[j] representation? | |
1784 | I'd remove the FIXME and explain that *currently* this is a dead case since all callers in APInt calls either test for divide() with lhswords == rhswords == 1 or proivde the a small radix before calling divide() but it is worth keeping this code alive for correctness in case some new code does call divide() with lhswords == rhswords == 1. |
lib/Support/APInt.cpp | ||
---|---|---|
1510 | Probably. I'm not used to constexpr because Visual Studio still does not support it. | |
1583 | I flipped arguments because I like high word being on the left. You shift left to make space for a low word. | |
1784 | Ok, I will change that. I'm just a bit worried that this code cannot be reached with unittests. |
Could b be LLVM_CONSTEXPR ?