16 #ifndef _INT128_TYPES_H_ 17 #define _INT128_TYPES_H_ 18 #include <core/storage/serialization/is_pod.hpp> 19 #include <boost/type_traits/is_scalar.hpp> 20 #include <type_traits> 27 #ifndef IN_TURI_SOURCE_TREE 28 #if __SIZEOF_INT128__ == 16 29 #define HAVE__int128_t 30 #define HAVE__uint128_t 36 typedef __int128_t int128_t;
37 #elif defined(HAVEint128_t) 39 #elif defined(HAVE__int128) 40 typedef __int128 int128_t;
41 #elif defined(HAVEint128) 42 typedef int128 int128_t;
44 #include <boost/multiprecision/cpp_int.hpp> 45 typedef boost::multiprecision::int128_t int128_t;
48 #ifdef HAVE__uint128_t 49 typedef __uint128_t uint128_t;
50 #elif defined(HAVEuint128_t) 52 #elif defined(HAVE__uint128) 53 typedef __uint128 uint128_t;
54 #elif defined(HAVEuint128) 55 typedef uint128 uint128_t;
56 #elif defined(HAVEunsigned__int128_t) 57 typedef unsigned __int128_t uint128_t;
58 #elif defined(HAVEunsignedint128_t) 59 typedef unsigned int128_t uint128_t;
60 #elif defined(HAVEunsigned__int128) 61 typedef unsigned __int128 uint128_t;
62 #elif defined(HAVEunsignedint128) 63 typedef unsigned int128 uint128_t;
65 #include <boost/multiprecision/cpp_int.hpp> 66 typedef boost::multiprecision::uint128_t uint128_t;
69 static inline uint128_t BuildUint128(uint64_t high, uint64_t low) {
70 return ((uint128_t(high) << 64) + low);
74 static inline std::ostream&
operator<<(std::ostream& out,
const uint128_t& x) {
76 s << std::hex << (uint64_t(x >> 64)) << uint64_t(x);
83 struct is_scalar<uint128_t> {
84 static const bool value =
true;
88 struct is_scalar<int128_t> {
89 static const bool value =
true;
98 struct is_scalar<uint128_t> {
99 static const bool value =
true;
103 struct is_scalar<int128_t> {
104 static const bool value =
true;
static std::ostream & operator<<(std::ostream &out, const uint128_t &x)
Enables printing of uint128_t values.