All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Steven Rostedt <srostedt@redhat.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	rostedt@goodmis.org
Subject: Re: Re: [PATCH] binary or instead of logical in timer sync
Date: Fri, 04 Aug 2006 06:27:34 +0200	[thread overview]
Message-ID: <87psfhjfbd.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <59affcc6c4073a1a72f5cd3b511fa006@cl.cam.ac.uk> (Keir Fraser's message of "Thu, 3 Aug 2006 13:15:31 +0100")

Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:

[...]
> The only reason for using binary operators in those predicates is to
> avoid extra branches in the generated code which would probably be
> generated to follow the short-circuiting semantics of the logical
> operators. In fact, I think a smart optimising compiler would generate
> the *same* object code regardless of whether we use binary/logical or
> (but I don't believe gcc is that smart yet!).

Manual optimizations like use of bitwise rather than logical
operations may speed up the program (depending on how dumb or confused
the optimizer is), but they certainly slow down the poor maintenance
programmer.  Bit-wise where I expect logical makes me hesistate and
check, because it's an unusual pattern, and in my experience often
wrong.

As with all optimizations that uglify the code, use it only when you
*know* it actually optimizes something worth optimizing.  Knowing
requires measuring.

Okay, I'll step off my soapbox now.

      parent reply	other threads:[~2006-08-04  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03  3:17 [PATCH] binary or instead of logical in timer sync Steven Rostedt
2006-08-03 12:15 ` Keir Fraser
2006-08-03 13:09   ` Steven Rostedt
2006-08-04  4:27   ` Markus Armbruster [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=87psfhjfbd.fsf@pike.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.