CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esi::UInt Class Reference

#include <Values.h>

Inheritance diagram for esi::UInt:
Inheritance graph
[legend]
Collaboration diagram for esi::UInt:
Collaboration graph
[legend]

Public Member Functions

 UInt ()=default
 
 UInt (uint64_t v, unsigned width=64)
 
 operator uint64_t () const
 
 operator uint32_t () const
 
 operator uint16_t () const
 
 operator uint8_t () const
 
 MutableBitVector (size_t width)
 Owning, zero-initialized constructor of a given width.
 
 MutableBitVector (std::vector< byte > &&bytes, std::optional< size_t > width=std::nullopt)
 Owning constructor from an rvalue vector (must move in).
 
 MutableBitVector ()=default
 
 MutableBitVector (const MutableBitVector &other)
 
 MutableBitVector (const BitVector &other)
 
 MutableBitVector (MutableBitVector &&other) noexcept
 
 MutableBitVector (BitVector &&other)
 
- Public Member Functions inherited from esi::MutableBitVector
 MutableBitVector (size_t width)
 Owning, zero-initialized constructor of a given width.
 
 MutableBitVector (std::vector< byte > &&bytes, std::optional< size_t > width=std::nullopt)
 Owning constructor from an rvalue vector (must move in).
 
 MutableBitVector ()=default
 
 MutableBitVector (const MutableBitVector &other)
 
 MutableBitVector (const BitVector &other)
 
 MutableBitVector (MutableBitVector &&other) noexcept
 
 MutableBitVector (BitVector &&other)
 
MutableBitVectoroperator= (const MutableBitVector &other)
 
MutableBitVectoroperator= (MutableBitVector &&other) noexcept
 
void setBit (size_t i, bool v)
 Set the i-th bit.
 
std::span< const bytegetSpan () const
 Return a handle to the underlying span (always aligned since bitIndex=0).
 
std::vector< uint8_t > takeStorage ()
 Return and transfer ownership of the underlying storage.
 
MutableBitVectoroperator>>= (size_t n)
 In-place logical right shift that drops the least-significant n bits.
 
MutableBitVectoroperator<<= (size_t n)
 In-place logical left shift shifts in n zero bits at LSB, shifting existing bits upward.
 
MutableBitVectoroperator<<= (const MutableBitVector &other)
 In-place concatenate: appends bits from other to this.
 
MutableBitVectoroperator|= (const MutableBitVector &other)
 
MutableBitVectoroperator&= (const MutableBitVector &other)
 
MutableBitVectoroperator^= (const MutableBitVector &other)
 
MutableBitVector operator~ () const
 
MutableBitVector operator| (const MutableBitVector &other) const
 
MutableBitVector operator& (const MutableBitVector &other) const
 
MutableBitVector operator^ (const MutableBitVector &other) const
 
- Public Member Functions inherited from esi::BitVector
 BitVector (std::span< const byte > bytes, std::optional< size_t > width=std::nullopt, uint8_t bitIndex=0)
 Construct from an existing span.
 
 BitVector ()=default
 
 BitVector (const BitVector &other)
 
BitVectoroperator= (const BitVector &other)
 
size_t width () const
 
size_t size () const
 
bool getBit (size_t i) const
 Return the i-th bit (0 = LSB) as boolean.
 
std::span< const bytegetSpan () const
 Return a handle to the underlying span.
 
BitVector operator>> (size_t n) const
 Logical right shift that drops the least-significant n bits by advancing the byte/bit index and reducing width.
 
BitVectoroperator>>= (size_t n)
 
BitVector slice (size_t offset, size_t sliceWidth) const
 Create a new immutable view of a contiguous bit slice [offset, offset+sliceWidth).
 
BitVector lsb (size_t n) const
 Return a view of the N least-significant bits.
 
BitVector msb (size_t n) const
 Return a view of the N most-significant bits.
 
std::string toString (unsigned base=16) const
 
bool operator== (const BitVector &rhs) const
 
bool operator!= (const BitVector &rhs) const
 
bit_iterator begin () const
 Return an iterator to the first bit (LSB).
 
bit_iterator end () const
 Return an iterator past the last bit.
 

Additional Inherited Members

- Public Types inherited from esi::BitVector
using byte = uint8_t
 
- Protected Member Functions inherited from esi::BitVector
void checkHighBytesEqual (unsigned lowExclusive, uint8_t expectedByte, const char *fmt, unsigned target) const
 
- Protected Attributes inherited from esi::BitVector
std::span< const bytedata {}
 
size_t bitWidth = 0
 
uint8_t bitIndex = 0
 

Detailed Description

Definition at line 357 of file Values.h.

Constructor & Destructor Documentation

◆ UInt() [1/2]

esi::UInt::UInt ( )
default

◆ UInt() [2/2]

UInt::UInt ( uint64_t  v,
unsigned  width = 64 
)

Definition at line 466 of file Values.cpp.

References esi::MutableBitVector::setBit(), and esi::BitVector::width().

Member Function Documentation

◆ MutableBitVector() [1/7]

esi::MutableBitVector::MutableBitVector ( )
default

◆ MutableBitVector() [2/7]

MutableBitVector::MutableBitVector ( BitVector &&  other)

Definition at line 299 of file Values.cpp.

◆ MutableBitVector() [3/7]

MutableBitVector::MutableBitVector ( const BitVector other)

Definition at line 293 of file Values.cpp.

◆ MutableBitVector() [4/7]

MutableBitVector::MutableBitVector ( const MutableBitVector other)

Definition at line 290 of file Values.cpp.

◆ MutableBitVector() [5/7]

MutableBitVector::MutableBitVector ( MutableBitVector &&  other)
noexcept

Definition at line 296 of file Values.cpp.

◆ MutableBitVector() [6/7]

MutableBitVector::MutableBitVector ( size_t  width)
explicit

Owning, zero-initialized constructor of a given width.

Definition at line 281 of file Values.cpp.

◆ MutableBitVector() [7/7]

MutableBitVector::MutableBitVector ( std::vector< byte > &&  bytes,
std::optional< size_t >  width = std::nullopt 
)

Owning constructor from an rvalue vector (must move in).

Definition at line 284 of file Values.cpp.

◆ operator uint16_t()

esi::UInt::operator uint16_t ( ) const
inline

Definition at line 364 of file Values.h.

◆ operator uint32_t()

esi::UInt::operator uint32_t ( ) const
inline

Definition at line 363 of file Values.h.

◆ operator uint64_t()

esi::UInt::operator uint64_t ( ) const
inline

Definition at line 362 of file Values.h.

◆ operator uint8_t()

esi::UInt::operator uint8_t ( ) const
inline

Definition at line 365 of file Values.h.


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