OpenASIP
2.0
|
#include <TerminalRegister.hh>
Public Member Functions | |
TerminalRegister (const TTAMachine::Port &port, int index) | |
virtual | ~TerminalRegister () |
Copying is allowed. More... | |
virtual bool | isImmediateRegister () const |
virtual bool | isGPR () const |
virtual bool | isUniversalMachineRegister () const |
virtual const TTAMachine::RegisterFile & | registerFile () const |
virtual const TTAMachine::ImmediateUnit & | immediateUnit () const |
virtual int | index () const |
virtual const TTAMachine::Port & | port () const |
virtual void | setIndex (int index) |
virtual Terminal * | copy () const |
virtual bool | equals (const Terminal &other) const |
virtual TCEString | toString () const |
Public Member Functions inherited from TTAProgram::Terminal | |
Terminal () | |
virtual | ~Terminal () |
virtual bool | isImmediate () const |
virtual bool | isAddress () const |
virtual bool | isInstructionAddress () const |
virtual bool | isFUPort () const |
virtual bool | isRA () const |
virtual bool | isBasicBlockReference () const |
virtual bool | isProgramOperationReference () const |
virtual bool | isCodeSymbolReference () const |
virtual SimValue | value () const |
virtual Address | address () const |
virtual const InstructionReference & | instructionReference () const |
virtual InstructionReference & | instructionReference () |
virtual const TTAMachine::FunctionUnit & | functionUnit () const |
virtual const BasicBlock & | basicBlock () const |
virtual bool | isOpcodeSetting () const |
virtual bool | isTriggering () const |
virtual Operation & | operation () const |
virtual Operation & | hintOperation () const |
virtual int | operationIndex () const |
virtual void | setInstructionReference (InstructionReference ref) |
bool | operator== (const Terminal &other) const |
Private Member Functions | |
TerminalRegister & | operator= (const TerminalRegister &) |
Assignment not allowed. More... | |
Private Attributes | |
const TTAMachine::Unit & | unit_ |
Unit of the terminal. More... | |
const TTAMachine::Port & | port_ |
Port of the unit. More... | |
short | index_ |
Index of the register of the register file or immediate unit. More... | |
bool | isImmUnit_ |
Unit type flag: true if immediate unit, false if register file. More... | |
Represents a reference to registers from general-purpose register files and immediate units.
These types of terminals are characterised by the fact that multiple, functionally identical registers are accessed through the same port. Registers are identified by an index.
Definition at line 53 of file TerminalRegister.hh.
TTAProgram::TerminalRegister::TerminalRegister | ( | const TTAMachine::Port & | port, |
int | index | ||
) |
The constructor.
unit | The register file. |
port | The port of the register file. |
index | Register identifier. |
Definition at line 50 of file TerminalRegister.cc.
References isImmUnit_, and unit_.
Referenced by copy().
|
virtual |
|
virtual |
Creates an exact copy of the terminal and returns it.
Implements TTAProgram::Terminal.
Definition at line 147 of file TerminalRegister.cc.
References index_, port_, and TerminalRegister().
Referenced by RegisterCopyAdder::addConnectionRegisterCopies(), and RegisterCopyAdder::addConnectionRegisterCopiesImmediate().
|
virtual |
Checks if terminals are equal.
other | Terminal to compare. |
Implements TTAProgram::Terminal.
Definition at line 158 of file TerminalRegister.cc.
References immediateUnit(), TTAProgram::Terminal::immediateUnit(), index(), TTAProgram::Terminal::index(), isGPR(), TTAProgram::Terminal::isGPR(), isImmediateRegister(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::Component::name(), registerFile(), and TTAProgram::Terminal::registerFile().
Referenced by ControlFlowGraph::createJumps().
|
virtual |
Returns the immediate unit of the long immediate register.
Applicable only if the unit of the terminal is an instance of ImmediateUnit.
WrongSubclass | if the unit of the terminal is not an instance of ImmediateUnit. |
Reimplemented from TTAProgram::Terminal.
Definition at line 99 of file TerminalRegister.cc.
References isImmUnit_, and unit_.
Referenced by equals().
|
virtual |
Return the index of the register (either a long immediate or a general-purpose register).
WrongSubclass | if the terminal is not an instance of TerminalRegister. |
Reimplemented from TTAProgram::Terminal.
Referenced by llvm::LLVMTCEBuilder::createGuard(), equals(), setIndex(), toString(), CopyingDelaySlotFiller::writesRegister(), and SimpleIfConverter::writesRegister().
|
virtual |
Tells whether the terminal is a general-purpose register.
Reimplemented from TTAProgram::Terminal.
Referenced by ControlFlowGraph::createJumps(), and equals().
|
virtual |
Tells whether the terminal is a long immediate register.
Reimplemented from TTAProgram::Terminal.
Referenced by ControlFlowGraph::createJumps(), and equals().
|
virtual |
Tells whether the terminal is a reg in UniversalMachine
Reimplemented from TTAProgram::Terminal.
Definition at line 198 of file TerminalRegister.cc.
References unit_.
|
private |
Assignment not allowed.
|
virtual |
Return the port.
WrongSubclass | never. |
Reimplemented from TTAProgram::Terminal.
Definition at line 116 of file TerminalRegister.cc.
References port_.
|
virtual |
Returns the register file of the general-purpose register.
Applicable only if the unit of the terminal is an instance of RegisterFile.
WrongSubclass | if the unit of the terminal is not an instance of RegisterFile. |
Reimplemented from TTAProgram::Terminal.
Definition at line 78 of file TerminalRegister.cc.
References isImmUnit_, and unit_.
Referenced by llvm::LLVMTCEBuilder::createGuard(), equals(), toString(), CopyingDelaySlotFiller::writesRegister(), and SimpleIfConverter::writesRegister().
|
virtual |
Change the register of the register file to the given index.
index | The new register index. |
OutOfRange | if index is not smaller than the size of the register file or immediate unit it belongs to. |
Reimplemented from TTAProgram::Terminal.
Definition at line 128 of file TerminalRegister.cc.
References index(), index_, TTAMachine::BaseRegisterFile::numberOfRegisters(), and unit_.
|
virtual |
Implements TTAProgram::Terminal.
Definition at line 179 of file TerminalRegister.cc.
References index(), index_, isImmUnit_, TTAMachine::Component::name(), registerFile(), DisassemblyRegister::toString(), and unit_.
|
private |
Index of the register of the register file or immediate unit.
Definition at line 86 of file TerminalRegister.hh.
Referenced by copy(), setIndex(), and toString().
|
private |
Unit type flag: true if immediate unit, false if register file.
Definition at line 88 of file TerminalRegister.hh.
Referenced by immediateUnit(), registerFile(), TerminalRegister(), and toString().
|
private |
Port of the unit.
Definition at line 84 of file TerminalRegister.hh.
|
private |
Unit of the terminal.
Definition at line 82 of file TerminalRegister.hh.
Referenced by immediateUnit(), isUniversalMachineRegister(), registerFile(), setIndex(), TerminalRegister(), and toString().