Hacker News new | past | comments | ask | show | jobs | submit login

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)




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




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: