Daniel Lemire personal blog
Ideal divisors: when a division compiles down to just a multiplication
The division instruction is one of the most expensive instruction in your CPU. Thus optimizing compilers often compile divisions by known constants down to a multiplication followed by a shift. However, in some lucky cases, the compiler does not even need a shift. I call the corresponding divisors ideal. For the math…
- Points
- 141
- HN comments
- 67
- Submissions
- 1
- Cited by
- 0 commenters
Software EngineeringSystems & Performance2021
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Apr 28, 2021 | Ideal divisors: when a division compiles down to just a multiplication by chmaynard | 141 | 67 |