Dear Mike Frysinger, In message <201108301558.08010.vap...@gentoo.org> you wrote: > > > Please see my previous posting > > (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/106810) > > > > I don't think 3 additional addembler instructions really play a big > > role here. > > i'm pretty sure if you define CONFIG_PRE_CON_BUF_SZ as a power of 2 value, > you > get nice & simple assembly code. so if the generated code is undesirable, > pick a CONFIG value that is power-of-2 ?
This was the test code I compiled: --------------------------------------------- #define CONFIG_SYS_TMP_CON_BUF_SZ 1024 int foo(int i) { return i & (CONFIG_SYS_TMP_CON_BUF_SZ-1); } int bar(int i) { return i % CONFIG_SYS_TMP_CON_BUF_SZ; } --------------------------------------------- So was actually checking for a power-of-2 value. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "Maintain an awareness for contribution -- to your schedule, your project, our company." - A Group of Employees _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot