Three things here:
- Generalize the fold to handle non-splat divisors. Reasonably trivial.
- Unban power-of-two divisors. I don't see any reason why they should be illegal.
- There is no ban in Hacker's Delight
- I think the ban came from the same bug that caused the miscompile - in floor((2^W - 1) / D) we were dividing by D0 instead of D, and we were ensuring that D0 is not 1, which makes sense.
- We are correct to ban 1 divisor - we'd have setule/setugt N, all-ones i.e. the remainder of division by 1 is 0 for any N, which is bogus.
- 1 divisor is banned in Hacker's Delight
- Be careful to not fold if there is at least one 1 divisor.