From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkdpB-0002xl-UI for qemu-devel@nongnu.org; Tue, 10 Jan 2012 10:41:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rkdp6-0006Vr-8U for qemu-devel@nongnu.org; Tue, 10 Jan 2012 10:41:21 -0500 Received: from mail-lpp01m010-f45.google.com ([209.85.215.45]:49998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkdp6-0006Vg-1U for qemu-devel@nongnu.org; Tue, 10 Jan 2012 10:41:16 -0500 Received: by lagy4 with SMTP id y4so2140981lag.4 for ; Tue, 10 Jan 2012 07:41:14 -0800 (PST) Date: Tue, 10 Jan 2012 16:41:12 +0100 From: "Edgar E. Iglesias" Message-ID: <20120110154112.GF7565@edde.se.axis.com> References: <1326191247-14880-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] microblaze: Add support for the clz insn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Tue, Jan 10, 2012 at 03:37:51PM +0000, Peter Maydell wrote: > On 10 January 2012 10:27, Edgar E. Iglesias wrote: > > +uint32_t helper_clz(uint32_t t0) > > +{ > > +    if (t0 == 0) { > > +        return 32; > > +    } > > +    if (t0 == ~0) { > > +        return 0; > > +    } > > +    return clz32(t0); > > +} > > I think clz32() handles both the 0 and 0xffffffff cases correctly, > so they don't need special-casing. That seems to be the case, I'll fix that, thanks. Cheers