gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Attributes | Friends | List of all members
VecRegContainer< Sz > Class Template Reference

Vector Register Abstraction This generic class is the model in a particularization of MVC, to vector registers. More...

#include <vec_reg.hh>

Public Types

using Container = std::array< uint8_t, Sz >
 

Public Member Functions

 VecRegContainer ()
 
 VecRegContainer (const VecRegContainer &)=default
 
 VecRegContainer (const std::vector< uint8_t > &that)
 
void zero ()
 Zero the container. More...
 
template<size_t S2>
bool operator== (const VecRegContainer< S2 > &that) const
 Equality operator. More...
 
template<size_t S2>
bool operator!= (const VecRegContainer< S2 > &that) const
 Inequality operator. More...
 
const std::string print () const
 
template<typename Ret >
const Ret * raw_ptr () const
 Get pointer to bytes. More...
 
template<typename Ret >
Ret * raw_ptr ()
 
MyClassoperator= (const MyClass &that)
 Assignment operators. More...
 
MyClassoperator= (const Container &that)
 From appropriately sized uint8_t[]. More...
 
MyClassoperator= (const std::vector< uint8_t > &that)
 From vector<uint8_t>. More...
 
void copyTo (Container &dst) const
 Copy the contents into the input buffer. More...
 
void copyTo (std::vector< uint8_t > &dst) const
 To vector<uint8_t> This is required for serialisation. More...
 
template<typename VecElem , size_t NumElems = SIZE/sizeof(VecElem)>
VecRegT< VecElem, NumElems, true > as () const
 View interposers. More...
 
template<typename VecElem , size_t NumElems = SIZE/sizeof(VecElem)>
VecRegT< VecElem, NumElems, false > as ()
 
template<typename VecElem , int LaneIdx>
VecLaneT< VecElem, false > laneView ()
 View as the Nth lane of type VecElem. More...
 
template<typename VecElem , int LaneIdx>
VecLaneT< VecElem, true > laneView () const
 View as the const Nth lane of type VecElem. More...
 
template<typename VecElem >
VecLaneT< VecElem, false > laneView (int laneIdx)
 View as the Nth lane of type VecElem. More...
 
template<typename VecElem >
VecLaneT< VecElem, true > laneView (int laneIdx) const
 View as the const Nth lane of type VecElem. More...
 

Static Public Attributes

static constexpr size_t SIZE = Sz
 

Private Types

using MyClass = VecRegContainer< SIZE >
 

Private Attributes

Container container
 

Friends

std::ostream & operator<< (std::ostream &os, const MyClass &v)
 Output operator. More...
 

Detailed Description

template<size_t Sz>
class VecRegContainer< Sz >

Vector Register Abstraction This generic class is the model in a particularization of MVC, to vector registers.

The model has functionality to create views of itself, or a portion through the method 'as

Template Parameters
SzSize of the container in bytes.

Definition at line 160 of file vec_reg.hh.

Member Typedef Documentation

◆ Container

template<size_t Sz>
using VecRegContainer< Sz >::Container = std::array<uint8_t,Sz>

Definition at line 280 of file vec_reg.hh.

◆ MyClass

template<size_t Sz>
using VecRegContainer< Sz >::MyClass = VecRegContainer<SIZE>
private

Definition at line 283 of file vec_reg.hh.

Constructor & Destructor Documentation

◆ VecRegContainer() [1/3]

template<size_t Sz>
VecRegContainer< Sz >::VecRegContainer ( )
inline

Definition at line 286 of file vec_reg.hh.

◆ VecRegContainer() [2/3]

template<size_t Sz>
VecRegContainer< Sz >::VecRegContainer ( const VecRegContainer< Sz > &  )
default

◆ VecRegContainer() [3/3]

template<size_t Sz>
VecRegContainer< Sz >::VecRegContainer ( const std::vector< uint8_t > &  that)
inline

Definition at line 289 of file vec_reg.hh.

Member Function Documentation

◆ as() [1/2]

template<size_t Sz>
template<typename VecElem , size_t NumElems = SIZE/sizeof(VecElem)>
VecRegT<VecElem, NumElems, true> VecRegContainer< Sz >::as ( ) const
inline

View interposers.

Create a view of this container as a vector of VecElems with an optional amount of elements. If the amount of elements is provided, the size of the container is checked, to test bounds. If it is not provided, the length is inferred from the container size and the element size.

Template Parameters
VecElemType of each element of the vector for the view.
NumElemAmount of elements in the view.

Definition at line 385 of file vec_reg.hh.

Referenced by Trace::ArmNativeTrace::ThreadState::update(), ArmV8KvmCPU::updateKvmState(), ArmV8KvmCPU::updateThreadContext(), Trace::TarmacTracerRecordV8::TraceRegEntryV8::updateVec(), and ArmISA::ISA::zeroSveVecRegUpperPart().

◆ as() [2/2]

template<size_t Sz>
template<typename VecElem , size_t NumElems = SIZE/sizeof(VecElem)>
VecRegT<VecElem, NumElems, false> VecRegContainer< Sz >::as ( )
inline

Definition at line 395 of file vec_reg.hh.

◆ copyTo() [1/2]

template<size_t Sz>
void VecRegContainer< Sz >::copyTo ( Container dst) const
inline

Copy the contents into the input buffer.

To appropriately sized uint8_t[]

Definition at line 330 of file vec_reg.hh.

◆ copyTo() [2/2]

template<size_t Sz>
void VecRegContainer< Sz >::copyTo ( std::vector< uint8_t > &  dst) const
inline

To vector<uint8_t> This is required for serialisation.

Definition at line 338 of file vec_reg.hh.

◆ laneView() [1/4]

template<size_t Sz>
template<typename VecElem , int LaneIdx>
VecLaneT< VecElem, false > VecRegContainer< Sz >::laneView ( )

View as the Nth lane of type VecElem.

Definition at line 595 of file vec_reg.hh.

Referenced by PhysRegFile::readVecLane().

◆ laneView() [2/4]

template<size_t Sz>
template<typename VecElem , int LaneIdx>
VecLaneT< VecElem, true > VecRegContainer< Sz >::laneView ( ) const

View as the const Nth lane of type VecElem.

Definition at line 604 of file vec_reg.hh.

◆ laneView() [3/4]

template<size_t Sz>
template<typename VecElem >
VecLaneT< VecElem, false > VecRegContainer< Sz >::laneView ( int  laneIdx)

View as the Nth lane of type VecElem.

Definition at line 613 of file vec_reg.hh.

◆ laneView() [4/4]

template<size_t Sz>
template<typename VecElem >
VecLaneT< VecElem, true > VecRegContainer< Sz >::laneView ( int  laneIdx) const

View as the const Nth lane of type VecElem.

Definition at line 622 of file vec_reg.hh.

◆ operator!=()

template<size_t Sz>
template<size_t S2>
bool VecRegContainer< Sz >::operator!= ( const VecRegContainer< S2 > &  that) const
inline

Inequality operator.

Required to compare thread contexts.

Definition at line 360 of file vec_reg.hh.

◆ operator=() [1/3]

template<size_t Sz>
MyClass& VecRegContainer< Sz >::operator= ( const MyClass that)
inline

Assignment operators.

From VecRegContainer

Definition at line 301 of file vec_reg.hh.

◆ operator=() [2/3]

template<size_t Sz>
MyClass& VecRegContainer< Sz >::operator= ( const Container that)
inline

From appropriately sized uint8_t[].

Definition at line 310 of file vec_reg.hh.

◆ operator=() [3/3]

template<size_t Sz>
MyClass& VecRegContainer< Sz >::operator= ( const std::vector< uint8_t > &  that)
inline

From vector<uint8_t>.

This is required for de-serialisation.

Definition at line 319 of file vec_reg.hh.

◆ operator==()

template<size_t Sz>
template<size_t S2>
bool VecRegContainer< Sz >::operator== ( const VecRegContainer< S2 > &  that) const
inline

Equality operator.

Required to compare thread contexts.

Definition at line 350 of file vec_reg.hh.

◆ print()

template<size_t Sz>
const std::string VecRegContainer< Sz >::print ( ) const
inline

◆ raw_ptr() [1/2]

template<size_t Sz>
template<typename Ret >
const Ret* VecRegContainer< Sz >::raw_ptr ( ) const
inline

Get pointer to bytes.

Definition at line 368 of file vec_reg.hh.

◆ raw_ptr() [2/2]

template<size_t Sz>
template<typename Ret >
Ret* VecRegContainer< Sz >::raw_ptr ( )
inline

Definition at line 371 of file vec_reg.hh.

◆ zero()

template<size_t Sz>
void VecRegContainer< Sz >::zero ( )
inline

Zero the container.

Definition at line 296 of file vec_reg.hh.

Friends And Related Function Documentation

◆ operator<<

template<size_t Sz>
std::ostream& operator<< ( std::ostream &  os,
const MyClass v 
)
friend

Output operator.

Used for serialization.

Definition at line 417 of file vec_reg.hh.

Member Data Documentation

◆ container

template<size_t Sz>
Container VecRegContainer< Sz >::container
private

◆ SIZE

template<size_t Sz>
constexpr size_t VecRegContainer< Sz >::SIZE = Sz
static

Definition at line 279 of file vec_reg.hh.


The documentation for this class was generated from the following file:

Generated on Fri Feb 28 2020 16:27:18 for gem5 by doxygen 1.8.13