Jlm
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 BitValueRepresentation &other)
 
 BitValueRepresentation (BitValueRepresentation &&other)
 
BitValueRepresentationoperator= (const BitValueRepresentation &other)
 
BitValueRepresentationoperator= (BitValueRepresentation &&other)
 
char & operator[] (size_t n)
 
const char & operator[] (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
 
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)
 

Private Member Functions

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< char > data_
 

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/4]

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

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

◆ BitValueRepresentation() [2/4]

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

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

◆ BitValueRepresentation() [3/4]

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

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

◆ BitValueRepresentation() [4/4]

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

Definition at line 65 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 161 of file value-representation.hpp.

◆ add() [2/2]

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

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

◆ Append()

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

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

◆ ashr()

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

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

◆ carry()

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

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

◆ concat()

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

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

◆ eq()

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

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

◆ is_defined()

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

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

◆ is_known()

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

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

◆ is_negative()

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

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

◆ land() [1/2]

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

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

◆ land() [2/2]

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

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

◆ lnot() [1/2]

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

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

◆ lnot() [2/2]

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

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

◆ lor() [1/2]

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

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

◆ lor() [2/2]

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

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

◆ lxor() [1/2]

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

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

◆ lxor() [2/2]

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

Definition at line 524 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 198 of file value-representation.hpp.

◆ mul() [2/2]

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

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

◆ nbits()

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

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

◆ ne()

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

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

◆ neg()

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

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

◆ operator!=() [1/3]

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

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

◆ operator!=() [2/3]

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

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

◆ operator!=() [3/3]

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

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

◆ operator=() [1/2]

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

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

◆ operator=() [2/2]

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

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

◆ operator==() [1/3]

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

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

◆ operator==() [2/3]

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

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

◆ operator==() [3/3]

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

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

◆ operator[]() [1/2]

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

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

◆ operator[]() [2/2]

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

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

◆ repeat()

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

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

◆ sdiv()

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

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

◆ sext()

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

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

◆ sge()

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

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

◆ sgt()

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

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

◆ shl()

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

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

◆ shr()

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

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

◆ sign()

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

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

◆ sle()

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

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

◆ slice()

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

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

◆ slt()

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

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

◆ smod()

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

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

◆ smulh()

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

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

◆ str()

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

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

◆ sub()

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

Definition at line 559 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.

◆ udiv() [1/2]

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

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

◆ udiv() [2/2]

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

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

◆ uge()

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

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

◆ ugt()

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

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

◆ ule()

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

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

◆ ult()

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

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

◆ umod()

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

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

◆ umulh()

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

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

◆ zext()

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

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

Member Data Documentation

◆ data_

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

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


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