From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>,
Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] Re: [PATCH 1/7] qcow2: Make get_bits_from_size() common
Date: Fri, 24 Sep 2010 14:56:29 +0200 [thread overview]
Message-ID: <4C9C9FFD.4070604@redhat.com> (raw)
In-Reply-To: <20100924083748.GA2218@stefan-thinkpad.transitives.com>
On 09/24/2010 10:37 AM, Stefan Hajnoczi wrote:
> On Fri, Sep 24, 2010 at 01:50:39AM +0400, malc wrote:
>> On Thu, 23 Sep 2010, Stefan Hajnoczi wrote:
>>
>>> The get_bits_from_size() calculates the log base-2 of a number. This is
>>> useful in bit manipulation code working with power-of-2s.
>>>
>>> Currently used by qcow2 and needed by qed in a follow-on patch.
>>
>> int ilog2 (size_t size)
>> {
>> if (size& (size - 1))
>> return -1;
>>
>> return __builtin_ctzl (size);
>> }
>>
>> Ifdef WIN64 omitted for brevity.
>
> What is the situation with WIN64?
long is only 32 bit, so you need __builtin_ctzll.
Paolo
next prev parent reply other threads:[~2010-09-24 12:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 15:41 [Qemu-devel] [PATCH 0/7] qed: Add QEMU Enhanced Disk format Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 1/7] qcow2: Make get_bits_from_size() common Stefan Hajnoczi
2010-09-23 21:50 ` malc
2010-09-24 8:37 ` Stefan Hajnoczi
2010-09-24 12:56 ` Paolo Bonzini [this message]
2010-09-24 14:18 ` [Qemu-devel] " Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 2/7] cutils: Add bytes_to_str() to format byte values Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 3/7] cutils: qemu_iovec_copy and qemu_iovec_memset Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 4/7] qed: Add QEMU Enhanced Disk image format Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 5/7] qed: Table, L2 cache, and cluster functions Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 6/7] qed: Read/write support Stefan Hajnoczi
2010-09-27 10:12 ` Avi Kivity
2010-09-27 10:19 ` Stefan Hajnoczi
2010-09-23 15:41 ` [Qemu-devel] [PATCH 7/7] qed: Consistency check support Stefan Hajnoczi
2010-09-27 9:58 ` [Qemu-devel] [PATCH 0/7] qed: Add QEMU Enhanced Disk format Avi Kivity
2010-09-27 10:13 ` Avi Kivity
2010-09-27 10:15 ` 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=4C9C9FFD.4070604@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.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.