139 |
|
**/ |
140 |
|
|
141 |
|
#if defined(__GNUC__) |
142 |
< |
#if defined(__x86_64__) |
142 |
> |
#if defined(__x86_64__) || defined(__i386__) |
143 |
|
// Linux/AMD64 currently has no asm optimized bswap_32() in <byteswap.h> |
144 |
|
#define opt_bswap_32 do_opt_bswap_32 |
145 |
|
static inline uint32 do_opt_bswap_32(uint32 x) |
184 |
|
((x & 0x000000ff) << 24) ); |
185 |
|
} |
186 |
|
|
187 |
+ |
#if defined(__i386__) |
188 |
+ |
#define opt_bswap_64 do_opt_bswap_64 |
189 |
+ |
static inline uint64 do_opt_bswap_64(uint64 x) |
190 |
+ |
{ |
191 |
+ |
return (bswap_32(x >> 32) | (((uint64)bswap_32((uint32)x)) << 32)); |
192 |
+ |
} |
193 |
+ |
#endif |
194 |
+ |
|
195 |
|
#ifdef opt_bswap_64 |
196 |
|
#undef bswap_64 |
197 |
|
#define bswap_64 opt_bswap_64 |