You would cry at the amount of "mulu #0x8,d0" I need to replace with <<3 in my codebase.
-
-
Replying to @Big_Evil_Corp @byuu_san
wait you didn't know that trick I use it all over the mGBA codebase Uhh. Maybe I shouldn't.
1 reply 0 retweets 1 like -
Yeah but the constant was originally different, did a find/replace of the lot without thinking
1 reply 0 retweets 0 likes -
Replying to @Big_Evil_Corp
.
@Big_Evil_Corp@byuu_san A trick I learned a few years ago was for multiplying by constants, it can be reduced to shifting + addition.1 reply 0 retweets 3 likes -
Replying to @endrift
.
@Big_Evil_Corp@byuu_san a = b * 3 becomes a = b << 1 + b. a = b * 7 becomes a = b << 2 + b << 1 + b. And so forth.6 replies 0 retweets 7 likes
Here’s the general algorithm—it’s actually long multiplication: https://en.wikipedia.org/wiki/Multiplication_algorithm#Shift_and_add …
10:52 AM - 26 Aug 2016
0 replies
0 retweets
4 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.