FLANG
Fortran::evaluate::value::IntegerValueImpl Class Reference

Classes

struct  PowerWithErrors
struct  Product
struct  QuotientWithRemainder
struct  ValueWithCarry
struct  ValueWithOverflow

Public Types

using I8 = Integer<8>
using I16 = Integer<16>
using I32 = Integer<32>
using I64 = Integer<64>
using I80 = X87IntegerContainer
using I128 = Integer<128>
using Storage = std::variant<std::monostate, I8, I16, I32, I64, I80, I128>

Public Member Functions

 IntegerValueImpl (const IntegerValueImpl &)=default
 IntegerValueImpl (IntegerValueImpl &&)=default
IntegerValueImpl & operator= (const IntegerValueImpl &)=default
IntegerValueImpl & operator= (IntegerValueImpl &&)=default
 IntegerValueImpl (int kind, const IntegerValueImpl &x)
 IntegerValueImpl (int kind, uint64_t v, bool isSigned)
 IntegerValueImpl (int kind, Fortran::common::uint128_t v)
void print (llvm::raw_ostream &os) const
LLVM_DUMP_METHOD void dump () const
bool IsNull () const
int kind () const
int bits () const
std::size_t bytesStored () const
bool IsZero () const
bool IsNegative () const
std::uint64_t ToUInt64 () const
std::int64_t ToInt64 () const
Fortran::common::uint128_t ToUInt128 () const
Fortran::common::int128_t ToInt128 () const
Ordering CompareSigned (const IntegerValueImpl &y) const
Ordering CompareUnsigned (const IntegerValueImpl &y) const
Ordering CompareToZeroSigned () const
ValueWithOverflow Negate () const
ValueWithOverflow ABS () const
ValueWithCarry AddUnsigned (const IntegerValueImpl &y, bool carryIn=false) const
ValueWithOverflow AddSigned (const IntegerValueImpl &y) const
ValueWithOverflow SubtractSigned (const IntegerValueImpl &y) const
ValueWithOverflow DIM (const IntegerValueImpl &y) const
ValueWithOverflow SIGN (const IntegerValueImpl &sign) const
Product MultiplySigned (const IntegerValueImpl &y) const
Product MultiplyUnsigned (const IntegerValueImpl &y) const
QuotientWithRemainder DivideSigned (const IntegerValueImpl &y) const
QuotientWithRemainder DivideUnsigned (const IntegerValueImpl &y) const
ValueWithOverflow MODULO (const IntegerValueImpl &y) const
PowerWithErrors Power (const IntegerValueImpl &e) const
IntegerValueImpl NOT () const
IntegerValueImpl IAND (const IntegerValueImpl &y) const
IntegerValueImpl IOR (const IntegerValueImpl &y) const
IntegerValueImpl IEOR (const IntegerValueImpl &y) const
IntegerValueImpl MERGE_BITS (const IntegerValueImpl &y, const IntegerValueImpl &mask) const
IntegerValueImpl MAX (const IntegerValueImpl &y) const
IntegerValueImpl MIN (const IntegerValueImpl &y) const
IntegerValueImpl ISHFT (int count) const
IntegerValueImpl SHIFTL (int count) const
IntegerValueImpl SHIFTR (int count) const
IntegerValueImpl SHIFTA (int count) const
IntegerValueImpl ISHFTC (int count, int size) const
IntegerValueImpl ISHFTC (int count) const
IntegerValueImpl IBITS (int pos, int size) const
IntegerValueImpl IBSET (int pos) const
IntegerValueImpl IBCLR (int pos) const
IntegerValueImpl DSHIFTL (const IntegerValueImpl &fill, int count) const
IntegerValueImpl DSHIFTR (const IntegerValueImpl &v2, int count) const
bool BTEST (int pos) const
int LEADZ () const
int TRAILZ () const
int POPCNT () const
bool POPPAR () const
std::string SignedDecimal () const
std::string UnsignedDecimal () const
std::string Hexadecimal () const
void StoreRawBytes (void *dst, size_t size, bool *changed) const
template<typename T>
const T & GetWord () const
template<typename F>
auto WithWordProto (F &&f) const -> decltype(std::declval< F >()(std::declval< I64 >()))
template<typename F>
auto WithWord (F &&f) const -> decltype(f(std::declval< const I64 & >()))

Static Public Member Functions

static IntegerValueImpl Zero (int kind)
template<typename T>
static IntegerValueImpl FromWord (const T &n)
static IntegerValueImpl FromRawBytes (int kind, const void *raw, std::size_t expectedSize)
static constexpr std::size_t bytesStored (int kind)
static IntegerValueImpl MASKL (int kind, int places)
 Left-justified mask (e.g., MASKL(1) has only its sign bit set)
static IntegerValueImpl MASKR (int kind, int places)
 Right-justified mask (e.g., MASKR(1) == 1, MASKR(2) == 3, &c.)
static IntegerValueImpl HUGE (int kind)
static IntegerValueImpl Least (int kind)
static ValueWithOverflow ConvertSigned (int toKind, const IntegerValueImpl &from)
static ValueWithOverflow ConvertUnsigned (int toKind, const IntegerValueImpl &from)
static ValueWithOverflow Read (int kind, const char *&pp, int base, bool isSigned)
template<typename F>
static auto WithWordProto (int kind, F &&f) -> decltype(std::declval< F >()(std::declval< I64 >()))

Member Function Documentation

◆ GetWord()

template<typename T>
const T & Fortran::evaluate::value::IntegerValueImpl::GetWord ( ) const
inline

Return a word of the requested type (value::Integer<BITS>). The current stored word must match that type or we crash.


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