16 Feb
2014
16 Feb
'14
8:50 p.m.
El 16/02/2014 20:34, Joaquin M Lopez Munoz escribió:
Each h%constant operation the compiler is able to heavily optimize by emulating integer division with precalculated multiplications (there's a section in Hacker's Delight on this I guess). I took a look at the generated assembly code and integer divisions were in fact gone, and the thing is considerably faster despite the huge number of cases (switching on [0,...n) can be coded very efficiently and I think CPU branch prediction plays a role here also).
Awesome Joaquín. Thanks for sharing this. Best, Ion