qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] Use ffs in favor of ffsll
Date: Thu, 2 Jul 2009 00:02:16 +0100	[thread overview]
Message-ID: <20090701230216.GA14043@miranda.arrow> (raw)
In-Reply-To: <20090701205802.GA11286@codesourcery.com>

On Wed, Jul 01, 2009 at 01:58:02PM -0700, Nathan Froyd wrote:
> On Wed, Jul 01, 2009 at 10:55:02PM +0200, Jan Kiszka wrote:
> > -    for (i = 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) {
> > -        bit = ffsll(env->interrupt_bitmap[i]);
> > +    for (i = 0; i < sizeof(env->interrupt_bitmap) / sizeof(int); i++) {
> > +        /* Note: This assumes little endian host, which is true in KVM mode.
> > +           In TCG mode it must be zero anyway. */
> > +        bit = ffs(((int *)env->interrupt_bitmap)[i]);
> 
> ISTR that some PPC hosts support KVM...

FWIW, I notice we currently have a qemu_fls() defined in cutils.c, which 
uses the clz32() defined in host-utils.h.

qemu_ffsll() could be implemented fairly easily in terms of ctz64(),
although note that ffsll(n) == (ctz64(n) + 1) % 65.

Cheers,
-- 
Stuart Brady

  parent reply	other threads:[~2009-07-01 23:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 20:22 [Qemu-devel] [PATCH] Use ffs in favor of ffsll Jan Kiszka
2009-07-01 20:27 ` [Qemu-devel] " Blue Swirl
2009-07-01 20:35   ` Jan Kiszka
2009-07-01 20:55     ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2009-07-01 20:58       ` Nathan Froyd
2009-07-01 22:24         ` [Qemu-devel] " Jan Kiszka
2009-07-01 23:02         ` Stuart Brady [this message]
2009-07-02  7:04           ` [Qemu-devel] [PATCH] Use ctz64 " Jan Kiszka
2009-07-02  7:11             ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2009-07-03  9:35               ` Paul Brook
2009-07-04  7:16                 ` Jan Kiszka
2009-07-02  8:39   ` [Qemu-devel] Re: [PATCH] Use ffs " Christoph Egger

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=20090701230216.GA14043@miranda.arrow \
    --to=sdbrady@ntlworld.com \
    --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).