From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Fri, 22 Apr 2005 13:10:57 -0400 Subject: [U-Boot-Users] Compiler question: integer division? In-Reply-To: <42692C53.1020305@imc-berlin.de> References: <42692C53.1020305@imc-berlin.de> Message-ID: <42693021.7090908@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Steven Scholz wrote: > Hi there, > > I just wondered if the code > > return (dtt_read(sensor, DTT_READ_TEMP) / 256); > > would be result in a "shift by 8" or and interger division? > > Thanks, > > Steven Short answer: Yes. Longer answer: It depends on the compiler, target processor, and optimization levels. Usually it will be a "shift by 8" (which may or may not actually be a shift -- see the PowerPC "Swiss Army Knife[tm]" instruction rlwimi). gvb