lestes::md::instructions::tm_instr_base Class Reference

A description of target machine instruction. More...

#include <tm_instr_base.g.hh>

Inheritance diagram for lestes::md::instructions::tm_instr_base:

lestes::std::object lestes::std::mem::keystone lestes::md::instructions::tm_instr List of all members.

Public Member Functions

ulint id_get () const
 The method id_get returns the value of the field tm_instr_base::id.
void id_set (ulint)
 The method id_set sets the field tm_instr_base::id to the given value.
ptr< ::lestes::std::vector<
srp< tm_instr_op_base > > > 
operands_input_get () const
 The method operands_input_get returns the value of the field tm_instr_base::operands_input.
void operands_input_set (const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > &)
 The method operands_input_set sets the field tm_instr_base::operands_input to the given value.
ptr< ::lestes::std::vector<
srp< tm_instr_op_base > > > 
operands_output_get () const
 The method operands_output_get returns the value of the field tm_instr_base::operands_output.
void operands_output_set (const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > &)
 The method operands_output_set sets the field tm_instr_base::operands_output to the given value.
lstring asm_output_get () const
 The method asm_output_get returns the value of the field tm_instr_base::asm_output.
void asm_output_set (lstring)
 The method asm_output_set sets the field tm_instr_base::asm_output to the given value.
ptr< ::lestes::std::map< ulint,
lstring > > 
properties_get () const
 The method properties_get returns the value of the field tm_instr_base::properties.
void properties_set (const ptr< ::lestes::std::map< ulint, lstring > > &)
 The method properties_set sets the field tm_instr_base::properties to the given value.
ptr< ::lestes::std::set< ulint > > versions_get () const
 The method versions_get returns the value of the field tm_instr_base::versions.
void versions_set (const ptr< ::lestes::std::set< ulint > > &)
 The method versions_set sets the field tm_instr_base::versions to the given value.
ulint flags_get () const
 The method flags_get returns the value of the field tm_instr_base::flags.
void flags_set (ulint)
 The method flags_set sets the field tm_instr_base::flags to the given value.
ptr< ::lestes::md::instructions::execution_infoexec_info_get () const
 The method exec_info_get returns the value of the field tm_instr_base::exec_info.
void exec_info_set (const ptr< ::lestes::md::instructions::execution_info > &)
 The method exec_info_set sets the field tm_instr_base::exec_info to the given value.
bool is_jump ()
 Tells whether the current instruction is jump.
bool is_load ()
 Tells whether the current instruction is load.
bool is_store ()
 Tells whether the current instruction is store.
bool is_system ()
 Tells whether the current instruction is system instruction.
bool is_copy ()
 Tells whether the current instruction is copy instruction.
virtual ptr< reflection_listreflection_get () const
 for purposes of dumping
virtual ptr< field_list_listfield_values_get () const
 for purposes of dumping

Protected Member Functions

 tm_instr_base (ulint a__tm_instr_base__id, ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > a__tm_instr_base__operands_input, ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > a__tm_instr_base__operands_output, lstring a__tm_instr_base__asm_output, ptr< ::lestes::std::map< ulint, lstring > > a__tm_instr_base__properties, ptr< ::lestes::std::set< ulint > > a__tm_instr_base__versions, ulint a__tm_instr_base__flags, ptr< ::lestes::md::instructions::execution_info > a__tm_instr_base__exec_info)
 Generated constructor for class tm_instr_base.
virtual void gc_mark ()
 Marking routine for class tm_instr_base.

Private Attributes

ulint id
 The instruction's id.
srp< ::lestes::std::vector<
srp< tm_instr_op_base > > > 
operands_input
 The instruction's input operands.
srp< ::lestes::std::vector<
srp< tm_instr_op_base > > > 
operands_output
 The instruction's output operands.
lstring asm_output
 Assembly code template for the instruction.
srp< ::lestes::std::map< ulint,
lstring > > 
properties
 User defined properties.
