Jlm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::rvsdg::BitValueRepresentation Class Reference

#include <value-representation.hpp>

Public Member Functions

 BitValueRepresentation (size_t nbits, int64_t value)
 
 BitValueRepresentation (const char *s)
 
 BitValueRepresentation (const char c)
 
 BitValueRepresentation (const BitValueRepresentation &other)
 
 BitValueRepresentation (BitValueRepresentation &&other)
 
BitValueRepresentationoperator= (const BitValueRepresentation &other)
 
BitValueRepresentationoperator= (BitValueRepresentation &&other)
 
charoperator[] (size_t n)
 
const charoperator[] (size_t n) const
 
bool operator== (const BitValueRepresentation &other) const noexcept
 
bool operator!= (const BitValueRepresentation &other) const noexcept
 
bool operator== (int64_t value) const
 
bool operator!= (int64_t value) const
 
bool operator== (const std::string &other) const noexcept
 
bool operator!= (const std::string &other) const noexcept
 
char sign () const noexcept
 
bool is_defined () const noexcept
 
bool is_known () const noexcept
 
bool is_negative () const noexcept
 
BitValueRepresentation concat (const BitValueRepresentation &other) const
 
BitValueRepresentation slice (size_t low, size_t high) const
 
BitValueRepresentation zext (size_t nbits) const
 
BitValueRepresentation sext (size_t nbits) const
 
BitValueRepresentation trunc (const size_t numBits) const
 
size_t nbits () const noexcept
 
std::string str () const
 
uint64_t to_uint () const
 
int64_t to_int () const
 
char ult (const BitValueRepresentation &other) const
 
char slt (const BitValueRepresentation &other) const
 
char ule (const BitValueRepresentation &other) const
 
char sle (const BitValueRepresentation &other) const
 
char ne (const BitValueRepresentation &other) const
 
char eq (const BitValueRepresentation &other) const
 
char sge (const BitValueRepresentation &other) const
 
char uge (const BitValueRepresentation &other) const
 
char sgt (const BitValueRepresentation &other) const
 
char ugt (const BitValueRepresentation &other) const
 
BitValueRepresentation add (const BitValueRepresentation &other) const
 
BitValueRepresentation land (const BitValueRepresentation &other) const
 
BitValueRepresentation lor (const BitValueRepresentation &other) const
 
BitValueRepresentation lxor (const BitValueRepresentation &other) const
 
BitValueRepresentation lnot () const
 
BitValueRepresentation neg () const
 
BitValueRepresentation sub (const BitValueRepresentation &other) const
 
BitValueRepresentation shr (size_t shift) const
 
BitValueRepresentation ashr (size_t shift) const
 
BitValueRepresentation shl (size_t shift) const
 
BitValueRepresentation udiv (const BitValueRepresentation &other) const
 
BitValueRepresentation umod (const BitValueRepresentation &other) const
 
BitValueRepresentation sdiv (const BitValueRepresentation &other) const
 
BitValueRepresentation smod (const BitValueRepresentation &other) const
 
BitValueRepresentation mul (const BitValueRepresentation &other) const
 
BitValueRepresentation umulh (const BitValueRepresentation &other) const
 
BitValueRepresentation smulh (const BitValueRepresentation &other) const
 
void Append (const BitValueRepresentation &other)
 

Static Public Member Functions

static BitValueRepresentation repeat (size_t nbits, char bit)
 
static BitValueRepresentation create (const std::vector< BitValueRepresentation > &bitValues)
 

Private Member Functions

 BitValueRepresentation ()=default
 
char lor (char a, char b) const noexcept
 
char lxor (char a, char b) const noexcept
 
char lnot (char a) const noexcept
 
char land (char a, char b) const noexcept
 
char carry (char a, char b, char c) const noexcept
 
char add (char a, char b, char c) const noexcept
 
void udiv (const BitValueRepresentation &divisor, BitValueRepresentation &quotient, BitValueRepresentation &remainder) const
 
