public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Compiler question: integer division?
Date: Fri, 22 Apr 2005 13:10:57 -0400	[thread overview]
Message-ID: <42693021.7090908@smiths-aerospace.com> (raw)
In-Reply-To: <42692C53.1020305@imc-berlin.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

  reply	other threads:[~2005-04-22 17:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-22 16:54 [U-Boot-Users] Compiler question: integer division? Steven Scholz
2005-04-22 17:10 ` Jerry Van Baren [this message]
2005-04-22 17:17   ` Steven Scholz
2005-04-25  8:27     ` Steven Scholz
2005-04-25  9:04       ` AW: " Reinhard Meyer
2005-04-25  9:35       ` Wolfgang Denk
2005-04-25 10:30         ` Steven Scholz
2005-04-25 14:31       ` Udi Finkelstein
2005-04-25 15:13 ` [U-Boot-Users] " Sergei Sharonov
  -- strict thread matches above, loose matches on Subject: below --
2005-04-25  8:35 [U-Boot-Users] " Fillod Stephane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42693021.7090908@smiths-aerospace.com \
    --to=gerald.vanbaren@smiths-aerospace.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox