gem5
v20.1.0.0
|
Vector Register Abstraction This generic class is a view in a particularization of MVC, to vector registers. More...
#include <vec_reg.hh>
Public Types | |
using | Container = typename std::conditional< Const, const VecRegContainer< size()>, VecRegContainer< size()> >::type |
Container type alias. More... | |
Public Member Functions | |
VecRegT (Container &cnt) | |
Constructor. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, void >::type | zero () |
Zero the container. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, MyClass & >::type | operator= (const MyClass &that) |
const VecElem & | operator[] (size_t idx) const |
Index operator. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, VecElem & >::type | operator[] (size_t idx) |
Index operator. More... | |
template<typename VE2 , size_t NE2, bool C2> | |
bool | operator== (const VecRegT< VE2, NE2, C2 > &that) const |
Equality operator. More... | |
template<typename VE2 , size_t NE2, bool C2> | |
bool | operator!= (const VecRegT< VE2, NE2, C2 > &that) const |
Inequality operator. More... | |
const std::string | print () const |
operator Container & () | |
Cast to VecRegContainer& It is useful to get the reference to the container for ISA tricks, because casting to reference prevents unnecessary copies. More... | |
Private Types | |
using | MyClass = VecRegT< VecElem, NumElems, Const > |
My type alias. More... | |
Static Private Member Functions | |
static constexpr size_t | size () |
Size of the register in bytes. More... | |
Private Attributes | |
Container & | container |
Reference to container. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const MyClass &vr) |
Output stream operator. More... | |
Vector Register Abstraction This generic class is a view in a particularization of MVC, to vector registers.
There is a VecRegContainer that implements the model, and contains the data. To that model we can interpose different instantiations of VecRegT to view the container as a vector of NumElems elems of type VecElem.
VecElem | Type of each element of the vector. |
NumElems | Amount of components of the vector. |
Const | Indicate if the underlying container can be modified through the view. |
Definition at line 170 of file vec_reg.hh.
using VecRegT< VecElem, NumElems, Const >::Container = typename std::conditional<Const, const VecRegContainer<size()>, VecRegContainer<size()> >::type |
Container type alias.
Definition at line 182 of file vec_reg.hh.
|
private |
My type alias.
Definition at line 185 of file vec_reg.hh.
|
inline |
Constructor.
Definition at line 191 of file vec_reg.hh.
|
inline |
Cast to VecRegContainer& It is useful to get the reference to the container for ISA tricks, because casting to reference prevents unnecessary copies.
Definition at line 257 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
|
inline |
Inequality operator.
Required to compare thread contexts.
Definition at line 234 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::operator==().
|
inline |
Definition at line 200 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
|
inline |
Equality operator.
Required to compare thread contexts.
Definition at line 225 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
Referenced by VecRegT< VecElem, NumElems, Const >::operator!=().
|
inline |
Index operator.
Definition at line 215 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
|
inline |
Index operator.
Definition at line 207 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
|
inline |
Definition at line 251 of file vec_reg.hh.
References csprintf().
|
inlinestaticconstexprprivate |
Size of the register in bytes.
Definition at line 174 of file vec_reg.hh.
|
inline |
Zero the container.
Definition at line 196 of file vec_reg.hh.
References VecRegT< VecElem, NumElems, Const >::container.
|
friend |
Output stream operator.
Definition at line 241 of file vec_reg.hh.
|
private |
Reference to container.
Definition at line 187 of file vec_reg.hh.
Referenced by VecRegT< VecElem, NumElems, Const >::operator Container &(), VecRegT< VecElem, NumElems, Const >::operator=(), VecRegT< VecElem, NumElems, Const >::operator==(), VecRegT< VecElem, NumElems, Const >::operator[](), and VecRegT< VecElem, NumElems, Const >::zero().