From: Peter Maydell <peter.maydell@linaro.org>
To: Peter Lieven <pl@dlhnet.de>
Cc: Orit Wasserman <owasserm@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Corentin Chary <corentin.chary@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [RFC] find_next_bit optimizations
Date: Mon, 11 Mar 2013 14:04:49 +0000 [thread overview]
Message-ID: <CAFEAcA8ob=wY7i8GHJSaCRdDGZn7K_+1a3-Qf_N9YHP3bk+zDQ@mail.gmail.com> (raw)
In-Reply-To: <513DDFA3.1020308@dlhnet.de>
On 11 March 2013 13:44, Peter Lieven <pl@dlhnet.de> wrote:
> @@ -24,12 +24,13 @@ unsigned long find_next_bit(const unsigned long *addr,
> unsigned long size,
> const unsigned long *p = addr + BITOP_WORD(offset);
> unsigned long result = offset & ~(BITS_PER_LONG-1);
> unsigned long tmp;
> + unsigned long d0,d1,d2,d3;
>
> if (offset >= size) {
> return size;
> }
> size -= result;
> - offset %= BITS_PER_LONG;
> + offset &= (BITS_PER_LONG-1);
This change at least is unnecessary -- I just checked, and gcc
is already smart enough to turn the % operation into a logical
and. The generated object files are identical.
-- PMM
next prev parent reply other threads:[~2013-03-11 14:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 13:44 [Qemu-devel] [RFC] find_next_bit optimizations Peter Lieven
2013-03-11 14:04 ` Peter Maydell [this message]
2013-03-11 14:14 ` Paolo Bonzini
2013-03-11 14:22 ` Peter Lieven
2013-03-11 14:29 ` Peter Lieven
2013-03-11 14:35 ` Paolo Bonzini
2013-03-11 15:24 ` Peter Lieven
2013-03-11 15:25 ` Peter Maydell
2013-03-11 15:29 ` Paolo Bonzini
2013-03-11 15:37 ` Peter Lieven
2013-03-11 15:58 ` Paolo Bonzini
2013-03-11 17:06 ` ronnie sahlberg
2013-03-11 17:07 ` Paolo Bonzini
2013-03-11 18:20 ` Peter Lieven
2013-03-12 7:32 ` [Qemu-devel] [PATCH] bitops: unroll while loop in find_next_bit() Peter Lieven
2013-03-11 15:37 ` [Qemu-devel] [RFC] find_next_bit optimizations Peter Maydell
2013-03-11 15:41 ` Peter Lieven
2013-03-11 15:42 ` Paolo Bonzini
2013-03-11 15:48 ` Peter Lieven
2013-03-12 8:35 ` Stefan Hajnoczi
2013-03-12 8:41 ` Peter Lieven
2013-03-12 15:12 ` Stefan Hajnoczi
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='CAFEAcA8ob=wY7i8GHJSaCRdDGZn7K_+1a3-Qf_N9YHP3bk+zDQ@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=corentin.chary@gmail.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pl@dlhnet.de \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).