From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Mon, 11 Aug 2008 14:12:37 +0200 Subject: [U-Boot] [PATCH 5/7 v6] serial: add S3C64XX serial driver In-Reply-To: References: <20080809091323.GD18040@game.jcrosoft.org> <20080811100655.B23AD248BF@gemini.denx.de> Message-ID: <20080811121237.31711248BF@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 Guennadi, In message you wrote: > > Ok, would this be better > > u32 reg; > u32 pclk = get_PCLK(); > u32 baudrate = gd->baudrate; > int i; > > reg = pclk / baudrate / 16 - 1; > i = (pclk / baudrate) % 16; Is "reg" still used anywhere else? > This way the compiler does optimize it to only one division, and the > operations say what they do, and there doesn't seem to be any need for > comment left. Still, the code produced by this is 1 asm instruction longer > than my original code:-) Is the generated code equivalent? This smells like a subtle bug... 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 The games have always strengthened us. Death becomes a familiar pattern. We don't fear it as you do. -- Proconsul Marcus Claudius, "Bread and Circuses", stardate 4041.2