This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize manual byte swap implementations using the GCC bswap builtin
On Fri, Nov 28, 2008 at 7:18 AM, Andreas Krebbel
<krebbel@linux.vnet.ibm.com> wrote:
> Hello Andrew,
>
>> Did you check htons() et al?
>
> Nope. But the glibc bswap implementation matches what the kernel
> does. Taken from bits/byteswap.h:
Some implementation of htons use inline-asm directly so it cannot be
optimized in a same way to the builtin.
Thanks,
Andrew Pinski