Beating the compiler at signed 32-bit division https://lemire.me/blog/2026/10/31/beating-the-compiler-at-signed-32-bit-division/
Beating the compiler at signed 32-bit division
Dividing integers is slow on our processors. A 32-bit division costs: processor latency throughput Emerald Rapids about 12 cycles one every 6 cycles Zen 4 9 to 12 cycles one every 6 cycles Zen 5 10 to 13 cycles one every 6 cycles Arrow Lake performance core 12 cycles one every 6 cycles Apple M4 … Continue reading Beating the compiler at signed 32-bit division
lemire.me