gordon 229 Posted October 10, 2012 Share Posted October 10, 2012 Tripped over this by accident while watching one of Travis Goodspeed's talks: Efficient Micro Mathematics SirZusa, yyrkoon, tingo and 3 others 6 Quote Link to post Share on other sites
SirZusa 34 Posted October 11, 2012 Share Posted October 11, 2012 nice idea also often used SHL for multiplication with 2 and SHR for division by 2 Quote Link to post Share on other sites
pabigot 355 Posted October 11, 2012 Share Posted October 11, 2012 Though I haven't checked into details, I recall seeing disassembled code that suggests gcc uses Horner's Rule or something like it to generate code for multiplication by a constant. (IOW, you may not need to do this sort of thing explicitly in your own programs.) bluehash 1 Quote Link to post Share on other sites
nemui-kuma 8 Posted November 18, 2012 Share Posted November 18, 2012 CCS replaces multiplications and divisions with bit shifts if it is possible (/2,/8 /16 etc...) and it can warn you if it can't do that way, Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.