Swaps bytes in an 8 byte ulong end-to-end, i.e. byte 0 becomes byte 7, byte 1 becomes byte 6, etc. This is meant to be recognized by the compiler as an intrinsic.
assert(bswap(0x01020304_05060708uL) == 0x08070605_04030201uL); static ulong xx = 0x10203040_50607080uL; assert(bswap(xx) == 0x80706050_40302010uL);
See Implementation
Swaps bytes in an 8 byte ulong end-to-end, i.e. byte 0 becomes byte 7, byte 1 becomes byte 6, etc. This is meant to be recognized by the compiler as an intrinsic.