Re:Why is this C++ code faster than my hand-written assembly...
by besselheim on Tuesday August 22, 2017 @11:58AM
(#15073656)
Assuming 32-bit unsigned integers (but similarly for other integer sizes), multiplying by 0x11111111 and shifting right 28 bits would give a function of period 15, at least for inputs between 1 and 0x1000000e inclusive. Faster than dividing by 15.
[ Parent
| on HN ]