Hacker News new | ask | show | jobs
by microtherion 2175 days ago
Is the mult5 example an actual piece of code of your program?

Any multiplication where one multiplicand is a constant should be much faster with shifts and adds than with a loop. mult5, e.g. is: x+(x<<2)

1 comments

Right, I do this in the assembly versions everywhere I multiply by a constant. mult5 is just an example.