From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 30 Aug 2011 22:08:17 +0200 Subject: [U-Boot] [PATCH V2] console: Implement pre-console buffer In-Reply-To: <201108301558.08010.vapier@gentoo.org> References: <1314620046-26187-3-git-send-email-graeme.russ@gmail.com> <20110830195238.CC16118C46FE@gemini.denx.de> <201108301558.08010.vapier@gentoo.org> Message-ID: <20110830200817.059BE18C46FE@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, In message <201108301558.08010.vapier@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: wd at denx.de "Maintain an awareness for contribution -- to your schedule, your project, our company." - A Group of Employees