PATCH: Use__builtin_bswap[32|64] in i386/x86_64 bits/byteswap.h

H.J. Lu hjl.tools@gmail.com
Mon Mar 19 20:12:00 GMT 2012


On Mon, Mar 19, 2012 at 10:37 AM, Richard Henderson <rth@twiddle.net> wrote:
> On 03/19/12 10:33, H.J. Lu wrote:
>> Here is a patch to use __builtin_bswap[32|64] in i386/x86_64 bits/byteswap.h
>> for GCC >= 4.2.  I didn't use __builtin_bswap32 for __bswap_16 since it is
>> less efficient:
>
> For size, yes.  For speed, is the partial register stall on rorw larger than
> a single extra shift insn?
>

It is hard to tell which one is better.

-- 
H.J.



More information about the Libc-alpha mailing list