libTriton  version 1.0 build 1558
tritonTypes.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITONTYPES_H
9#define TRITONTYPES_H
10
11#include <cstddef>
12#include <cstdint>
13
14#include <triton/config.hpp>
15
16#ifdef TRITON_BOOST_INTERFACE
17 #include <boost/multiprecision/cpp_int.hpp>
18 #include <boost/numeric/conversion/cast.hpp>
19#else
20 #include <triton/uintwide_t.h>
21#endif
22
23
24
26namespace triton {
33 typedef std::uint8_t uint8;
34
36 typedef std::uint16_t uint16;
37
39 typedef std::uint32_t uint32;
40
42 typedef std::uint64_t uint64;
43
45 #ifdef TRITON_BOOST_INTERFACE
46 typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<80, 80, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>> uint80;
47 #else
48 typedef math::wide_integer::uintwide_t<static_cast<size_t>(UINT32_C(80)), std::uint16_t> uint80;
49 #endif
50
52 #ifdef TRITON_BOOST_INTERFACE
53 typedef boost::multiprecision::uint128_t uint128;
54 #else
56 #endif
57
59 #ifdef TRITON_BOOST_INTERFACE
60 typedef boost::multiprecision::uint256_t uint256;
61 #else
63 #endif
64
66 #ifdef TRITON_BOOST_INTERFACE
67 typedef boost::multiprecision::uint512_t uint512;
68 #else
70 #endif
71
73 typedef std::int8_t sint8;
74
76 typedef std::int16_t sint16;
77
79 typedef std::int32_t sint32;
80
82 typedef std::int64_t sint64;
83
85 #ifdef TRITON_BOOST_INTERFACE
86 typedef boost::multiprecision::int128_t sint128;
87 #else
89 #endif
90
92 #ifdef TRITON_BOOST_INTERFACE
93 typedef boost::multiprecision::int256_t sint256;
94 #else
96 #endif
97
99 #ifdef TRITON_BOOST_INTERFACE
100 typedef boost::multiprecision::int512_t sint512;
101 #else
103 #endif
104
106 typedef std::size_t usize;
107
108 #if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__)
110 typedef unsigned long long __uint;
111
113 typedef signed long long __sint;
114 #endif
115
116 #if defined(__i386) || defined(_M_IX86)
118 typedef unsigned int __uint;
119
121 typedef signed int __sint;
122 #endif
123
127 template<typename T>
129 public:
131 T operator()(const T& key) const {
132 return key;
133 }
134 };
135
137}; /* triton namespace */
138
139#endif /* TRITONTYPES_H */
Used as a hash function in hash tables containers (std::unordered_map, robin_map).
T operator()(const T &key) const
Returns the key as is.
math::wide_integer::uint128_t uint128
unsigned 128-bits
Definition: tritonTypes.hpp:55
std::int32_t sint32
signed 32-bits
Definition: tritonTypes.hpp:79
std::int16_t sint16
signed 16-bits
Definition: tritonTypes.hpp:76
math::wide_integer::uint256_t uint256
unsigned 256-bits
Definition: tritonTypes.hpp:62
std::uint16_t uint16
unisgned 16-bits
Definition: tritonTypes.hpp:36
math::wide_integer::int512_t sint512
signed 512-bits
std::int64_t sint64
signed 64-bits
Definition: tritonTypes.hpp:82
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
math::wide_integer::int128_t sint128
signed 128-bits
Definition: tritonTypes.hpp:88
signed long long __sint
signed long long if the arch is 64-bits.
std::int8_t sint8
signed 8-bits
Definition: tritonTypes.hpp:73
math::wide_integer::uintwide_t< static_cast< size_t >(UINT32_C(80)), std::uint16_t > uint80
unsigned 80-bits
Definition: tritonTypes.hpp:48
math::wide_integer::int256_t sint256
signed 256-bits
Definition: tritonTypes.hpp:95
std::uint64_t uint64
unisgned 64-bits
Definition: tritonTypes.hpp:42
math::wide_integer::uint512_t uint512
unsigned 512-bits
Definition: tritonTypes.hpp:69
std::uint32_t uint32
unisgned 32-bits
Definition: tritonTypes.hpp:39
unsigned long long __uint
unsigned long long if the arch is 64-bits.
std::uint8_t uint8
unisgned 8-bits
Definition: tritonTypes.hpp:33
The Triton namespace.