gem5  v20.1.0.0
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | Friends | List of all members
VecRegContainer< SIZE > 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, SIZE >
 

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 Member Functions

static constexpr size_t size ()
 

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 SIZE>
class VecRegContainer< SIZE >

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 156 of file vec_reg.hh.

Member Typedef Documentation

◆ Container

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

Definition at line 280 of file vec_reg.hh.

◆ MyClass

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

Definition at line 284 of file vec_reg.hh.

Constructor & Destructor Documentation

◆ VecRegContainer() [1/3]

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

Definition at line 287 of file vec_reg.hh.

◆ VecRegContainer() [2/3]

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

◆ VecRegContainer() [3/3]

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

Definition at line 290 of file vec_reg.hh.

Member Function Documentation

◆ as() [1/2]

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

Definition at line 396 of file vec_reg.hh.

◆ as() [2/2]

template<size_t SIZE>
template<typename VecElem , size_t NumElems = (SIZE / sizeof(VecElem))>
VecRegT<VecElem, NumElems, true> VecRegContainer< SIZE >::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 386 of file vec_reg.hh.

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

◆ copyTo() [1/2]

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

Copy the contents into the input buffer.

To appropriately sized uint8_t[]

Definition at line 331 of file vec_reg.hh.

◆ copyTo() [2/2]

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

To vector<uint8_t> This is required for serialisation.

Definition at line 339 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 596 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

View as the const Nth lane of type VecElem.

Definition at line 605 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 614 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 623 of file vec_reg.hh.

◆ operator!=()

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

Inequality operator.

Required to compare thread contexts.

Definition at line 361 of file vec_reg.hh.

◆ operator=() [1/3]

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

From appropriately sized uint8_t[].

Definition at line 311 of file vec_reg.hh.

◆ operator=() [2/3]

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

Assignment operators.

From VecRegContainer

Definition at line 302 of file vec_reg.hh.

◆ operator=() [3/3]

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

From vector<uint8_t>.

This is required for de-serialisation.

Definition at line 320 of file vec_reg.hh.

◆ operator==()

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

Equality operator.

Required to compare thread contexts.

Definition at line 351 of file vec_reg.hh.

Referenced by VecRegContainer< TheISA::VecRegSizeBytes >::operator!=().

◆ print()

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

Definition at line 366 of file vec_reg.hh.

Referenced by SimpleThread::getWritableVecReg(), and SimpleThread::readVecReg().

◆ raw_ptr() [1/2]

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

Definition at line 372 of file vec_reg.hh.

◆ raw_ptr() [2/2]

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

Get pointer to bytes.

Definition at line 369 of file vec_reg.hh.

◆ size()

template<size_t SIZE>
static constexpr size_t VecRegContainer< SIZE >::size ( )
inlinestaticconstexpr

Definition at line 279 of file vec_reg.hh.

◆ zero()

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

Zero the container.

Definition at line 297 of file vec_reg.hh.

Friends And Related Function Documentation

◆ operator<<

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

Output operator.

Used for serialization.

Definition at line 418 of file vec_reg.hh.

Member Data Documentation

◆ container

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

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

Generated on Wed Sep 30 2020 14:02:34 for gem5 by doxygen 1.8.17