From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kp6Si-0004Fn-L1 for qemu-devel@nongnu.org; Sun, 12 Oct 2008 15:18:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kp6Si-0004FR-7z for qemu-devel@nongnu.org; Sun, 12 Oct 2008 15:18:44 -0400 Received: from [199.232.76.173] (port=41141 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kp6Sh-0004FM-UV for qemu-devel@nongnu.org; Sun, 12 Oct 2008 15:18:43 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:43728) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kp6Sh-0001GA-HJ for qemu-devel@nongnu.org; Sun, 12 Oct 2008 15:18:43 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [5465] hw/apic.c: use __builtin funtions instead of assembly code Date: Sun, 12 Oct 2008 20:17:08 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200810122017.09078.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno On Sunday 12 October 2008, Aurelien Jarno wrote: > =C2=A0static int fls_bit(uint32_t value) > =C2=A0{ > +#if defined(__GNUC__) > + =C2=A0 =C2=A0return 31 - __builtin_clz(value); This should be using clz32, not duplicating this code. Paul