gem5  v22.1.0.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gem5::InstResult Class Reference

#include <inst_res.hh>

Public Member Functions

 InstResult ()
 Default constructor creates an invalid result. More...
 
 InstResult (const InstResult &other)
 
 InstResult (const RegClass &reg_class, RegVal val)
 
 InstResult (const RegClass &reg_class, const void *val)
 
InstResultoperator= (const InstResult &that)
 
bool operator== (const InstResult &that) const
 Result comparison Two invalid results always differ. More...
 
bool operator!= (const InstResult &that) const
 
const RegClassregClass () const
 
bool isValid () const
 
bool isBlob () const
 
RegVal asRegVal () const
 
const void * asBlob () const
 
std::string asString () const
 

Private Types

using BlobPtr = std::unique_ptr< const uint8_t[]>
 

Private Member Functions

bool blob () const
 
bool valid () const
 
RegVal getRegVal () const
 
const void * getBlob () const
 
void set (const void *val)
 
void set (RegVal val)
 
void set (const InstResult &other)
 

Private Attributes

std::variant< BlobPtr, RegValvalue
 
const RegClass_regClass = nullptr
 

Detailed Description

Definition at line 54 of file inst_res.hh.

Member Typedef Documentation

◆ BlobPtr

using gem5::InstResult::BlobPtr = std::unique_ptr<const uint8_t[]>
private

Definition at line 57 of file inst_res.hh.

Constructor & Destructor Documentation

◆ InstResult() [1/4]

gem5::InstResult::InstResult ( )
inline

Default constructor creates an invalid result.

Definition at line 92 of file inst_res.hh.

◆ InstResult() [2/4]

gem5::InstResult::InstResult ( const InstResult other)
inline

Definition at line 93 of file inst_res.hh.

References set().

◆ InstResult() [3/4]

gem5::InstResult::InstResult ( const RegClass reg_class,
RegVal  val 
)
inline

Definition at line 98 of file inst_res.hh.

References set(), and gem5::X86ISA::val.

◆ InstResult() [4/4]

gem5::InstResult::InstResult ( const RegClass reg_class,
const void *  val 
)
inline

Definition at line 104 of file inst_res.hh.

References set(), and gem5::X86ISA::val.

Member Function Documentation

◆ asBlob()

const void* gem5::InstResult::asBlob ( ) const
inline

Definition at line 163 of file inst_res.hh.

References blob(), and getBlob().

Referenced by gem5::Checker< DynInstPtr >::copyResult().

◆ asRegVal()

RegVal gem5::InstResult::asRegVal ( ) const
inline

Definition at line 156 of file inst_res.hh.

References blob(), and getRegVal().

Referenced by gem5::Checker< DynInstPtr >::copyResult().

◆ asString()

std::string gem5::InstResult::asString ( ) const
inline

◆ blob()

bool gem5::InstResult::blob ( ) const
inlineprivate

Definition at line 62 of file inst_res.hh.

References value.

Referenced by asBlob(), asRegVal(), asString(), isBlob(), operator==(), and set().

◆ getBlob()

const void* gem5::InstResult::getBlob ( ) const
inlineprivate

Definition at line 67 of file inst_res.hh.

References value.

Referenced by asBlob(), asString(), operator==(), and set().

◆ getRegVal()

RegVal gem5::InstResult::getRegVal ( ) const
inlineprivate

Definition at line 66 of file inst_res.hh.

References value.

Referenced by asRegVal(), asString(), operator==(), and set().

◆ isBlob()

bool gem5::InstResult::isBlob ( ) const
inline

Definition at line 153 of file inst_res.hh.

References blob().

Referenced by gem5::Checker< DynInstPtr >::copyResult().

◆ isValid()

bool gem5::InstResult::isValid ( ) const
inline

Definition at line 152 of file inst_res.hh.

References valid().

◆ operator!=()

bool gem5::InstResult::operator!= ( const InstResult that) const
inline

Definition at line 146 of file inst_res.hh.

References operator==().

◆ operator=()

InstResult& gem5::InstResult::operator= ( const InstResult that)
inline

Definition at line 111 of file inst_res.hh.

References _regClass, and set().

◆ operator==()

bool gem5::InstResult::operator== ( const InstResult that) const
inline

Result comparison Two invalid results always differ.

Definition at line 124 of file inst_res.hh.

References _regClass, blob(), getBlob(), getRegVal(), and gem5::RegClass::regBytes().

Referenced by operator!=().

◆ regClass()

const RegClass& gem5::InstResult::regClass ( ) const
inline

Definition at line 151 of file inst_res.hh.

References _regClass.

◆ set() [1/3]

void gem5::InstResult::set ( const InstResult other)
inlineprivate

Definition at line 85 of file inst_res.hh.

References blob(), getBlob(), getRegVal(), and set().

◆ set() [2/3]

void gem5::InstResult::set ( const void *  val)
inlineprivate

Definition at line 71 of file inst_res.hh.

References _regClass, gem5::RegClass::regBytes(), gem5::X86ISA::val, and value.

Referenced by InstResult(), operator=(), and set().

◆ set() [3/3]

void gem5::InstResult::set ( RegVal  val)
inlineprivate

Definition at line 82 of file inst_res.hh.

References gem5::X86ISA::val, and value.

◆ valid()

bool gem5::InstResult::valid ( ) const
inlineprivate

Definition at line 63 of file inst_res.hh.

References _regClass.

Referenced by isValid().

Member Data Documentation

◆ _regClass

const RegClass* gem5::InstResult::_regClass = nullptr
private

Definition at line 60 of file inst_res.hh.

Referenced by asString(), operator=(), operator==(), regClass(), set(), and valid().

◆ value

std::variant<BlobPtr, RegVal> gem5::InstResult::value
private

Definition at line 59 of file inst_res.hh.

Referenced by blob(), getBlob(), getRegVal(), and set().


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

Generated on Wed Dec 21 2022 10:23:13 for gem5 by doxygen 1.9.1