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

#include <IndexBound.hh>

Collaboration diagram for IndexBound:
Collaboration graph

Public Member Functions

 IndexBound (unsigned int startIndex, unsigned int endIndex)
 
 IndexBound (unsigned int startIndex, unsigned int endIndex, int limmWidth, int limmLeftIndex, int limmRightIndex)
 
 ~IndexBound ()
 
unsigned int slotStartIndex () const
 
unsigned int slotEndIndex () const
 
void incrStartIndex (unsigned int increment)
 
void incrEndIndex (unsigned int increment)
 
bool isLimmEncoded () const
 
int limmWidth () const
 
int limmLeftIndex () const
 
int limmRightIndex () const
 

Private Member Functions

 IndexBound ()
 

Private Attributes

unsigned int slotStartIndex_
 Start index of the moveslot in instruction. More...
 
unsigned int slotEndIndex_
 End index of the moveslot in instruction. More...
 
bool usesLimm_
 Is address encoded in long immediate. More...
 
int limmWidth_
 Width of the long immediate chunk in this moveslot. More...
 
int limmValueLeftBitIndex_
 Index of the left most bit (MSB) of the value to be encoded in this slot. More...
 
int limmValueRightBitIndex_
 Index of the right most bit (LSB) of the value to be encoded in this slot. More...
 

Detailed Description

Class for storing index information needed for fixing instruction addresses in InstructionBitVector

Definition at line 40 of file IndexBound.hh.

Constructor & Destructor Documentation

◆ IndexBound() [1/3]

IndexBound::IndexBound ( unsigned int  startIndex,
unsigned int  endIndex 
)

Constructor for moveslot bound indices

Definition at line 38 of file IndexBound.cc.

38  :
39  slotStartIndex_(startIndex), slotEndIndex_(endIndex), usesLimm_(false),
41 }

◆ IndexBound() [2/3]

IndexBound::IndexBound ( unsigned int  startIndex,
unsigned int  endIndex,
int  limmWidth,
int  limmLeftIndex,
int  limmRightIndex 
)

Constructor for moveslot bounds and limm slot bound indices

Definition at line 46 of file IndexBound.cc.

◆ ~IndexBound()

IndexBound::~IndexBound ( )

The destructor.

Definition at line 60 of file IndexBound.cc.

60  {
61 }

◆ IndexBound() [3/3]

IndexBound::IndexBound ( )
private

Member Function Documentation

◆ incrEndIndex()

void IndexBound::incrEndIndex ( unsigned int  increment)

Increment end bit index.

Useful for converting the move slot index to absolute position inside the instruction bit stream

Parameters
incrementValue to be added to the end index

Definition at line 109 of file IndexBound.cc.

109  {
110 
111  slotEndIndex_ += increment;
112 }

References slotEndIndex_.

◆ incrStartIndex()

void IndexBound::incrStartIndex ( unsigned int  increment)

Increment start bit index.

Useful for converting the move slot index to absolute position inside the instruction bit stream.

Parameters
incrementValue to be added to the start index

Definition at line 95 of file IndexBound.cc.

95  {
96 
97  slotStartIndex_ += increment;
98 }

References slotStartIndex_.

◆ isLimmEncoded()

bool IndexBound::isLimmEncoded ( ) const

Is long immediate encoding utilized in this move slot

Returns
Is long immediate utilized in this move slot

Definition at line 120 of file IndexBound.cc.

120  {
121 
122  return usesLimm_;
123 }

References usesLimm_.

◆ limmLeftIndex()

int IndexBound::limmLeftIndex ( ) const

Query the leftmost (MSB) index of the long immediate value in this slot

This tells the leftmost bit of the long immediate value this slot is going to encode, not the position of the limm slot inside the instruction. Notice that the indexing starts from zero.

Returns
Leftmost bit of the LIMM value this slot is encoding

Definition at line 146 of file IndexBound.cc.

146  {
147 
148  return limmValueLeftBitIndex_;
149 }

References limmValueLeftBitIndex_.

Referenced by InstructionBitVector::fixBits().

◆ limmRightIndex()

int IndexBound::limmRightIndex ( ) const

Query the rightmost (LSB) index of the long immediate value in this slot