srp< ::lestes::std::set< ulint > > versions
 Set of ids of instructions that perform the same operation as current one does but they differ in operand types and execution.
ulint flags
 The instruction's flags.
srp< ::lestes::md::instructions::execution_infoexec_info
 A description of the instruction's execution parameters.

Static Private Attributes

static ptr< reflection_listreflection = reflection

Detailed Description

A description of target machine instruction.

Machine description generates instances of this class for instructions of a target architecture.

Note: A concrete derived class is target dependent and it is placed in /target/machine/${TARGET_CPU}/lestes/md/instructions/ directory.

Definition at line 77 of file tm_instr_base.g.hh.


Constructor & Destructor Documentation

lestes::md::instructions::tm_instr_base::tm_instr_base ( ulint  a__tm_instr_base__id,
ptr< ::lestes::std::vector< srp< tm_instr_op_base > > >  a__tm_instr_base__operands_input,
ptr< ::lestes::std::vector< srp< tm_instr_op_base > > >  a__tm_instr_base__operands_output,
lstring  a__tm_instr_base__asm_output,
ptr< ::lestes::std::map< ulint, lstring > >  a__tm_instr_base__properties,
ptr< ::lestes::std::set< ulint > >  a__tm_instr_base__versions,
ulint  a__tm_instr_base__flags,
ptr< ::lestes::md::instructions::execution_info a__tm_instr_base__exec_info 
) [protected]

Generated constructor for class tm_instr_base.

Generated constructor for class tm_instr_base.

Author:
lsg

Definition at line 172 of file tm_instr_base.g.cc.

00180         : ::lestes::std::object(), id(a__tm_instr_base__id), operands_input(checked(a__tm_instr_base__operands_input)), operands_output(checked(a__tm_instr_base__operands_output)), asm_output(a__tm_instr_base__asm_output), properties(checked(a__tm_instr_base__properties)), versions(a__tm_instr_base__versions), flags(a__tm_instr_base__flags), exec_info(a__tm_instr_base__exec_info)
00181 {}


Member Function Documentation

ulint lestes::md::instructions::tm_instr_base::id_get (  )  const

The method id_get returns the value of the field tm_instr_base::id.

Returns:
The value of tm_instr_base::id.
Author:
lsg

Definition at line 28 of file tm_instr_base.g.cc.

References id.

00029 {
00030         return id;
00031 }

void lestes::md::instructions::tm_instr_base::id_set ( ulint  x  ) 

The method id_set sets the field tm_instr_base::id to the given value.

Parameters:
[in] x The new value to set tm_instr_base::id to.
Author:
lsg

Definition at line 37 of file tm_instr_base.g.cc.

References id.

00038 {
00039         tm_instr_base::id = x;
00040 }

ptr<::lestes::std::vector< srp< tm_instr_op_base > > > lestes::md::instructions::tm_instr_base::operands_input_get (  )  const

The method operands_input_get returns the value of the field tm_instr_base::operands_input.

Returns:
The value of tm_instr_base::operands_input.
Author:
lsg

Definition at line 46 of file tm_instr_base.g.cc.

References operands_input.

00047 {
00048         return operands_input;
00049 }

void lestes::md::instructions::tm_instr_base::operands_input_set ( const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > &  x  ) 

The method operands_input_set sets the field tm_instr_base::operands_input to the given value.

Parameters:
[in] x The new value to set tm_instr_base::operands_input to.
Author:
lsg

Definition at line 55 of file tm_instr_base.g.cc.

References operands_input.

00056 {
00057         tm_instr_base::operands_input = x;
00058 }

ptr<::lestes::std::vector< srp< tm_instr_op_base > > > lestes::md::instructions::tm_instr_base::operands_output_get (  )  const

The method operands_output_get returns the value of the field tm_instr_base::operands_output.

Returns:
The value of tm_instr_base::operands_output.
Author:
lsg

Definition at line 64 of file tm_instr_base.g.cc.

References operands_output.

00065 {
00066         return operands_output;
00067 }

