From: Sergei Sharonov <sergei.sharonov@halliburton.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Re: Compiler question: integer division?
Date: Mon, 25 Apr 2005 15:13:24 +0000 (UTC) [thread overview]
Message-ID: <loom.20050425T170912-613@post.gmane.org> (raw)
In-Reply-To: 42692C53.1020305@imc-berlin.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
prev parent reply other threads:[~2005-04-25 15:13 UTC|newest]
Thread overview: 9+ 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
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 ` Sergei Sharonov [this message]
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=loom.20050425T170912-613@post.gmane.org \
--to=sergei.sharonov@halliburton.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