Kristian Nielsen <[email protected]> writes:
> Do it like this:
> static inline ulonglong
> mi_uint6korr(const void *p)
> {
> uint32 a= *(uint32 *)p;
> uint16 b= *(uint16 *)(4+(char *)p);
> ulonglong v= ((ulonglong)a | ((ulonglong)b << 32)) << 16;
> asm ("bswapq %0" : "=r" (v) : "0" (v));
> return v;
> }
Note that GCC also has __builtin_bswap64() (and __builtin_bswap32()). They
also generate bswap instruction, but would also work on other platforms...
- Kristian.
_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help : https://help.launchpad.net/ListHelp