Have you tested whether the intrinsics improve codegen on a recent compiler? There's a good chance they make the code non-portable while generating the same asm. 

Jon


On 7 Apr 2017 18:53, "fab10" <0xfab10@gmail.com> wrote:
I had a look at byteswap.h and it seems to me that the code is not very efficient. Every function in this header could be translated in a single assembly instruction with the gcc intrinsics:

__builtin_bswap16
__builtin_bswap32
__builtin_bswap64

Is there a reason to not use these gcc intrinsics?

Bye