gem5
v20.1.0.0
|
Predicate register view. More...
#include <vec_pred_reg.hh>
Public Types | |
using | Container = typename std::conditional< Const, const VecPredRegContainer< NUM_BITS, Packed >, VecPredRegContainer< NUM_BITS, Packed > >::type |
Container type alias. More... | |
Public Member Functions | |
VecPredRegT (Container &c) | |
template<bool Condition = !Const> | |
std::enable_if< Condition, void >::type | reset () |
Reset the register to an all-false value. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, void >::type | set () |
Reset the register to an all-true value. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, MyClass & >::type | operator= (const MyClass &that) |
const bool & | operator[] (size_t idx) const |
template<bool Condition = !Const> | |
std::enable_if< Condition, bool & >::type | operator[] (size_t idx) |
uint8_t | get_raw (size_t idx) const |
Return an element of the predicate register as it appears in the raw (untyped) internal representation. More... | |
template<bool Condition = !Const> | |
std::enable_if< Condition, void >::type | set_raw (size_t idx, uint8_t val) |
Write a raw value in an element of the predicate register. More... | |
template<typename VE2 , size_t NE2, bool P2, bool C2> | |
bool | operator== (const VecPredRegT< VE2, NE2, P2, C2 > &that) const |
Equality operator, required to compare thread contexts. More... | |
template<typename VE2 , size_t NE2, bool P2, bool C2> | |
bool | operator!= (const VecPredRegT< VE2, NE2, P2, C2 > &that) const |
Inequality operator, required to compare thread contexts. More... | |
const std::string | print () const |
Returns a string representation of the register content. More... | |
template<bool MC> | |
bool | firstActive (const VecPredRegT< VecElem, NumElems, Packed, MC > &mask, size_t actual_num_elems) const |
Returns true if the first active element of the register is true. More... | |
template<bool MC> | |
bool | noneActive (const VecPredRegT< VecElem, NumElems, Packed, MC > &mask, size_t actual_num_elems) const |
Returns true if there are no active elements in the register. More... | |
template<bool MC> | |
bool | lastActive (const VecPredRegT< VecElem, NumElems, Packed, MC > &mask, size_t actual_num_elems) const |
Returns true if the last active element of the register is true. More... | |
Protected Types | |
using | MyClass = VecPredRegT< VecElem, NumElems, Packed, Const > |
Protected Attributes | |
Container & | container |
Container corresponding to this view. More... | |
Static Protected Attributes | |
static constexpr size_t | NUM_BITS |
Size of the register in bits. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const MyClass &p) |
Predicate register view.
This generic class implements the View in an MVC pattern, similarly to
VecElem | Type of the vector elements. |
NumElems | Number of vector elements making up the view. |
Packed | True if the predicate register relies on a packed representation, i.e. adjacent bits refer to different vector elements irrespective of the vector element size (e.g. this is the case for AVX-512). If false, the predicate register relies on an unpacked representation, where each bit refers to the corresponding byte in a vector register (e.g. this is the case for ARM SVE). |
Const | True if the underlying container can be modified through the view. |
Definition at line 66 of file vec_pred_reg.hh.
using VecPredRegT< VecElem, NumElems, Packed, Const >::Container = typename std::conditional< Const, const VecPredRegContainer<NUM_BITS, Packed>, VecPredRegContainer<NUM_BITS, Packed> >::type |
Container type alias.
Definition at line 78 of file vec_pred_reg.hh.
|
protected |
Definition at line 82 of file vec_pred_reg.hh.
|
inline |
Definition at line 87 of file vec_pred_reg.hh.
|
inline |
Returns true if the first active element of the register is true.
mask | Input mask used to filter the predicates to be tested. |
actual_num_elems | Actual number of vector elements considered for the test (corresponding to the current vector length). |
Definition at line 175 of file vec_pred_reg.hh.
References ArmISA::i, and ArmISA::mask.
|
inline |
Return an element of the predicate register as it appears in the raw (untyped) internal representation.
Definition at line 123 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
|
inline |
Returns true if the last active element of the register is true.
mask | Input mask used to filter the predicates to be tested. |
actual_num_elems | Actual number of vector elements considered for the test (corresponding to the current vector length). |
Definition at line 211 of file vec_pred_reg.hh.
References ArmISA::i, ArmISA::mask, and VecPredRegT< VecElem, NumElems, Packed, Const >::operator[]().
|
inline |
Returns true if there are no active elements in the register.
mask | Input mask used to filter the predicates to be tested. |
actual_num_elems | Actual number of vector elements considered for the test (corresponding to the current vector length). |
Definition at line 193 of file vec_pred_reg.hh.
References ArmISA::i, and ArmISA::mask.
|
inline |
Inequality operator, required to compare thread contexts.
Definition at line 149 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::operator==().
|
inline |
Definition at line 101 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
|
inline |
Equality operator, required to compare thread contexts.
Definition at line 141 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
Referenced by VecPredRegT< VecElem, NumElems, Packed, Const >::operator!=().
|
inline |
Definition at line 115 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
|
inline |
Definition at line 108 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
Referenced by VecPredRegT< VecElem, NumElems, Packed, Const >::lastActive().
|
inline |
Returns a string representation of the register content.
Definition at line 167 of file vec_pred_reg.hh.
References csprintf().
|
inline |
Reset the register to an all-false value.
Definition at line 92 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
|
inline |
Reset the register to an all-true value.
Definition at line 97 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container.
|
inline |
Write a raw value in an element of the predicate register.
Definition at line 132 of file vec_pred_reg.hh.
References VecPredRegT< VecElem, NumElems, Packed, Const >::container, and X86ISA::val.
|
friend |
Definition at line 155 of file vec_pred_reg.hh.
|
protected |
Container corresponding to this view.
Definition at line 84 of file vec_pred_reg.hh.
Referenced by VecPredRegT< VecElem, NumElems, Packed, Const >::get_raw(), VecPredRegT< VecElem, NumElems, Packed, Const >::operator=(), VecPredRegT< VecElem, NumElems, Packed, Const >::operator==(), VecPredRegT< VecElem, NumElems, Packed, Const >::operator[](), VecPredRegT< VecElem, NumElems, Packed, Const >::reset(), VecPredRegT< VecElem, NumElems, Packed, Const >::set(), and VecPredRegT< VecElem, NumElems, Packed, Const >::set_raw().
|
staticconstexprprotected |
Size of the register in bits.
Definition at line 70 of file vec_pred_reg.hh.