From: Bernd Petrovitsch <bernd@firmix.at>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Lee Revell <rlrevell@joe-job.com>, Philippe Troin <phil@fifi.org>,
Steven Rostedt <rostedt@goodmis.org>,
Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Grant Coady <lkml@dodo.com.au>,
Puneet Vyas <vyas.puneet@gmail.com>
Subject: Re: xor as a lazy comparison
Date: Tue, 26 Jul 2005 10:30:49 +0200 [thread overview]
Message-ID: <1122366649.5540.2.camel@tara.firmix.at> (raw)
In-Reply-To: <Pine.LNX.4.61.0507260804230.26583@yvahk01.tjqt.qr>
On Tue, 2005-07-26 at 08:07 +0200, Jan Engelhardt wrote:
[...]
> To answer for x *= 2 vs x <<= 1:
and x += x
> Use * when you would logically want to do a multiplication,
> << if you're working on a bitfield. It's just for keeping the code clean
> enough so that others may understand it.
>
> In the longshot, it does not matter, as gcc will optimize out multiplication
^^^ the C compiler
> with powers of two to bitops.
And if the C compiler is not doing this properly, such tunings are
probably in 100%-\eps cases worthless anyway.
Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
next prev parent reply other threads:[~2005-07-26 8:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-24 16:40 Jan Engelhardt
2005-07-24 20:07 ` Grant Coady
2005-07-24 21:43 ` Jan Engelhardt
2005-07-24 22:15 ` Puneet Vyas
2005-07-25 8:57 ` Bernd Petrovitsch
2005-07-25 17:55 ` Steven Rostedt
2005-07-25 19:10 ` Lee Revell
2005-07-25 19:16 ` Philippe Troin
2005-07-25 19:18 ` Lee Revell
2005-07-26 6:07 ` Jan Engelhardt
2005-07-26 8:30 ` Bernd Petrovitsch [this message]
2005-07-25 19:24 ` Steven Rostedt
2005-07-25 19:27 ` Lee Revell
2005-07-25 19:23 ` Paulo Marques
2005-07-25 19:25 ` Lee Revell
2005-07-25 20:24 ` Bill Davidsen
2005-07-25 18:00 ` [PATCH] make signal.c more readable (was: Re: xor as a lazy comparison) Steven Rostedt
2005-07-27 18:24 xor as a lazy comparison Clayton Weaver
2005-07-27 19:58 ` linux-os (Dick Johnson)
2005-07-28 0:04 ` Grant Coady
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=1122366649.5540.2.camel@tara.firmix.at \
--to=bernd@firmix.at \
--cc=akpm@osdl.org \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@dodo.com.au \
--cc=phil@fifi.org \
--cc=rlrevell@joe-job.com \
--cc=rostedt@goodmis.org \
--cc=vyas.puneet@gmail.com \
/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®