OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FixedRegisters Class Reference

#include <FixedRegisters.hh>

Collaboration diagram for FixedRegisters:
Collaboration graph

Public Member Functions

 FixedRegisters ()
 
virtual ~FixedRegisters ()
 
SimValuestackPointer () const
 
SimValueintegerArgumentRegister (int index) const
 
SimValuefloatArgumentRegister (int index) const
 
SimValueintegerReturnValue () const
 
SimValuefloatReturnValue () const
 
void setStackPointer (SimValue &value)
 
void addIntegerArgumentRegister (SimValue &value)
 
void addFloatArgumentRegister (SimValue &value)
 
void setIntegerReturnValue (SimValue &value)
 
void setFloatReturnValue (SimValue &value)
 

Private Member Functions

 FixedRegisters (const FixedRegisters &)
 Copying not allowed. More...
 
FixedRegistersoperator= (const FixedRegisters)
 Assignment not allowed. More...
 

Private Attributes

SimValuestackPointer_
 Stack pointer. More...
 
std::vector< SimValue * > integerArgs_
 Integer argument registers. More...
 
std::vector< SimValue * > floatArgs_
 Floating point argument registers. More...
 
SimValueintReturnValue_
 Integer return value. More...
 
SimValuefloatReturnValue_
 Floating point return value. More...
 

Detailed Description

Contains all the registers that are assigned to special purpose.

Definition at line 44 of file FixedRegisters.hh.

Constructor & Destructor Documentation

◆ FixedRegisters() [1/2]

FixedRegisters::FixedRegisters ( )

Constructor.

Definition at line 39 of file FixedRegisters.cc.

39  :
40  stackPointer_(NULL), intReturnValue_(NULL), floatReturnValue_(NULL) {
41 }

◆ ~FixedRegisters()

FixedRegisters::~FixedRegisters ( )
virtual

Destructor.

Definition at line 46 of file FixedRegisters.cc.

46  {
47 }

◆ FixedRegisters() [2/2]

FixedRegisters::FixedRegisters ( const FixedRegisters )
private

Copying not allowed.

Member Function Documentation

◆ addFloatArgumentRegister()

void FixedRegisters::addFloatArgumentRegister ( SimValue value)

Adds new float argument register.

Parameters
valueNew float argument register value.

Definition at line 144 of file FixedRegisters.cc.

144  {
145  floatArgs_.push_back(&value);
146 }

References floatArgs_.

◆ addIntegerArgumentRegister()

void FixedRegisters::addIntegerArgumentRegister ( SimValue value)

Adds new integer argument register.

Parameters
valueNew integer argument register value.

Definition at line 134 of file FixedRegisters.cc.

134  {
135  integerArgs_.push_back(&value);
136 }

References integerArgs_.

◆ floatArgumentRegister()

SimValue & FixedRegisters::floatArgumentRegister ( int  index) const

Returns float argument register with a given index.

If index is out of range, returns NullSimValue.

Returns
Float argument register with a given index.

Definition at line 85 of file FixedRegisters.cc.

85  {
86  if (index < 0 || index > static_cast<int>(floatArgs_.size()) - 1) {
87  return NullSimValue::instance();
88  }
89  return *floatArgs_[index];
90 }

References floatArgs_, and NullSimValue::instance().

Here is the call graph for this function:

◆ floatReturnValue()

SimValue & FixedRegisters::floatReturnValue ( ) const

Returns float return value.

Returns
Float return value.

Definition at line 111 of file FixedRegisters.cc.

111  {
112  if (floatReturnValue_ == NULL) {
113  return NullSimValue::instance();
114  }
115  return *floatReturnValue_;
116 }

References floatReturnValue_, and NullSimValue::instance().

Here is the call graph for this function:

◆ integerArgumentRegister()

SimValue & FixedRegisters::integerArgumentRegister ( int  index) const

Returns integer argument with a given index.

If index is out of range, returns NullSimValue.

Returns
Integer argument with a given index.

Definition at line 70 of file FixedRegisters.cc.