This tells the rightmost bit of the long immediate value this slot is going to encode, not the position of the limm slot inside the instruction. Notice that the indexing starts from zero.

Returns
Rightmost bit of the LIMM value this slot is encoding

Definition at line 161 of file IndexBound.cc.

161  {
162 
164 }

References limmValueRightBitIndex_.

Referenced by InstructionBitVector::fixBits().

◆ limmWidth()

int IndexBound::limmWidth ( ) const

Query the width of the limm slot

Returns
Width of the limm slot. 0 if limm is not used

Definition at line 131 of file IndexBound.cc.

131  {
132 
133  return limmWidth_;
134 }

References limmWidth_.

Referenced by InstructionBitVector::fixBits().

◆ slotEndIndex()

unsigned int IndexBound::slotEndIndex ( ) const

Move slot end index

Returns
End bit index of the move slot

Definition at line 81 of file IndexBound.cc.

81  {
82 
83  return slotEndIndex_;
84 }

References slotEndIndex_.

Referenced by InstructionBitVector::addIndexBoundsForReference(), and InstructionBitVector::fixBits().

◆ slotStartIndex()

unsigned int IndexBound::slotStartIndex ( ) const

Move slot start index

Returns
Starting bit index of the move slot

Definition at line 70 of file IndexBound.cc.

70  {
71 
72  return slotStartIndex_;
73 }

References slotStartIndex_.

Referenced by InstructionBitVector::addIndexBoundsForReference(), and InstructionBitVector::fixBits().

Member Data Documentation

◆ limmValueLeftBitIndex_

int IndexBound::limmValueLeftBitIndex_
private

Index of the left most bit (MSB) of the value to be encoded in this slot.

Definition at line 83 of file IndexBound.hh.

Referenced by limmLeftIndex().

◆ limmValueRightBitIndex_

int IndexBound::limmValueRightBitIndex_
private

Index of the right most bit (LSB) of the value to be encoded in this slot.

Definition at line 86 of file IndexBound.hh.

Referenced by limmRightIndex().

◆ limmWidth_

int IndexBound::limmWidth_
private

Width of the long immediate chunk in this moveslot.

Definition at line 80 of file IndexBound.hh.

Referenced by limmWidth().

◆ slotEndIndex_

unsigned int IndexBound::slotEndIndex_
private

End index of the moveslot in instruction.

Definition at line 76 of file IndexBound.hh.

Referenced by incrEndIndex(), and slotEndIndex().

◆ slotStartIndex_

unsigned int IndexBound::slotStartIndex_
private

Start index of the moveslot in instruction.

Definition at line 74 of file IndexBound.hh.

Referenced by incrStartIndex(), and slotStartIndex().

◆ usesLimm_

bool IndexBound::usesLimm_
private

Is address encoded in long immediate.

Definition at line 78 of file IndexBound.hh.

Referenced by isLimmEncoded().


The documentation for this class was generated from the following files:
IndexBound::usesLimm_
bool usesLimm_
Is address encoded in long immediate.
Definition: IndexBound.hh:78
IndexBound::limmValueRightBitIndex_
int limmValueRightBitIndex_
Index of the right most bit (LSB) of the value to be encoded in this slot.
Definition: IndexBound.hh:86
IndexBound::limmWidth
int limmWidth() const
Definition: IndexBound.cc:131
IndexBound::limmValueLeftBitIndex_
int limmValueLeftBitIndex_
Index of the left most bit (MSB) of the value to be encoded in this slot.
Definition: IndexBound.hh:83
IndexBound::slotStartIndex_
unsigned int slotStartIndex_
Start index of the moveslot in instruction.
Definition: IndexBound.hh:74
IndexBound::limmLeftIndex
int limmLeftIndex() const
Definition: IndexBound.cc:146
IndexBound::limmRightIndex
int limmRightIndex() const
Definition: IndexBound.cc:161
IndexBound::limmWidth_
int limmWidth_
Width of the long immediate chunk in this moveslot.
Definition: IndexBound.hh:80
IndexBound::slotEndIndex_
unsigned int slotEndIndex_
End index of the moveslot in instruction.
Definition: IndexBound.hh:76