void lestes::md::instructions::tm_instr_base::operands_output_set ( const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > &  x  ) 

The method operands_output_set sets the field tm_instr_base::operands_output to the given value.

Parameters:
[in] x The new value to set tm_instr_base::operands_output to.
Author:
lsg

Definition at line 73 of file tm_instr_base.g.cc.

References operands_output.

00074 {
00075         tm_instr_base::operands_output = x;
00076 }

lstring lestes::md::instructions::tm_instr_base::asm_output_get (  )  const

The method asm_output_get returns the value of the field tm_instr_base::asm_output.

Returns:
The value of tm_instr_base::asm_output.
Author:
lsg

Definition at line 82 of file tm_instr_base.g.cc.

References asm_output.

00083 {
00084         return asm_output;
00085 }

void lestes::md::instructions::tm_instr_base::asm_output_set ( lstring  x  ) 

The method asm_output_set sets the field tm_instr_base::asm_output to the given value.

Parameters:
[in] x The new value to set tm_instr_base::asm_output to.
Author:
lsg

Definition at line 91 of file tm_instr_base.g.cc.

References asm_output.

00092 {
00093         tm_instr_base::asm_output = x;
00094 }

ptr<::lestes::std::map< ulint, lstring > > lestes::md::instructions::tm_instr_base::properties_get (  )  const

The method properties_get returns the value of the field tm_instr_base::properties.

Returns:
The value of tm_instr_base::properties.
Author:
lsg

Definition at line 100 of file tm_instr_base.g.cc.

References properties.

00101 {
00102         return properties;
00103 }

void lestes::md::instructions::tm_instr_base::properties_set ( const ptr< ::lestes::std::map< ulint, lstring > > &  x  ) 

The method properties_set sets the field tm_instr_base::properties to the given value.

Parameters:
[in] x The new value to set tm_instr_base::properties to.
Author:
lsg

Definition at line 109 of file tm_instr_base.g.cc.

References properties.

00110 {
00111         tm_instr_base::properties = x;
00112 }

ptr<::lestes::std::set< ulint > > lestes::md::instructions::tm_instr_base::versions_get (  )  const

The method versions_get returns the value of the field tm_instr_base::versions.

Returns:
The value of tm_instr_base::versions.
Author:
lsg

Definition at line 118 of file tm_instr_base.g.cc.

References versions.

00119 {
00120         return versions;
00121 }

void lestes::md::instructions::tm_instr_base::versions_set ( const ptr< ::lestes::std::set< ulint > > &  x  ) 

The method versions_set sets the field tm_instr_base::versions to the given value.

Parameters:
[in] x The new value to set tm_instr_base::versions to.
Author:
lsg

Definition at line 127 of file tm_instr_base.g.cc.

References versions.

00128 {
00129         tm_instr_base::versions = x;
00130 }

ulint lestes::md::instructions::tm_instr_base::flags_get (  )  const

The method flags_get returns the value of the field tm_instr_base::flags.

Returns:
The value of tm_instr_base::flags.
Author:
lsg

Definition at line 136 of file tm_instr_base.g.cc.

References flags.

00137 {
00138         return flags;
00139 }

void lestes::md::instructions::tm_instr_base::flags_set ( ulint  x  ) 

The method flags_set sets the field tm_instr_base::flags to the given value.

Parameters:
[in] x The new value to set tm_instr_base::flags to.
Author:
lsg

Definition at line 145 of file tm_instr_base.g.cc.

References flags.

00146 {
00147         tm_instr_base::flags = x;
00148 }

ptr<::lestes::md::instructions::execution_info > lestes::md::instructions::tm_instr_base::exec_info_get (  )  const

The method exec_info_get returns the value of the field tm_instr_base::exec_info.

Returns:
The value of tm_instr_base::exec_info.
Author:
lsg

Definition at line 154 of file tm_instr_base.g.cc.

References exec_info.

00155 {
00156         return exec_info;
00157 }

