ProcessorState Class Reference

#include <instruction.h>

Collaboration diagram for ProcessorState:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProcessorState ()
void merge (const ProcessorState &state)
void reset ()
RegisterStatereg (const Register &reg)
RegisterState reg (const Register &reg) const
bool operator== (const ProcessorState &state) const
bool operator!= (const ProcessorState &state) const
void print ()

Public Attributes

RegisterState working
 The working register.
RegisterState status
 The status register.

Protected Types

typedef QMap< Register, RegisterStateRegisterMap

Protected Attributes

RegisterMap m_registers

Detailed Description

Contains information on the state of a processor; e.g. register values

Author:
David Saxton

Definition at line 340 of file instruction.h.


Member Function Documentation

void ProcessorState::merge ( const ProcessorState state  ) 

Calls merge for each RegisterState.

Definition at line 560 of file instruction.cpp.

References m_registers, RegisterState::merge(), status, and working.

Referenced by Optimizer::giveInputStates().

void ProcessorState::reset (  ) 

Calls reset() for each RegisterState.

Definition at line 549 of file instruction.cpp.

References m_registers, RegisterState::reset(), status, and working.

Referenced by Instruction::generateLinksAndStates().

RegisterState & ProcessorState::reg ( const Register reg  ) 

Returns:
state for the given register.

Definition at line 618 of file instruction.cpp.

References m_registers, status, and working.

Referenced by Instr_andwf::behaviour(), Optimizer::canRemove(), Instr_btfss::generateLinksAndStates(), Instr_btfsc::generateLinksAndStates(), Instr_bsf::generateLinksAndStates(), Instr_bcf::generateLinksAndStates(), Instr_xorwf::generateLinksAndStates(), Instr_subwf::generateLinksAndStates(), Instr_rrf::generateLinksAndStates(), Instr_rlf::generateLinksAndStates(), Instr_movwf::generateLinksAndStates(), Instr_movf::generateLinksAndStates(), Instr_iorwf::generateLinksAndStates(), Instr_incf::generateLinksAndStates(), Instr_decfsz::generateLinksAndStates(), Instr_decf::generateLinksAndStates(), Instr_clrf::generateLinksAndStates(), Instr_andwf::generateLinksAndStates(), Instr_addwf::generateLinksAndStates(), Optimizer::optimizeInstructions(), and reg().

RegisterState ProcessorState::reg ( const Register reg  )  const

Returns:
state for the given register.

Definition at line 630 of file instruction.cpp.

References m_registers, reg(), status, and working.

bool ProcessorState::operator== ( const ProcessorState state  )  const

Returns:
whether all the RegisterStates are identical

Definition at line 642 of file instruction.cpp.

References m_registers, status, and working.

bool ProcessorState::operator!= ( const ProcessorState state  )  const [inline]

Returns:
whether any of the RegisterStates are not equal.

Definition at line 367 of file instruction.h.

void ProcessorState::print (  ) 

Displays each register's name and calls RegisterState::print in turn.

Definition at line 708 of file instruction.cpp.

References m_registers, RegisterState::print(), and working.


Member Data Documentation

RegisterMap ProcessorState::m_registers [protected]

All registers other than working and status. Entries are created on calls to reg with a new Register.

Definition at line 385 of file instruction.h.

Referenced by merge(), operator==(), print(), reg(), and reset().


The documentation for this class was generated from the following files:
Generated on Tue May 8 17:05:55 2007 for KTechLab by  doxygen 1.5.1