openMSX
Public Member Functions | Friends | List of all members
uint128 Class Reference

Unsigned 128-bit integer type. More...

#include <uint128.hh>

Public Member Functions

constexpr uint128 (uint64_t a)
 
constexpr bool operator== (const uint128 &) const =default
 
constexpr bool operator! () const
 
constexpr uint128 operator~ () const
 
constexpr uint128 operator- () const
 
constexpr uint128operator++ ()
 
constexpr uint128operator-- ()
 
constexpr uint128 operator++ (int)
 
constexpr uint128 operator-- (int)
 
constexpr uint128operator+= (const uint128 &b)
 
constexpr uint128operator-= (const uint128 &b)
 
constexpr uint128operator>>= (unsigned n)
 
constexpr uint128operator<<= (unsigned n)
 
constexpr uint128operator|= (const uint128 &b)
 
constexpr uint128operator&= (const uint128 &b)
 
constexpr uint128operator^= (const uint128 &b)
 
constexpr uint128operator/= (const uint128 &b)
 
constexpr uint128operator%= (const uint128 &b)
 
constexpr uint128operator*= (const uint128 &b)
 

Friends

constexpr friend uint128 operator+ (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator- (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator* (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator/ (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator% (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator>> (const uint128 &a, unsigned n)
 
constexpr friend uint128 operator<< (const uint128 &a, unsigned n)
 
constexpr friend uint128 operator& (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator| (const uint128 &a, const uint128 &b)
 
constexpr friend uint128 operator^ (const uint128 &a, const uint128 &b)
 
constexpr friend auto operator<=> (const uint128 &a, const uint128 &b)
 
constexpr uint64_t low64 (const uint128 &a)
 
constexpr uint64_t high64 (const uint128 &a)
 

Detailed Description

Unsigned 128-bit integer type.

Very simple implementation, not optimized for speed.

Loosely based on the 128-bit utility classes written by Jan Ringos, http://Tringi.Mx-3.cz

Definition at line 25 of file uint128.hh.

Constructor & Destructor Documentation

◆ uint128()

constexpr uint128::uint128 ( uint64_t  a)
inlineconstexpr

Definition at line 28 of file uint128.hh.

Member Function Documentation

◆ operator!()

constexpr bool uint128::operator! ( ) const
inlineconstexpr

Definition at line 32 of file uint128.hh.

◆ operator%=()

constexpr uint128 & uint128::operator%= ( const uint128 b)
inlineconstexpr

Definition at line 135 of file uint128.hh.

◆ operator&=()

constexpr uint128 & uint128::operator&= ( const uint128 b)
inlineconstexpr

Definition at line 116 of file uint128.hh.

◆ operator*=()

constexpr uint128 & uint128::operator*= ( const uint128 b)
constexpr

Definition at line 244 of file uint128.hh.

References t.

◆ operator++() [1/2]

constexpr uint128 & uint128::operator++ ( )
inlineconstexpr

Definition at line 48 of file uint128.hh.

◆ operator++() [2/2]

constexpr uint128 uint128::operator++ ( int  )
inlineconstexpr

Definition at line 60 of file uint128.hh.

◆ operator+=()

constexpr uint128 & uint128::operator+= ( const uint128 b)
inlineconstexpr

Definition at line 73 of file uint128.hh.

◆ operator-()

constexpr uint128 uint128::operator- ( ) const
inlineconstexpr

Definition at line 41 of file uint128.hh.

◆ operator--() [1/2]

constexpr uint128 & uint128::operator-- ( )
inlineconstexpr

Definition at line 54 of file uint128.hh.

◆ operator--() [2/2]

constexpr uint128 uint128::operator-- ( int  )
inlineconstexpr

Definition at line 66 of file uint128.hh.

◆ operator-=()

constexpr uint128 & uint128::operator-= ( const uint128 b)
inlineconstexpr

Definition at line 80 of file uint128.hh.

◆ operator/=()

constexpr uint128 & uint128::operator/= ( const uint128 b)
inlineconstexpr

Definition at line 129 of file uint128.hh.

◆ operator<<=()

constexpr uint128 & uint128::operator<<= ( unsigned  n)
inlineconstexpr

Definition at line 97 of file uint128.hh.

◆ operator==()

constexpr bool uint128::operator== ( const uint128 ) const
constexprdefault

◆ operator>>=()

constexpr uint128 & uint128::operator>>= ( unsigned  n)
inlineconstexpr

Definition at line 85 of file uint128.hh.

◆ operator^=()

constexpr uint128 & uint128::operator^= ( const uint128 b)
inlineconstexpr

Definition at line 122 of file uint128.hh.

◆ operator|=()

constexpr uint128 & uint128::operator|= ( const uint128 b)
inlineconstexpr

Definition at line 110 of file uint128.hh.

◆ operator~()

constexpr uint128 uint128::operator~ ( ) const
inlineconstexpr

Definition at line 37 of file uint128.hh.

Friends And Related Symbol Documentation

◆ high64

constexpr uint64_t high64 ( const uint128 a)
friend

Definition at line 225 of file uint128.hh.

◆ low64

constexpr uint64_t low64 ( const uint128 a)
friend

Definition at line 220 of file uint128.hh.

◆ operator%

constexpr friend uint128 operator% ( const uint128 a,
const uint128 b 
)
friend

Definition at line 184 of file uint128.hh.

◆ operator&

constexpr friend uint128 operator& ( const uint128 a,
const uint128 b 
)
friend

Definition at line 198 of file uint128.hh.

◆ operator*

constexpr friend uint128 operator* ( const uint128 a,
const uint128 b 
)
friend

Definition at line 176 of file uint128.hh.

◆ operator+

constexpr friend uint128 operator+ ( const uint128 a,
const uint128 b 
)
friend

Definition at line 168 of file uint128.hh.

◆ operator-

constexpr friend uint128 operator- ( const uint128 a,
const uint128 b 
)
friend

Definition at line 172 of file uint128.hh.

◆ operator/

constexpr friend uint128 operator/ ( const uint128 a,
const uint128 b 
)
friend

Definition at line 180 of file uint128.hh.

◆ operator<<

constexpr friend uint128 operator<< ( const uint128 a,
unsigned  n 
)
friend

Definition at line 193 of file uint128.hh.

◆ operator<=>

constexpr friend auto operator<=> ( const uint128 a,
const uint128 b 
)
friend

Definition at line 211 of file uint128.hh.

◆ operator>>

constexpr friend uint128 operator>> ( const uint128 a,
unsigned  n 
)
friend

Definition at line 189 of file uint128.hh.

◆ operator^

constexpr friend uint128 operator^ ( const uint128 a,
const uint128 b 
)
friend

Definition at line 206 of file uint128.hh.

◆ operator|

constexpr friend uint128 operator| ( const uint128 a,
const uint128 b 
)
friend

Definition at line 202 of file uint128.hh.


The documentation for this class was generated from the following file: