Go to the documentation of this file. 77 #ifndef include_big_endian_h 78 #define include_big_endian_h 81 #include <include/hpctoolkit-config.h> 87 #ifdef USE_SYSTEM_BYTESWAP 94 #define _raw_byte_swap_16(x) bswap_16(x) 95 #define _raw_byte_swap_32(x) bswap_32(x) 96 #define _raw_byte_swap_64(x) bswap_64(x) 104 #define _raw_byte_swap_16(x) \ 105 ( (((x) & 0xff00) >> 8) \ 106 | (((x) & 0x00ff) << 8) ) 108 #define _raw_byte_swap_32(x) \ 109 ( (((x) & 0xff000000) >> 24) \ 110 | (((x) & 0x00ff0000) >> 8) \ 111 | (((x) & 0x0000ff00) << 8) \ 112 | (((x) & 0x000000ff) << 24) ) 114 #define _raw_byte_swap_64(x) \ 115 ( (((x) & 0xff00000000000000) >> 56) \ 116 | (((x) & 0x00ff000000000000) >> 40) \ 117 | (((x) & 0x0000ff0000000000) >> 24) \ 118 | (((x) & 0x000000ff00000000) >> 8) \ 119 | (((x) & 0x00000000ff000000) << 8) \ 120 | (((x) & 0x0000000000ff0000) << 24) \ 121 | (((x) & 0x000000000000ff00) << 40) \ 122 | (((x) & 0x00000000000000ff) << 56) ) 130 #ifdef HOST_BIG_ENDIAN 135 #define host_to_be_16(x) ((uint16_t) (x)) 136 #define host_to_be_32(x) ((uint32_t) (x)) 137 #define host_to_be_64(x) ((uint64_t) (x)) 143 #define host_to_be_16(x) _raw_byte_swap_16((uint16_t) (x)) 144 #define host_to_be_32(x) _raw_byte_swap_32((uint32_t) (x)) 145 #define host_to_be_64(x) _raw_byte_swap_64((uint64_t) (x)) 152 #define be_to_host_16(x) host_to_be_16(x) 153 #define be_to_host_32(x) host_to_be_32(x) 154 #define be_to_host_64(x) host_to_be_64(x) 156 #endif // include_big_endian_h