On Wed, Feb 19, 2014 at 3:32 PM, Ilia Mirkin <imir...@alum.mit.edu> wrote: > On Wed, Feb 19, 2014 at 6:09 PM, Tom Stellard <thomas.stell...@amd.com> wrote: >> +/** >> + * Reverse byte order of a 64bit word. >> + */ >> +static INLINE uint64_t >> +util_bswap64(uint64_t n) >> +{ >> + return ((uint64_t)util_bswap32(n & 0xffffffff) << 32) | >> + util_bswap32((n >> 32)); > > Perhaps use __builtin_bswap64 if it's available? Not sure when it > became available though.
When I fixed up bswap stuff in the X server a few years ago, I discovered that gcc was really good at detecting open-coded bswap, and less good at recognizing when it could constant fold __builtin_bswap. Do some experiments, but make sure your experiments include not using __builtin_bswap32 in util_bswap32. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev