Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2014 08:54:35 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Alexander V. Chernikov" <melifaro@FreeBSD.org>
Subject:   Re: svn commit: r273274 - head/sys/netpfil/ipfw
Message-ID:  <6FEB1269-2A8D-48A7-A18E-2EAB9961EDA6@FreeBSD.org>
In-Reply-To: <5443A83F.5090807@FreeBSD.org>
References:  <201410191115.s9JBFJxA058370@svn.freebsd.org> <5443A83F.5090807@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

On 19 Oct 2014, at 13:02, Andriy Gapon <avg@FreeBSD.org> wrote:

> I think that on platforms where an optimized version of fls() is available that
> would work faster than this cool piece of bit magic.

If you're lucky, the compiler's idiom recogniser will spot this.  You're generally better off using the builtins though, because then the compiler will expand them to something sensible (hopefully - old versions of gcc did horribly inefficient things for bswap and clz on platforms without native support).

David



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6FEB1269-2A8D-48A7-A18E-2EAB9961EDA6>