void mul (const BitValueRepresentation &factor1, const BitValueRepresentation &factor2, BitValueRepresentation &product) const
 

Private Attributes

std::vector< chardata_ {}
 

Detailed Description

Value representation used for compile-time evaluation of bitstring expressions. A bit is either:

Definition at line 30 of file value-representation.hpp.

Constructor & Destructor Documentation

◆ BitValueRepresentation() [1/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( )
privatedefault

◆ BitValueRepresentation() [2/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( size_t  nbits,
int64_t  value 
)
inline

Definition at line 35 of file value-representation.hpp.

◆ BitValueRepresentation() [3/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( const char s)
inline

Definition at line 50 of file value-representation.hpp.

◆ BitValueRepresentation() [4/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( const char  c)
inlineexplicit

Definition at line 63 of file value-representation.hpp.

◆ BitValueRepresentation() [5/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( const BitValueRepresentation other)
inline

Definition at line 71 of file value-representation.hpp.

◆ BitValueRepresentation() [6/6]

jlm::rvsdg::BitValueRepresentation::BitValueRepresentation ( BitValueRepresentation &&  other)
inline

Definition at line 75 of file value-representation.hpp.

Member Function Documentation

◆ add() [1/2]

char jlm::rvsdg::BitValueRepresentation::add ( char  a,
char  b,
char  c 
) const
inlineprivatenoexcept

Definition at line 199 of file value-representation.hpp.

◆ add() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::add ( const BitValueRepresentation other) const
inline

Definition at line 522 of file value-representation.hpp.

◆ Append()

void jlm::rvsdg::BitValueRepresentation::Append ( const BitValueRepresentation other)
inline

Definition at line 745 of file value-representation.hpp.

◆ ashr()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::ashr ( size_t  shift) const
inline

Definition at line 619 of file value-representation.hpp.

◆ carry()

char jlm::rvsdg::BitValueRepresentation::carry ( char  a,
char  b,
char  c 
) const
inlineprivatenoexcept

Definition at line 193 of file value-representation.hpp.

◆ concat()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::concat ( const BitValueRepresentation other) const
inline

Definition at line 372 of file value-representation.hpp.

◆ create()

static BitValueRepresentation jlm::rvsdg::BitValueRepresentation::create ( const std::vector< BitValueRepresentation > &  bitValues)
inlinestatic

Creates a BitValueRepresentation from a vector of BitValueRepresentations by concatenating the input representations. The number of bits of the result representation is the sum of the number of bits of the input representations.

Parameters
bitValuesA vector of input representations
Returns
The concatenation of the input representations.
Precondition
The method expects at least a single element in bitValues.

Definition at line 96 of file value-representation.hpp.

◆ eq()

char jlm::rvsdg::BitValueRepresentation::eq ( const BitValueRepresentation other) const
inline

Definition at line 492 of file value-representation.hpp.

◆ is_defined()

bool jlm::rvsdg::BitValueRepresentation::is_defined ( ) const
inlinenoexcept

Definition at line 342 of file value-representation.hpp.

◆ is_known()

bool jlm::rvsdg::BitValueRepresentation::is_known ( ) const
inlinenoexcept

Definition at line 354 of file value-representation.hpp.

◆ is_negative()

bool jlm::rvsdg::BitValueRepresentation::is_negative ( ) const
inlinenoexcept

Definition at line 366 of file value-representation.hpp.

◆ land() [1/2]

char jlm::rvsdg::BitValueRepresentation::land ( char  a,
char  b 
) const
inlineprivatenoexcept

Definition at line 169 of file value-representation.hpp.

◆ land() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::land ( const BitValueRepresentation other) const
inline

Definition at line 540 of file value-representation.hpp.

◆ lnot() [1/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::lnot ( ) const
inline

Definition at line 582 of file value-representation.hpp.

◆ lnot() [2/2]

char jlm::rvsdg::BitValueRepresentation::lnot ( char  a) const
inlineprivatenoexcept

Definition at line 163 of file value-representation.hpp.

◆ lor() [1/2]

char jlm::rvsdg::BitValueRepresentation::lor ( char  a,
char  b 
) const
inlineprivatenoexcept

Definition at line 115 of file value-representation.hpp.

◆ lor() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::lor ( const BitValueRepresentation other) const
inline

Definition at line 554 of file value-representation.hpp.

◆ lxor() [1/2]

char jlm::rvsdg::BitValueRepresentation::lxor ( char  a,
char  b 
) const
inlineprivatenoexcept

Definition at line 139 of file value-representation.hpp.

◆ lxor() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::lxor ( const BitValueRepresentation other) const
inline

Definition at line 568 of file value-representation.hpp.

◆ mul() [1/2]

void jlm::rvsdg::BitValueRepresentation::mul ( const BitValueRepresentation factor1,
const BitValueRepresentation factor2,
BitValueRepresentation product 
) const
inlineprivate

Definition at line 236 of file value-representation.hpp.

◆ mul() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::mul ( const BitValueRepresentation other) const
inline

Definition at line 705 of file value-representation.hpp.

◆ nbits()

size_t jlm::rvsdg::BitValueRepresentation::nbits ( ) const
inlinenoexcept

Definition at line 415 of file value-representation.hpp.

◆ ne()

char jlm::rvsdg::BitValueRepresentation::ne ( const BitValueRepresentation other) const
inline

Definition at line 479 of file value-representation.hpp.

◆ neg()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::neg ( ) const
inline

Definition at line 588 of file value-representation.hpp.

◆ operator!=() [1/3]

bool jlm::rvsdg::BitValueRepresentation::operator!= ( const BitValueRepresentation other) const
inlinenoexcept

Definition at line 297 of file value-representation.hpp.

◆ operator!=() [2/3]

bool jlm::rvsdg::BitValueRepresentation::operator!= ( const std::string &  other) const
inlinenoexcept

Definition at line 330 of file value-representation.hpp.

◆ operator!=() [3/3]

bool jlm::rvsdg::BitValueRepresentation::operator!= ( int64_t  value) const
inline

Definition at line 309 of file value-representation.hpp.

◆ operator=() [1/2]

BitValueRepresentation & jlm::rvsdg::BitValueRepresentation::operator= ( BitValueRepresentation &&  other)
inline

Definition at line 267 of file value-representation.hpp.

◆ operator=() [2/2]

BitValueRepresentation & jlm::rvsdg::BitValueRepresentation::operator= ( const BitValueRepresentation other)
inline

Definition at line 260 of file value-representation.hpp.

◆ operator==() [1/3]

bool jlm::rvsdg::BitValueRepresentation::operator== ( const BitValueRepresentation other) const
inlinenoexcept

Definition at line 291 of file value-representation.hpp.

◆ operator==() [2/3]

bool jlm::rvsdg::BitValueRepresentation::operator== ( const std::string &  other) const
inlinenoexcept

Definition at line 315 of file value-representation.hpp.

◆ operator==() [3/3]

bool jlm::rvsdg::BitValueRepresentation::operator== ( int64_t  value) const
inline

Definition at line 303 of file value-representation.hpp.

◆ operator[]() [1/2]

char & jlm::rvsdg::BitValueRepresentation::operator[] ( size_t  n)
inline

Definition at line 277 of file value-representation.hpp.

◆ operator[]() [2/2]

const char & jlm::rvsdg::BitValueRepresentation::operator[] ( size_t  n) const
inline

Definition at line 284 of file value-representation.hpp.

◆ repeat()

static BitValueRepresentation jlm::rvsdg::BitValueRepresentation::repeat ( size_t  nbits,
char  bit 
)
inlinestatic

Definition at line 80 of file value-representation.hpp.

◆ sdiv()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::sdiv ( const BitValueRepresentation other) const
inline

Definition at line 659 of file value-representation.hpp.

◆ sext()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::sext ( size_t  nbits) const
inline

Definition at line 400 of file value-representation.hpp.

◆ sge()

char jlm::rvsdg::BitValueRepresentation::sge ( const BitValueRepresentation other) const
inline

Definition at line 498 of file value-representation.hpp.

◆ sgt()

char jlm::rvsdg::BitValueRepresentation::sgt ( const BitValueRepresentation other) const
inline

Definition at line 510 of file value-representation.hpp.

◆ shl()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::shl ( size_t  shift) const
inline

Definition at line 629 of file value-representation.hpp.

◆ shr()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::shr ( size_t  shift) const
inline

Definition at line 609 of file value-representation.hpp.

◆ sign()

char jlm::rvsdg::BitValueRepresentation::sign ( ) const
inlinenoexcept

Definition at line 336 of file value-representation.hpp.

◆ sle()

char jlm::rvsdg::BitValueRepresentation::sle ( const BitValueRepresentation other) const
inline

Definition at line 470 of file value-representation.hpp.

◆ slice()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::slice ( size_t  low,
size_t  high 
) const
inline

Definition at line 380 of file value-representation.hpp.

◆ slt()

char jlm::rvsdg::BitValueRepresentation::slt ( const BitValueRepresentation other) const
inline

Definition at line 447 of file value-representation.hpp.

◆ smod()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::smod ( const BitValueRepresentation other) const
inline

Definition at line 682 of file value-representation.hpp.

◆ smulh()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::smulh ( const BitValueRepresentation other) const
inline

Definition at line 731 of file value-representation.hpp.

◆ str()

std::string jlm::rvsdg::BitValueRepresentation::str ( ) const
inline

Definition at line 421 of file value-representation.hpp.

◆ sub()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::sub ( const BitValueRepresentation other) const
inline

Definition at line 603 of file value-representation.hpp.

◆ to_int()

int64_t jlm::rvsdg::BitValueRepresentation::to_int ( ) const

Definition at line 51 of file value-representation.cpp.

◆ to_uint()

uint64_t jlm::rvsdg::BitValueRepresentation::to_uint ( ) const

Definition at line 15 of file value-representation.cpp.

◆ trunc()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::trunc ( const size_t  numBits) const
inline

Definition at line 409 of file value-representation.hpp.

◆ udiv() [1/2]

void jlm::rvsdg::BitValueRepresentation::udiv ( const BitValueRepresentation divisor,
BitValueRepresentation quotient,
BitValueRepresentation remainder 
) const
inlineprivate

Definition at line 205 of file value-representation.hpp.

◆ udiv() [2/2]

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::udiv ( const BitValueRepresentation other) const
inline

Definition at line 641 of file value-representation.hpp.

◆ uge()

char jlm::rvsdg::BitValueRepresentation::uge ( const BitValueRepresentation other) const
inline

Definition at line 504 of file value-representation.hpp.

◆ ugt()

char jlm::rvsdg::BitValueRepresentation::ugt ( const BitValueRepresentation other) const
inline

Definition at line 516 of file value-representation.hpp.

◆ ule()

char jlm::rvsdg::BitValueRepresentation::ule ( const BitValueRepresentation other) const
inline

Definition at line 456 of file value-representation.hpp.

◆ ult()

char jlm::rvsdg::BitValueRepresentation::ult ( const BitValueRepresentation other) const
inline

Definition at line 433 of file value-representation.hpp.

◆ umod()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::umod ( const BitValueRepresentation other) const
inline

Definition at line 650 of file value-representation.hpp.

◆ umulh()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::umulh ( const BitValueRepresentation other) const
inline

Definition at line 717 of file value-representation.hpp.

◆ zext()

BitValueRepresentation jlm::rvsdg::BitValueRepresentation::zext ( size_t  nbits) const
inline

Definition at line 391 of file value-representation.hpp.

Member Data Documentation

◆ data_

std::vector<char> jlm::rvsdg::BitValueRepresentation::data_ {}
private

Definition at line 752 of file value-representation.hpp.


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