ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Attributes | List of all members
etiss::RegisterPart Class Reference

abstract description of needed or affected register bits. More...

#include <CodePart.h>

Collaboration diagram for etiss::RegisterPart:
Collaboration graph
[legend]

Public Member Functions

 RegisterPart ()
 
 RegisterPart (const std::string &name, unsigned registerWidth, etiss::uintMax bits=(uintMax)((intMax) -1))
 
 RegisterPart (const RegisterPart &cpy)
 
bool matches (const RegisterPart &rp) const
 check for equality More...
 
bool contains (const RegisterPart &rp) const
 check if passed RegisterPart is a subset of relevant bits of the same register More...
 
void applyShadow (const RegisterPart &rp) const
 this is not a const function in the usual sense. More...
 
void merge (const RegisterPart &rp) const
 this is not a const function in the usual sense. More...
 
void intersect (const RegisterPart &rp) const
 this is not a const function in the usual sense. More...
 
bool maskedBy (const RegisterPart &rp) const
 
const std::string & getName () const
 
const etiss::uintMax & getAffectedBits () const
 
const unsigned & getRegisterWidth () const
 
bool isEmpty () const
 true if unnamed or no relevant bits More...
 
bool operator< (const RegisterPart &other) const
 
bool operator== (const RegisterPart &other) const
 same as matches(const RegisterPart & other) More...
 

Private Attributes

std::string name
 
etiss::uintMax bits
 
unsigned regWidth
 

Detailed Description

abstract description of needed or affected register bits.

due to special behaviour of this class when used in a set (RegisterSet) not all const functions have const character. use with caution.

@TODO For consitency width's should really be size_t

Definition at line 75 of file CodePart.h.

Constructor & Destructor Documentation

◆ RegisterPart() [1/3]

etiss::RegisterPart::RegisterPart ( )
inline

Definition at line 78 of file CodePart.h.

◆ RegisterPart() [2/3]

etiss::RegisterPart::RegisterPart ( const std::string &  name,
unsigned  registerWidth,
etiss::uintMax  bits = (uintMax)((intMax)-1) 
)
inline
Parameters
nameregister name should be same as defined by the respective etiss::CPUArch instance.
registerWidththe register width in bits. must be consistet with the name and the context (e.g. cpu1 and cpu2 are allowed to have the same register with different widths).
bitsrelevant bits of the register (->register part).

Definition at line 85 of file CodePart.h.

References bits, and regWidth.

◆ RegisterPart() [3/3]

etiss::RegisterPart::RegisterPart ( const RegisterPart cpy)
inline

Definition at line 95 of file CodePart.h.

References bits, name, and regWidth.

Member Function Documentation

◆ applyShadow()

void etiss::RegisterPart::applyShadow ( const RegisterPart rp) const
inline

this is not a const function in the usual sense.

Definition at line 142 of file CodePart.h.

References bits, and name.

◆ contains()

bool etiss::RegisterPart::contains ( const RegisterPart rp) const
inline

check if passed RegisterPart is a subset of relevant bits of the same register

Definition at line 124 of file CodePart.h.

References bits, isEmpty(), name, and regWidth.

Referenced by maskedBy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAffectedBits()

const etiss::uintMax& etiss::RegisterPart::getAffectedBits ( ) const
inline

Definition at line 165 of file CodePart.h.

References bits.

◆ getName()

const std::string& etiss::RegisterPart::getName ( ) const
inline

Definition at line 164 of file CodePart.h.

References name.

Referenced by etiss::RegisterSet::lex_compare::operator()().

Here is the caller graph for this function:

◆ getRegisterWidth()

const unsigned& etiss::RegisterPart::getRegisterWidth ( ) const
inline

Definition at line 166 of file CodePart.h.

References regWidth.

◆ intersect()

void etiss::RegisterPart::intersect ( const RegisterPart rp) const
inline

this is not a const function in the usual sense.

Definition at line 158 of file CodePart.h.

References bits, and name.

◆ isEmpty()

bool etiss::RegisterPart::isEmpty ( ) const
inline

true if unnamed or no relevant bits

Definition at line 170 of file CodePart.h.

References bits, and name.

Referenced by etiss::RegisterSet::add(), contains(), matches(), and operator<().

Here is the caller graph for this function:

◆ maskedBy()

bool etiss::RegisterPart::maskedBy ( const RegisterPart rp) const
inline

Definition at line 163 of file CodePart.h.

References contains().

Here is the call graph for this function:

◆ matches()

bool etiss::RegisterPart::matches ( const RegisterPart rp) const
inline

check for equality

Definition at line 106 of file CodePart.h.

References bits, isEmpty(), name, and regWidth.

Referenced by operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge()

void etiss::RegisterPart::merge ( const RegisterPart rp) const
inline

this is not a const function in the usual sense.

Definition at line 150 of file CodePart.h.

References bits, and name.

◆ operator<()

bool etiss::RegisterPart::operator< ( const RegisterPart other) const
inline

Definition at line 171 of file CodePart.h.

References bits, isEmpty(), name, and regWidth.

Here is the call graph for this function:

◆ operator==()

bool etiss::RegisterPart::operator== ( const RegisterPart other) const
inline

same as matches(const RegisterPart & other)

Definition at line 189 of file CodePart.h.

References matches().

Here is the call graph for this function:

Member Data Documentation

◆ bits

etiss::uintMax etiss::RegisterPart::bits
mutableprivate

◆ name

std::string etiss::RegisterPart::name
private

◆ regWidth

unsigned etiss::RegisterPart::regWidth
private

Definition at line 194 of file CodePart.h.

Referenced by contains(), getRegisterWidth(), matches(), operator<(), and RegisterPart().


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