Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170407180104.GS17319@brightrain.aerifal.cx>
Date: Fri, 7 Apr 2017 14:01:04 -0400
From: Rich Felker <dalias@...c.org>
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?

Because the compile should be (and as far as I know, is) generating
the optimal single instructions from the portable C, without the need
for hackish non-portable intrinsics.

Rich

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.