mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Mike Harrold <mharrold@cas.org>
Cc: Jakob Østergaard <jakob@unthought.net>,
	antirez <antirez@invece.org>, Brian Gerst <bgerst@didntduck.org>,
	linux-kernel@vger.kernel.org
Subject: Re: * 4 converted to << 2 for networking code
Date: Wed, 10 Jan 2001 17:23:33 +0100	[thread overview]
Message-ID: <20010110172333.J30055@pcep-jamie.cern.ch> (raw)
In-Reply-To: <20010110161146.A3252@unthought.net> <200101101518.KAA11519@mah21awu.cas.org>
In-Reply-To: <200101101518.KAA11519@mah21awu.cas.org>; from mharrold@cas.org on Wed, Jan 10, 2001 at 10:18:38AM -0500

Mike Harrold wrote:
> Be careful. *4 is not a simple <<2 substitution (by the compiler) if
> the variable is signed. *4 translates to 3 instructions (on x86) if
> it's an int.

I think you mean /4 is not the same as >>2 if the variable is signed.

In general, non-widening multiplies give the same result for signed and
unsigned variables.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-10 16:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 16:48 antirez
2001-01-10 14:38 ` David S. Miller
2001-01-10 14:54 ` Brian Gerst
2001-01-10 17:03   ` antirez
2001-01-10 15:11     ` Jakob Østergaard
2001-01-10 15:18       ` Mike Harrold
2001-01-10 15:31         ` Chris Jones
2001-01-10 16:23         ` Jamie Lokier [this message]
2001-01-10 16:26           ` Mike Harrold
2001-01-10 17:25       ` antirez
2001-01-10 16:25         ` Pauline Middelink
2001-01-11  0:29       ` H. Peter Anvin
2001-01-10 22:21 ` Matthias Andree

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=20010110172333.J30055@pcep-jamie.cern.ch \
    --to=lk@tantalophile.demon.co.uk \
    --cc=antirez@invece.org \
    --cc=bgerst@didntduck.org \
    --cc=jakob@unthought.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mharrold@cas.org \
    /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

all inboxes | Powered by JetHome®