Skip to content

Instantly share code, notes, and snippets.

@jterrazz
Created July 21, 2019 16:55
Show Gist options
  • Save jterrazz/9b96f97af4b89c6e939b5971a2eb7c16 to your computer and use it in GitHub Desktop.
Save jterrazz/9b96f97af4b89c6e939b5971a2eb7c16 to your computer and use it in GitHub Desktop.
uint64_t ft_bswap_uint64(uint64_t x)
{
x = ((x << 8) & 0xFF00FF00FF00FF00ULL ) | ((x >> 8) & 0x00FF00FF00FF00FFULL );
x = ((x << 16) & 0xFFFF0000FFFF0000ULL ) | ((x >> 16) & 0x0000FFFF0000FFFFULL );
return (x << 32) | (x >> 32);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment