9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: tlaronde@polynum.com
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Integer arithmetic: some lessons
Date: Wed, 21 Apr 2010 22:19:46 +0200	[thread overview]
Message-ID: <20100421201946.GA424@polynum.com> (raw)
In-Reply-To: <dc0579fcc1179638e3a224ecc4c094a5@plan9.bell-labs.com>

On Wed, Apr 21, 2010 at 11:03:06AM -0400, geoff@plan9.bell-labs.com wrote:
> If you think that shift operators aren't being translated
> to shift instructions, you can examine the output of 8c -S.
>
> x/2 is equal to x>>1 for non-negative integer x; for negative x,
> the two expressions may yield different values, even if
> x is a signed integer.  The book Hacker's Delight, among others,
> explores these sorts of optimisations.

Thanks for the reference. Having spent 3 days trying to understand
"generally" what was going on, I will now isolate one drawing that leads
to problem and add trace for gcc and for ken-cc to see where they do not
compute the same values. This will narrow the things and assembly, on
this, will give clues.
--
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



  reply	other threads:[~2010-04-21 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 13:40 tlaronde
2010-04-21 15:03 ` geoff
2010-04-21 20:19   ` tlaronde [this message]
2010-04-21 23:28 ` Bakul Shah
2010-04-22  5:51   ` tlaronde
2010-04-22  9:42   ` Steve Simon

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=20100421201946.GA424@polynum.com \
    --to=tlaronde@polynum.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).