Reverse the eight bytes of an int64.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | x |
pure function bswap_int64(x) result(y) !! Reverse the eight bytes of an `int64`. integer(int64), intent(in) :: x integer(int64) :: y y = ior(ior(ior(ishft(ibits(x, 0, BITS_PER_BYTE), 56), ishft(ibits(x, 8, BITS_PER_BYTE), 48)), & ior(ishft(ibits(x, 16, BITS_PER_BYTE), 40), ishft(ibits(x, 24, BITS_PER_BYTE), 32))), & ior(ior(ishft(ibits(x, 32, BITS_PER_BYTE), 24), ishft(ibits(x, 40, BITS_PER_BYTE), 16)), & ior(ishft(ibits(x, 48, BITS_PER_BYTE), 8), ibits(x, 56, BITS_PER_BYTE)))) end function bswap_int64