gem5
v20.1.0.0
|
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values just depending on its width. More...
#include <vec_reg.hh>
Public Types | |
using | UnderlyingType = typename std::conditional< LS==LaneSize::EightByte, uint64_t, typename std::conditional< LS==LaneSize::FourByte, uint32_t, typename std::conditional< LS==LaneSize::TwoByte, uint16_t, typename std::conditional< LS==LaneSize::Byte, uint8_t, void >::type >::type >::type >::type |
Alias to the native type of the appropriate size. More... | |
Public Member Functions | |
template<typename T > | |
LaneData (typename std::enable_if< sizeof(T)==ByteSz, const T & >::type t) | |
template<typename T > | |
std::enable_if< sizeof(T)==ByteSz, MyClass & >::type | operator= (const T &that) |
template<typename T , typename std::enable_if< sizeof(T)==ByteSz, int >::type I = 0> | |
operator T () const | |
Private Types | |
using | MyClass = LaneData< LS > |
Private Attributes | |
UnderlyingType | _val |
Static Private Attributes | |
static constexpr auto | ByteSz = sizeof(UnderlyingType) |
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values just depending on its width.
That way, the ISA can request, for example, the second 4 byte lane of register 5 to the model. The model serves that value, agnostic of the semantics of those bits. Then, it is up to the ISA to interpret those bits as a float, or as an uint. To maximize the utility, this class implements the assignment operator and the casting to equal-size types. As opposed to a RegLaneT, LaneData is not 'backed' by a VecRegContainer. The idea is: When data is passed and is susceptible to being copied, use LaneData, as copying the primitive type is build on is cheap. When data is passed as references (const or not), use RegLaneT, as all operations happen 'in place', avoiding any copies (no copies is always cheaper than cheap copies), especially when things are inlined, and references are not explicitly passed.
Definition at line 458 of file vec_reg.hh.
Definition at line 474 of file vec_reg.hh.
using LaneData< LS >::UnderlyingType = typename std::conditional<LS == LaneSize::EightByte, uint64_t, typename std::conditional<LS == LaneSize::FourByte, uint32_t, typename std::conditional<LS == LaneSize::TwoByte, uint16_t, typename std::conditional<LS == LaneSize::Byte, uint8_t, void>::type >::type >::type >::type |
Alias to the native type of the appropriate size.
Definition at line 470 of file vec_reg.hh.
|
inlineexplicit |
Definition at line 478 of file vec_reg.hh.
|
inline |
Definition at line 490 of file vec_reg.hh.
References LaneData< LS >::_val.
|
inline |
Definition at line 483 of file vec_reg.hh.
References LaneData< LS >::_val.
|
private |
Definition at line 473 of file vec_reg.hh.
Referenced by LaneData< LS >::operator T(), and LaneData< LS >::operator=().
|
staticconstexprprivate |
Definition at line 472 of file vec_reg.hh.