OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
TDGenerator::RegisterClass Class Reference

#include <TDGen.hh>

Collaboration diagram for TDGenerator::RegisterClass:
Collaboration graph

Public Member Functions

 RegisterClass (const ValueType &vt, const TCEString &name)
 
 RegisterClass (const RegisterClass &other)
 
RegisterClassoperator= (const RegisterClass &other)
 
TCEString name () const
 
ValueType valueType () const
 
int alignment () const
 
std::vector< RegisterInforegisters () const
 
RegisterInfo registerInfo (int index) const
 
size_t numberOfRegisters () const
 
void addRegisters (const std::vector< RegisterInfo > &registers)
 

Private Attributes

TCEString name_
 RegisterClass name. More...
 
ValueType vt_
 Value type that is supported by this RegisterClass, e.g. v4i32. More...
 
int alignment_
 RegisterClass alignment in bits, at least 8. More...
 
std::vector< RegisterInforegisters_
 Register file registers that this RegisterClass uses. More...
 

Detailed Description

Represents TableGen RegisterClass class.

Definition at line 721 of file TDGen.hh.

Constructor & Destructor Documentation

◆ RegisterClass() [1/2]

RegisterClass::RegisterClass ( const ValueType vt,
const TCEString name 
)

Constructor.

Parameters
vtValueType that is supported by the RegisterClass.
nameName of the RegisterClass.

Definition at line 8939 of file TDGen.cc.

8940  : name_(name), vt_(vt), registers_(std::vector<RegisterInfo>()) {
8941  if (vt.width() < 8) {
8942  alignment_ = 8;
8943  } else {
8944  alignment_ = vt.width();
8945  }
8946 }

References alignment_, and TDGenerator::ValueType::width().

Here is the call graph for this function:

◆ RegisterClass() [2/2]

RegisterClass::RegisterClass ( const RegisterClass other)

Copy constructor.

Parameters
otherRegisterClass to be copied.

Definition at line 8953 of file TDGen.cc.

8954  : name_(other.name_),
8955  vt_(other.vt_),
8956  alignment_(other.alignment_),
8957  registers_(other.registers_) {}

Member Function Documentation

◆ addRegisters()

void RegisterClass::addRegisters ( const std::vector< RegisterInfo > &  registers)

Sets the registers used by this RegisterClass.

Parameters
registersThe new registers used by this RegisterClass.

Definition at line 9033 of file TDGen.cc.

9033  {
9034  registers_.insert(registers_.end(), registers.begin(), registers.end());
9035 }

References registers(), and registers_.

Referenced by TDGen::associateRegistersWithVectorRegisterClasses().

Here is the call graph for this function:

◆ alignment()

int RegisterClass::alignment ( ) const

Returns the RegisterClass's alignment in bits.

Returns
Alignment of RegisterClass in bits.

Definition at line 9000 of file TDGen.cc.

9000  {
9001  return alignment_;
9002 }

References alignment_.

Referenced by TDGen::writeCallingConv(), and TDGen::writeVectorRegisterClasses().

◆ name()

TCEString RegisterClass::name ( ) const

◆ numberOfRegisters()

size_t RegisterClass::numberOfRegisters ( ) const

Returns how many registers is used by this RegisterClass.

Returns
A number of registers used by this RegisterClass.

Definition at line 9023 of file TDGen.cc.

9023  {
9024  return registers_.size();
9025 }

References registers_.

Referenced by TDGen::createVectorRVDRegNums(), TDGen::genTCERegisterInfo_setReservedVectorRegs(), TDGen::writeCallingConv(), and TDGen::writeVectorRegisterClasses().

◆ operator=()

RegisterClass & RegisterClass::operator= ( const RegisterClass other)

Value assignment.

Parameters
otherRegisterClass to be assigned.
Returns
Reference with the assigned values.

Definition at line 8966 of file TDGen.cc.

8966  {
8967  this->name_ = other.name_;
8968  this->vt_ = other.vt_;
8969  this->alignment_ = other.alignment_;
8970  this->registers_ = other.registers_;
8971  return *this;
8972 }

References alignment_, name_, registers_, and vt_.

◆ registerInfo()

RegisterInfo RegisterClass::registerInfo ( int  index) const

Returns RegisterInfo pointed by the index.

Returns
RegisterInfo pointed by the index.

Definition at line 9010 of file TDGen.cc.

9010  {
9011  assert(
9012  index >= static_cast<int>(0) &&
9013  index < static_cast<int>(registers_.size()));
9014  return registers_[index];
9015 }

References assert, and registers_.

Referenced by TDGen::createVectorRVDRegNums(), TDGen::genTCERegisterInfo_setReservedVectorRegs(), TDGen::writeCallingConv(), and TDGen::writeVectorRegisterClasses().

◆ registers()

std::vector<RegisterInfo> TDGenerator::RegisterClass::registers ( ) const

Referenced by addRegisters().

◆ valueType()

ValueType RegisterClass::valueType ( ) const

Member Data Documentation

◆ alignment_

int TDGenerator::RegisterClass::alignment_
private

RegisterClass alignment in bits, at least 8.

Definition at line 743 of file TDGen.hh.

Referenced by alignment(), operator=(), and RegisterClass().

◆ name_

TCEString TDGenerator::RegisterClass::name_
private

RegisterClass name.

Definition at line 739 of file TDGen.hh.

Referenced by name(), and operator=().

◆ registers_

std::vector<RegisterInfo> TDGenerator::RegisterClass::registers_
private

Register file registers that this RegisterClass uses.

Definition at line 745 of file TDGen.hh.

Referenced by addRegisters(), numberOfRegisters(), operator=(), and registerInfo().

◆ vt_

ValueType TDGenerator::RegisterClass::vt_
private

Value type that is supported by this RegisterClass, e.g. v4i32.

Definition at line 741 of file TDGen.hh.

Referenced by operator=(), and valueType().


The documentation for this class was generated from the following files:
TDGenerator::RegisterClass::registers
std::vector< RegisterInfo > registers() const
TDGenerator::RegisterClass::name
TCEString name() const
Definition: TDGen.cc:8980
TDGenerator::RegisterClass::alignment_
int alignment_
RegisterClass alignment in bits, at least 8.
Definition: TDGen.hh:743
assert
#define assert(condition)
Definition: Application.hh:86
TDGenerator::RegisterClass::registers_
std::vector< RegisterInfo > registers_
Register file registers that this RegisterClass uses.
Definition: TDGen.hh:745
TDGenerator::ValueType::width
int width() const
Definition: TDGen.cc:8702
TDGenerator::RegisterClass::vt_
ValueType vt_
Value type that is supported by this RegisterClass, e.g. v4i32.
Definition: TDGen.hh:741
TDGenerator::RegisterClass::name_
TCEString name_
RegisterClass name.
Definition: TDGen.hh:739