From: Sergei Sharonov Date: Mon, 25 Apr 2005 15:13:24 +0000 (UTC) Subject: [U-Boot-Users] Re: Compiler question: integer division? References: <42692C53.1020305@imc-berlin.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi > 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? I believe that would depend on compiler, compiler optimization options and processor architecture. AFAIK, gcc will even replace multiplication with shift/add/subtract sequences on 486 (that does have multiply opcode) because it will be faster. Sergei Sharonov