70  {
71  if (index < 0 || index > static_cast<int>(integerArgs_.size()) - 1) {
72  return NullSimValue::instance();
73  }
74  return *integerArgs_[index];
75 }

References NullSimValue::instance(), and integerArgs_.

Here is the call graph for this function:

◆ integerReturnValue()

SimValue & FixedRegisters::integerReturnValue ( ) const

Returns integer return value.

Returns
Integer return value.

Definition at line 98 of file FixedRegisters.cc.

98  {
99  if (intReturnValue_ == NULL) {
100  return NullSimValue::instance();
101  }
102  return *intReturnValue_;
103 }

References NullSimValue::instance(), and intReturnValue_.

Here is the call graph for this function:

◆ operator=()

FixedRegisters& FixedRegisters::operator= ( const  FixedRegisters)
private

Assignment not allowed.

◆ setFloatReturnValue()

void FixedRegisters::setFloatReturnValue ( SimValue value)

Sets float return value to new value.

Parameters
valueNew value.

Definition at line 164 of file FixedRegisters.cc.

164  {
165  floatReturnValue_ = &value;
166 }

References floatReturnValue_.

◆ setIntegerReturnValue()

void FixedRegisters::setIntegerReturnValue ( SimValue value)

Sets integer return value to new value.

Parameters
valueNew value.

Definition at line 154 of file FixedRegisters.cc.

154  {
155  intReturnValue_ = &value;
156 }

References intReturnValue_.

◆ setStackPointer()

void FixedRegisters::setStackPointer ( SimValue value)

Sets stack pointer to new value.

Parameters
valueNew value.

Definition at line 124 of file FixedRegisters.cc.

124  {
125  stackPointer_ = &value;
126 }

References stackPointer_.

◆ stackPointer()

SimValue & FixedRegisters::stackPointer ( ) const

Returns the stack pointer value.

Returns
Stack pointer value.

Definition at line 55 of file FixedRegisters.cc.

55  {
56  if (stackPointer_ == NULL) {
57  return NullSimValue::instance();
58  }
59  return *stackPointer_;
60 }

References NullSimValue::instance(), and stackPointer_.

Here is the call graph for this function:

Member Data Documentation

◆ floatArgs_

std::vector<SimValue*> FixedRegisters::floatArgs_
private

Floating point argument registers.

Definition at line 72 of file FixedRegisters.hh.

Referenced by addFloatArgumentRegister(), and floatArgumentRegister().

◆ floatReturnValue_

SimValue* FixedRegisters::floatReturnValue_
private

Floating point return value.

Definition at line 76 of file FixedRegisters.hh.

Referenced by floatReturnValue(), and setFloatReturnValue().

◆ integerArgs_

std::vector<SimValue*> FixedRegisters::integerArgs_
private

Integer argument registers.

Definition at line 70 of file FixedRegisters.hh.

Referenced by addIntegerArgumentRegister(), and integerArgumentRegister().

◆ intReturnValue_

SimValue* FixedRegisters::intReturnValue_
private

Integer return value.

Definition at line 74 of file FixedRegisters.hh.

Referenced by integerReturnValue(), and setIntegerReturnValue().

◆ stackPointer_

SimValue* FixedRegisters::stackPointer_
private

Stack pointer.

Definition at line 68 of file FixedRegisters.hh.

Referenced by setStackPointer(), and stackPointer().


The documentation for this class was generated from the following files:
NullSimValue::instance
static SimValue & instance()
Definition: SimValue.cc:1642
FixedRegisters::intReturnValue_
SimValue * intReturnValue_
Integer return value.
Definition: FixedRegisters.hh:74
FixedRegisters::floatReturnValue_
SimValue * floatReturnValue_
Floating point return value.
Definition: FixedRegisters.hh:76
FixedRegisters::stackPointer_
SimValue * stackPointer_
Stack pointer.
Definition: FixedRegisters.hh:68
FixedRegisters::integerArgs_
std::vector< SimValue * > integerArgs_
Integer argument registers.
Definition: FixedRegisters.hh:70
FixedRegisters::floatArgs_
std::vector< SimValue * > floatArgs_
Floating point argument registers.
Definition: FixedRegisters.hh:72