gem5  v21.1.0.2
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
gem5::InstResult Class Reference

#include <inst_res.hh>

Classes

union  MultiResult
 

Public Types

enum  ResultType {
  ResultType::Scalar, ResultType::VecElem, ResultType::VecReg, ResultType::VecPredReg,
  ResultType::NumResultTypes, ResultType::Invalid
}
 

Public Member Functions

 InstResult ()
 Default constructor creates an invalid result. More...
 
 InstResult (const InstResult &)=default
 
template<typename T >
 InstResult (T i, const ResultType &t)
 Scalar result from scalar. More...
 
 InstResult (const TheISA::VecRegContainer &v, const ResultType &t)
 Vector result. More...
 
 InstResult (const TheISA::VecPredRegContainer &v, const ResultType &t)
 Predicate result. More...
 
InstResultoperator= (const InstResult &that)
 
bool operator== (const InstResult &that) const
 Result comparison Two invalid results always differ. More...
 
bool operator!= (const InstResult &that) const
 
bool isScalar () const
 Checks. More...
 
bool isVector () const
 Is this a vector result?. More...
 
bool isVecElem () const
 Is this a vector element result?. More...
 
bool isPred () const
 Is this a predicate result?. More...
 
bool isValid () const
 Is this a valid result?. More...
 
const uint64_t & asInteger () const
 Explicit cast-like operations. More...
 
const uint64_t & asIntegerNoAssert () const
 Cast to integer without checking type. More...
 
const TheISA::VecRegContainer & asVector () const
 
const TheISA::VecElem & asVectorElem () const
 
const TheISA::VecPredRegContainer & asPred () const
 

Private Attributes

MultiResult result
 
ResultType type
 

Detailed Description

Definition at line 49 of file inst_res.hh.

Member Enumeration Documentation

◆ ResultType

Enumerator
Scalar 
VecElem 
VecReg 
VecPredReg 
NumResultTypes 
Invalid 

Definition at line 62 of file inst_res.hh.

Constructor & Destructor Documentation

◆ InstResult() [1/5]

gem5::InstResult::InstResult ( )
inline

Default constructor creates an invalid result.

Definition at line 78 of file inst_res.hh.

References gem5::MipsISA::Invalid.

◆ InstResult() [2/5]

gem5::InstResult::InstResult ( const InstResult )
default

◆ InstResult() [3/5]

template<typename T >
gem5::InstResult::InstResult ( i,
const ResultType t 
)
inlineexplicit

Scalar result from scalar.

Definition at line 82 of file inst_res.hh.

References gem5::InstResult::MultiResult::dbl, gem5::ArmISA::i, gem5::InstResult::MultiResult::integer, and result.

◆ InstResult() [4/5]

gem5::InstResult::InstResult ( const TheISA::VecRegContainer &  v,
const ResultType t 
)
inlineexplicit

Vector result.

Definition at line 93 of file inst_res.hh.

References result, gem5::ArmISA::v, and gem5::InstResult::MultiResult::vector.

◆ InstResult() [5/5]

gem5::InstResult::InstResult ( const TheISA::VecPredRegContainer &  v,
const ResultType t 
)
inlineexplicit

Predicate result.

Definition at line 96 of file inst_res.hh.

References gem5::InstResult::MultiResult::pred, result, and gem5::ArmISA::v.

Member Function Documentation

◆ asInteger()

const uint64_t& gem5::InstResult::asInteger ( ) const
inline

◆ asIntegerNoAssert()

const uint64_t& gem5::InstResult::asIntegerNoAssert ( ) const
inline

Cast to integer without checking type.

This is required to have the o3 cpu checker happy, as it compares results as integers without being fully aware of their nature.

Definition at line 181 of file inst_res.hh.

References gem5::InstResult::MultiResult::integer, and result.

Referenced by gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ asPred()

const TheISA::VecPredRegContainer& gem5::InstResult::asPred ( ) const
inline

Definition at line 199 of file inst_res.hh.

References isPred(), panic_if, gem5::InstResult::MultiResult::pred, and result.

◆ asVector()

const TheISA::VecRegContainer& gem5::InstResult::asVector ( ) const
inline

◆ asVectorElem()

const TheISA::VecElem& gem5::InstResult::asVectorElem ( ) const
inline

◆ isPred()

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

Is this a predicate result?.

Definition at line 162 of file inst_res.hh.

References type, and VecPredReg.

Referenced by asPred().

◆ isScalar()

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

Checks.

Is this a scalar result?.

Definition at line 156 of file inst_res.hh.

References Scalar, and type.

Referenced by asInteger(), gem5::Checker< gem5::RefCountingPtr >::copyResult(), and gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ isValid()

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

Is this a valid result?.

Definition at line 164 of file inst_res.hh.

References Invalid, and type.

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

◆ isVecElem()

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

Is this a vector element result?.

Definition at line 160 of file inst_res.hh.

References type, and VecElem.

Referenced by asVectorElem(), and gem5::Checker< gem5::RefCountingPtr >::copyResult().

◆ isVector()

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

Is this a vector result?.

Definition at line 158 of file inst_res.hh.

References type, and VecReg.

Referenced by asVector(), gem5::Checker< gem5::RefCountingPtr >::copyResult(), and gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ operator!=()

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

Definition at line 149 of file inst_res.hh.

References operator==().

◆ operator=()

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

◆ operator==()

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

Member Data Documentation

◆ result

MultiResult gem5::InstResult::result
private

◆ type

ResultType gem5::InstResult::type
private

Definition at line 74 of file inst_res.hh.

Referenced by isPred(), isScalar(), isValid(), isVecElem(), isVector(), operator=(), and operator==().


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

Generated on Tue Sep 21 2021 12:27:43 for gem5 by doxygen 1.8.17