void lestes::md::instructions::tm_instr_base::exec_info_set ( const ptr< ::lestes::md::instructions::execution_info > &  x  ) 

The method exec_info_set sets the field tm_instr_base::exec_info to the given value.

Parameters:
[in] x The new value to set tm_instr_base::exec_info to.
Author:
lsg

Definition at line 163 of file tm_instr_base.g.cc.

References exec_info.

00164 {
00165         tm_instr_base::exec_info = x;
00166 }

bool lestes::md::instructions::tm_instr_base::is_jump (  ) 

Tells whether the current instruction is jump.

Definition at line 14 of file tm_instr_base.cc.

References flags, and lestes::md::instructions::IF_JUMP.

00015 {
00016     return flags & IF_JUMP;
00017 }

bool lestes::md::instructions::tm_instr_base::is_load (  ) 

Tells whether the current instruction is load.

Definition at line 22 of file tm_instr_base.cc.

References flags, and lestes::md::instructions::IF_LOAD.

00023 {
00024     return flags & IF_LOAD;
00025 }

bool lestes::md::instructions::tm_instr_base::is_store (  ) 

Tells whether the current instruction is store.

Definition at line 30 of file tm_instr_base.cc.

References flags, and lestes::md::instructions::IF_STORE.

00031 {
00032     return flags & IF_STORE;
00033 }

bool lestes::md::instructions::tm_instr_base::is_system (  ) 

Tells whether the current instruction is system instruction.

Definition at line 38 of file tm_instr_base.cc.

References flags, and lestes::md::instructions::IF_SYS.

00039 {
00040     return flags & IF_SYS;
00041 }

bool lestes::md::instructions::tm_instr_base::is_copy (  ) 

Tells whether the current instruction is copy instruction.

Definition at line 46 of file tm_instr_base.cc.

References flags, and lestes::md::instructions::IF_COPY.

00047 {
00048     return flags & IF_COPY;
00049 }

ptr< object::reflection_list > lestes::md::instructions::tm_instr_base::reflection_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::std::object.

Reimplemented in lestes::md::instructions::tm_instr.

Definition at line 183 of file tm_instr_base.g.cc.

References lestes::std::list< T >::create(), reflection, and lestes::std::object::reflection_get().

Referenced by lestes::md::instructions::tm_instr::reflection_get().

00184 {
00185         if (!reflection) {
00186                 typedef class_reflection::field_metadata md;
00187                 typedef class_reflection::field_metadata_list mdlist;
00188                 ptr<mdlist> mdl = mdlist::create();
00189                 mdl->push_back( md::create( "id", "ulint" ) );
00190                 mdl->push_back( md::create( "operands_input", "vector&lt; srp&lt; tm_instr_op_base &gt; &gt;" ) );
00191                 mdl->push_back( md::create( "operands_output", "vector&lt; srp&lt; tm_instr_op_base &gt; &gt;" ) );
00192                 mdl->push_back( md::create( "asm_output", "lstring" ) );
00193                 mdl->push_back( md::create( "properties", "map&lt; ulint, lstring &gt;" ) );
00194                 mdl->push_back( md::create( "versions", "set&lt; ulint &gt;" ) );
00195                 mdl->push_back( md::create( "flags", "ulint" ) );
00196                 mdl->push_back( md::create( "exec_info", "execution_info" ) );
00197                 reflection = reflection_list::create( ::lestes::std::object::reflection_get() );
00198                 reflection->push_back( class_reflection::create( "tm_instr_base", mdl ) );
00199         }
00200         return reflection;
00201 }

ptr< object::field_list_list > lestes::md::instructions::tm_instr_base::field_values_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::std::object.

Reimplemented in lestes::md::instructions::tm_instr.

Definition at line 203 of file tm_instr_base.g.cc.

References lestes::std::list< T >::create(), and lestes::std::object::field_values_get().

Referenced by lestes::md::instructions::tm_instr::field_values_get().

