gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
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 VecRegContainer &v, const ResultType &t)
 Vector result. More...
 
 InstResult (const 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 VecRegContainerasVector () const
 
const VecElemasVectorElem () const
 
const VecPredRegContainerasPred () const
 

Private Types

using VecRegContainer = TheISA::VecRegContainer
 
using VecElem = TheISA::VecElem
 
using VecPredRegContainer = TheISA::VecPredRegContainer
 

Private Attributes

MultiResult result
 
ResultType type
 

Detailed Description

Definition at line 46 of file inst_res.hh.

Member Typedef Documentation

◆ VecElem

using InstResult::VecElem = TheISA::VecElem
private

Definition at line 48 of file inst_res.hh.

◆ VecPredRegContainer

using InstResult::VecPredRegContainer = TheISA::VecPredRegContainer
private

Definition at line 49 of file inst_res.hh.

◆ VecRegContainer

using InstResult::VecRegContainer = TheISA::VecRegContainer
private

Definition at line 47 of file inst_res.hh.

Member Enumeration Documentation

◆ ResultType

Enumerator
Scalar 
VecElem 
VecReg 
VecPredReg 
NumResultTypes 
Invalid 

Definition at line 60 of file inst_res.hh.

Constructor & Destructor Documentation

◆ InstResult() [1/5]

InstResult::InstResult ( )
inline

Default constructor creates an invalid result.

Definition at line 75 of file inst_res.hh.

◆ InstResult() [2/5]

InstResult::InstResult ( const InstResult )
default

◆ InstResult() [3/5]

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

Scalar result from scalar.

Definition at line 79 of file inst_res.hh.

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

◆ InstResult() [4/5]

InstResult::InstResult ( const VecRegContainer v,
const ResultType t 
)
inlineexplicit

Vector result.

Definition at line 90 of file inst_res.hh.

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

◆ InstResult() [5/5]

InstResult::InstResult ( const VecPredRegContainer v,
const ResultType t 
)
inlineexplicit

Predicate result.

Definition at line 93 of file inst_res.hh.

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

Member Function Documentation

◆ asInteger()

const uint64_t& InstResult::asInteger ( ) const
inline

Explicit cast-like operations.

Definition at line 166 of file inst_res.hh.

References InstResult::MultiResult::integer, isScalar(), and result.

Referenced by Checker< O3CPUImpl >::copyResult(), and Checker< O3CPUImpl >::validateExecution().

◆ asIntegerNoAssert()

const uint64_t& 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 177 of file inst_res.hh.

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

Referenced by Checker< O3CPUImpl >::validateExecution().

◆ asPred()

const VecPredRegContainer& InstResult::asPred ( ) const
inline

Definition at line 195 of file inst_res.hh.

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

◆ asVector()

const VecRegContainer& InstResult::asVector ( ) const
inline

Definition at line 182 of file inst_res.hh.

References isVector(), panic_if, result, and InstResult::MultiResult::vector.

Referenced by Checker< O3CPUImpl >::copyResult().

◆ asVectorElem()

const VecElem& InstResult::asVectorElem ( ) const
inline

Definition at line 188 of file inst_res.hh.

References isVecElem(), panic_if, result, and InstResult::MultiResult::vecElem.

Referenced by Checker< O3CPUImpl >::copyResult().

◆ isPred()

bool InstResult::isPred ( ) const
inline

Is this a predicate result?.

Definition at line 158 of file inst_res.hh.

References type, and VecPredReg.

Referenced by asPred().

◆ isScalar()

bool InstResult::isScalar ( ) const
inline

Checks.

Is this a scalar result?.

Definition at line 152 of file inst_res.hh.

References Scalar, and type.

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

◆ isValid()

bool InstResult::isValid ( ) const
inline

Is this a valid result?.

Definition at line 160 of file inst_res.hh.

References Invalid, and type.

Referenced by Checker< O3CPUImpl >::copyResult().

◆ isVecElem()

bool InstResult::isVecElem ( ) const
inline

Is this a vector element result?.

Definition at line 156 of file inst_res.hh.

References type, and VecElem.

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

◆ isVector()

bool InstResult::isVector ( ) const
inline

Is this a vector result?.

Definition at line 154 of file inst_res.hh.

References type, and VecReg.

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

◆ operator!=()

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

Definition at line 145 of file inst_res.hh.

References operator==().

◆ operator=()

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

◆ operator==()

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

Result comparison Two invalid results always differ.

Definition at line 126 of file inst_res.hh.

References InstResult::MultiResult::integer, Invalid, panic, InstResult::MultiResult::pred, result, Scalar, type, InstResult::MultiResult::vecElem, VecElem, VecPredReg, VecReg, and InstResult::MultiResult::vector.

Referenced by operator!=().

Member Data Documentation

◆ result

MultiResult InstResult::result
private

◆ type

ResultType InstResult::type
private

Definition at line 71 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 Wed Sep 30 2020 14:02:26 for gem5 by doxygen 1.8.17