9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@plan9.bell-labs.com
To: 9fans@9fans.net
Subject: Re: [9fans] Integer arithmetic: some lessons
Date: Wed, 21 Apr 2010 11:03:06 -0400	[thread overview]
Message-ID: <dc0579fcc1179638e3a224ecc4c094a5@plan9.bell-labs.com> (raw)
In-Reply-To: <20100421134019.GA1382@polynum.com>

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.



  reply	other threads:[~2010-04-21 15:03 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 [this message]
2010-04-21 20:19   ` tlaronde
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=dc0579fcc1179638e3a224ecc4c094a5@plan9.bell-labs.com \
    --to=geoff@plan9.bell-labs.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).