gem5  v20.1.0.0
Public Types | Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
LaneData< LS > Class Template Reference

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)
 

Detailed Description

template<LaneSize LS>
class LaneData< LS >

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.

Member Typedef Documentation

◆ MyClass

template<LaneSize LS>
using LaneData< LS >::MyClass = LaneData<LS>
private

Definition at line 474 of file vec_reg.hh.

◆ UnderlyingType

template<LaneSize LS>
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.

Constructor & Destructor Documentation

◆ LaneData()

template<LaneSize LS>
template<typename T >
LaneData< LS >::LaneData ( typename std::enable_if< sizeof(T)==ByteSz, const T & >::type  t)
inlineexplicit

Definition at line 478 of file vec_reg.hh.

Member Function Documentation

◆ operator T()

template<LaneSize LS>
template<typename T , typename std::enable_if< sizeof(T)==ByteSz, int >::type I = 0>
LaneData< LS >::operator T ( ) const
inline

Definition at line 490 of file vec_reg.hh.

References LaneData< LS >::_val.

◆ operator=()

template<LaneSize LS>
template<typename T >
std::enable_if<sizeof(T) == ByteSz, MyClass&>::type LaneData< LS >::operator= ( const T &  that)
inline

Definition at line 483 of file vec_reg.hh.

References LaneData< LS >::_val.

Member Data Documentation

◆ _val

template<LaneSize LS>
UnderlyingType LaneData< LS >::_val
private

Definition at line 473 of file vec_reg.hh.

Referenced by LaneData< LS >::operator T(), and LaneData< LS >::operator=().

◆ ByteSz

template<LaneSize LS>
constexpr auto LaneData< LS >::ByteSz = sizeof(UnderlyingType)
staticconstexprprivate

Definition at line 472 of file vec_reg.hh.


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