00204 {
00205         ptr < field_list_list > result = ::lestes::std::object::field_values_get();
00206         result->push_back( value_list::create() );
00207         result->back()->push_back( objectize< ulint > ::create( this->id ) );
00208         result->push_back( value_list::create() );
00209         result->back()->push_back( this->operands_input );
00210         result->push_back( value_list::create() );
00211         result->back()->push_back( this->operands_output );
00212         result->push_back( value_list::create() );
00213         result->back()->push_back( objectize< lstring > ::create( this->asm_output ) );
00214         result->push_back( value_list::create() );
00215         result->back()->push_back( this->properties );
00216         result->push_back( value_list::create() );
00217         result->back()->push_back( this->versions );
00218         result->push_back( value_list::create() );
00219         result->back()->push_back( objectize< ulint > ::create( this->flags ) );
00220         result->push_back( value_list::create() );
00221         result->back()->push_back( this->exec_info );
00222         return result;
00223 }

void lestes::md::instructions::tm_instr_base::gc_mark ( void   )  [protected, virtual]

Marking routine for class tm_instr_base.

Marking routine is used for garbage collection.

Author:
lsg

Reimplemented from lestes::std::mem::keystone.

Reimplemented in lestes::md::instructions::tm_instr.

Definition at line 230 of file tm_instr_base.g.cc.

References lestes::std::mem::keystone::gc_mark().

Referenced by lestes::md::instructions::tm_instr::gc_mark().

00231 {
00232 	::lestes::std::object::gc_mark();
00233 }


Member Data Documentation

ulint lestes::md::instructions::tm_instr_base::id [private]

The instruction's id.

Definition at line 161 of file tm_instr_base.g.hh.

Referenced by id_get(), and id_set().

srp< ::lestes::std::vector< srp< tm_instr_op_base > > > lestes::md::instructions::tm_instr_base::operands_input [private]

The instruction's input operands.

Definition at line 163 of file tm_instr_base.g.hh.

Referenced by operands_input_get(), and operands_input_set().

srp< ::lestes::std::vector< srp< tm_instr_op_base > > > lestes::md::instructions::tm_instr_base::operands_output [private]

The instruction's output operands.

Definition at line 165 of file tm_instr_base.g.hh.

Referenced by operands_output_get(), and operands_output_set().

lstring lestes::md::instructions::tm_instr_base::asm_output [private]

Assembly code template for the instruction.

This template is assembly code with tagged substitutions for operands. These tags are replaced with asm code for operand during code-generation phase.

Definition at line 171 of file tm_instr_base.g.hh.

Referenced by asm_output_get(), and asm_output_set().

srp< ::lestes::std::map< ulint, lstring > > lestes::md::instructions::tm_instr_base::properties [private]

User defined properties.

Definition at line 173 of file tm_instr_base.g.hh.

Referenced by properties_get(), and properties_set().

srp< ::lestes::std::set< ulint > > lestes::md::instructions::tm_instr_base::versions [private]

Set of ids of instructions that perform the same operation as current one does but they differ in operand types and execution.

Definition at line 175 of file tm_instr_base.g.hh.

Referenced by versions_get(), and versions_set().

ulint lestes::md::instructions::tm_instr_base::flags [private]

The instruction's flags.

Definition at line 177 of file tm_instr_base.g.hh.

Referenced by flags_get(), flags_set(), is_copy(), is_jump(), is_load(), is_store(), and is_system().

srp< ::lestes::md::instructions::execution_info > lestes::md::instructions::tm_instr_base::exec_info [private]

A description of the instruction's execution parameters.

Definition at line 179 of file tm_instr_base.g.hh.

Referenced by exec_info_get(), and exec_info_set().

ptr< object::reflection_list > lestes::md::instructions::tm_instr_base::reflection = reflection [static, private]

Reimplemented from lestes::std::object.

Reimplemented in lestes::md::instructions::tm_instr.

Definition at line 180 of file tm_instr_base.g.hh.

Referenced by reflection_get().


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:25:46 2007 for lestes by doxygen 1.5.1-20070107