• Sources: primary, discussion
  • Summary: GCC and LLVM need an add-back correction for 38 percent of divisors from 3 to 1000 because the ideal multiplier needs 33 bits, while a signed 64-bit multiply avoids it and cuts latency from 10 to 8 cycles on Emerald Rapids. Lemire also released fastmod 0.2.0, whose branchless signed division is about four times faster than 0.1.0 with random signs on Intel.
  • Why it matters: Hot loops dividing signed 32-bit values by constants or runtime divisors can gain latency with a short template, though it is slower on Apple M4 when no correction is needed.