On Tue, Jan 10, 2012 at 03:37:51PM +0000, Peter Maydell wrote: > On 10 January 2012 10:27, Edgar E. Iglesias <edgar.igles...@gmail.com> 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