From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41275 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz3mz-0006d0-Us for qemu-devel@nongnu.org; Fri, 24 Sep 2010 04:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oz3my-00043C-Ca for qemu-devel@nongnu.org; Fri, 24 Sep 2010 04:37:53 -0400 Received: from mtagate2.uk.ibm.com ([194.196.100.162]:52685) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oz3my-00042z-5g for qemu-devel@nongnu.org; Fri, 24 Sep 2010 04:37:52 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o8O8boNs026862 for ; Fri, 24 Sep 2010 08:37:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o8O8boKc2887824 for ; Fri, 24 Sep 2010 09:37:50 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o8O8bnWl004970 for ; Fri, 24 Sep 2010 09:37:50 +0100 Date: Fri, 24 Sep 2010 09:37:49 +0100 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] [PATCH 1/7] qcow2: Make get_bits_from_size() common Message-ID: <20100924083748.GA2218@stefan-thinkpad.transitives.com> References: <1285256514-21138-1-git-send-email-stefanha@linux.vnet.ibm.com> <1285256514-21138-2-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Kevin Wolf , Anthony Liguori , Avi Kivity , qemu-devel@nongnu.org, Christoph Hellwig 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? Stefan