7 #ifndef IG_OMW_OMWINT_H
8 #define IG_OMW_OMWINT_H
21 #define OMW_8BIT_ALL (0xFF)
22 #define OMW_8BIT_LSB (0x01)
23 #define OMW_8BIT_MSB (0x80)
25 #define OMW_16BIT_ALL (0xFFFF)
26 #define OMW_16BIT_LSB (0x0001)
27 #define OMW_16BIT_MSB (0x8000)
29 #define OMW_32BIT_ALL (0xFFFFFFFF)
30 #define OMW_32BIT_LSB (0x00000001)
31 #define OMW_32BIT_MSB (0x80000000)
33 #define OMW_64BIT_ALL (0xFFFFFFFFFFFFFFFF)
34 #define OMW_64BIT_LSB (0x0000000000000001)
35 #define OMW_64BIT_MSB (0x8000000000000000)
52 Base_Int128(uint32_t valueHH, uint32_t valueLH, uint32_t valueHL, uint32_t valueLL);
55 void set(uint64_t valueH, uint64_t valueL);
56 void set(uint32_t valueHH, uint32_t valueLH, uint32_t valueHL, uint32_t valueLL);
57 void sets(int64_t value);
58 void sets(int64_t valueH, uint64_t valueL);
59 void sets(int32_t valueHH, uint32_t valueLH, uint32_t valueHL, uint32_t valueLL);
60 void sets(
const uint8_t* data,
size_t count);
61 void setu(uint64_t value);
62 void setu(
const uint8_t* data,
size_t count);
64 uint64_t high()
const {
return m_h; }
65 uint64_t hi()
const {
return high(); }
66 int64_t highs()
const;
67 int64_t his()
const {
return highs(); }
68 uint64_t low()
const {
return m_l; }
69 uint64_t lo()
const {
return low(); }
71 explicit operator bool()
const {
return (m_h || m_l); }
80 void readBuffer(
const uint8_t* data,
size_t count);
106 SignedInt128(uint32_t valueHH, uint32_t valueLH, uint32_t valueHL, uint32_t valueLL);
110 bool isNegative()
const;
120 #ifdef OMWi_INT_RIGHTSHIFT_DEBUG
121 uint64_t oldValue_h, oldValue_l;
122 uint64_t lastMask_h, lastMask_l;
133 UnsignedInt128(uint32_t valueHH, uint32_t valueLH, uint32_t valueHL, uint32_t valueLL);
227 #define OMW_128BIT_ALL (omw::Base_Int128(OMW_64BIT_ALL, OMW_64BIT_ALL))
228 #define OMW_128BIT_LSB (omw::Base_Int128(0, OMW_64BIT_LSB))
229 #define OMW_128BIT_MSB (omw::Base_Int128(OMW_64BIT_MSB, 0))
231 #define OMW_INT128_MIN (omw::int128_t(OMW_64BIT_MSB, 0))
232 #define OMW_INT128_MAX (omw::int128_t(~OMW_64BIT_MSB, OMW_64BIT_ALL))
233 #define OMW_UINT128_MAX (omw::uint128_t(OMW_64BIT_ALL, OMW_64BIT_ALL))
237 #endif // IG_OMW_OMWINT_H