Thanks for the suggestions, Kristian.
I for some reason didn't notice that __builtin_bswap things.

Best regards.
HF


23.01.2014 19:51, Kristian Nielsen wrote:
Kristian Nielsen <kniel...@knielsen-hq.org> 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     : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to