Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 7 Apr 2017 20:07:42 +0200
From: Joakim Sindholt <opensource@...sha.com>
To: musl@...ts.openwall.com
Subject: Re: byteswap.h

On Fri, Apr 07, 2017 at 07:53:09PM +0200, fab10 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
> 

While musl does employ GNU C features in quite a few places it's just
plain unnecessary here.

https://godbolt.org/g/eLZWwI

When optimized those functions yield a single bswap instruction anyway,
because GCC is smart enough to deduce this.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.