tm_instr_base.g.hh

Go to the documentation of this file.
00001 // This file is automatically generated, do not edit.
00002 
00003 /*!
00004         \file
00005         \author jaz
00006 */
00007 
00008 #ifndef lestes__md__instructions__tm_instr_base_g_hh__included
00009 #define lestes__md__instructions__tm_instr_base_g_hh__included
00010 
00011 #include <lestes/std/vector.hh>
00012 #include <lestes/std/set.hh>
00013 #include <lestes/std/map.hh>
00014 #include <lestes/md/common.hh>
00015 #include <lestes/md/registers/tm_register_base.g.hh>
00016 #include <lestes/md/types/tm_data_type_base.g.hh>
00017 
00018 #include <lestes/std/objectize_macros.hh>
00019 package(lestes);
00020 package(std);
00021 class object;
00022 end_package(std);
00023 end_package(lestes);
00024 
00025 package(lestes);
00026 package(md);
00027 package(types);
00028 class tm_data_type_base;
00029 end_package(types);
00030 end_package(md);
00031 end_package(lestes);
00032 
00033 package(lestes);
00034 package(backend_v2);
00035 package(intercode);
00036 class ge_operand;
00037 end_package(intercode);
00038 end_package(backend_v2);
00039 end_package(lestes);
00040 
00041 package(lestes);
00042 package(md);
00043 package(instructions);
00044 class execution_info;
00045 end_package(instructions);
00046 end_package(md);
00047 end_package(lestes);
00048 
00049 package(lestes);
00050 package(md);
00051 package(instructions);
00052 
00053 //! tm_instr_base flags.
00054 enum intr_flag_type {
00055         IF_JUMP=1,
00056         IF_LOAD=2,
00057         IF_STORE=4,
00058         IF_SYS=8,
00059         IF_COPY=16
00060 };
00061 
00062 
00063 class tm_instr_base;
00064 class tm_instr_op_base;
00065 class tm_instr_op_mem_base;
00066 class tm_instr_op_reg_base;
00067 class tm_instr_op_imm_base;
00068 
00069 
00070 /*! \brief A description of target machine instruction.
00071 
00072 Machine description generates instances of this class for instructions of a target architecture.
00073                 
00074 Note: A concrete derived class is target dependent and it is placed in 
00075 /target/machine/${TARGET_CPU}/lestes/md/instructions/ directory. 
00076 */
00077 class tm_instr_base : public ::lestes::std::object {
00078 public:
00079         //! The method id_get returns the value of the field tm_instr_base::id.
00080         ulint id_get() const;
00081 
00082         //! The method id_set sets the field tm_instr_base::id to the given value.
00083         void id_set(ulint);
00084 
00085         //! The method operands_input_get returns the value of the field tm_instr_base::operands_input.
00086         ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_input_get() const;
00087 
00088         //! The method operands_input_set sets the field tm_instr_base::operands_input to the given value.
00089         void operands_input_set(const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > & );
00090 
00091         //! The method operands_output_get returns the value of the field tm_instr_base::operands_output.
00092         ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_output_get() const;
00093 
00094         //! The method operands_output_set sets the field tm_instr_base::operands_output to the given value.
00095         void operands_output_set(const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > & );
00096 
00097         //! The method asm_output_get returns the value of the field tm_instr_base::asm_output.
00098         lstring asm_output_get() const;
00099 
00100         //! The method asm_output_set sets the field tm_instr_base::asm_output to the given value.
00101         void asm_output_set(lstring);
00102 
00103         //! The method properties_get returns the value of the field tm_instr_base::properties.
00104         ptr< ::lestes::std::map< ulint, lstring > > properties_get() const;
00105 
00106         //! The method properties_set sets the field tm_instr_base::properties to the given value.
00107         void properties_set(const ptr< ::lestes::std::map< ulint, lstring > > & );
00108 
00109         //! The method versions_get returns the value of the field tm_instr_base::versions.
00110         ptr< ::lestes::std::set< ulint > > versions_get() const;
00111 
00112         //! The method versions_set sets the field tm_instr_base::versions to the given value.
00113         void versions_set(const ptr< ::lestes::std::set< ulint > > & );
00114 
00115         //! The method flags_get returns the value of the field tm_instr_base::flags.
00116         ulint flags_get() const;
00117 
00118         //! The method flags_set sets the field tm_instr_base::flags to the given value.
00119         void flags_set(ulint);
00120 
00121         //! The method exec_info_get returns the value of the field tm_instr_base::exec_info.
00122         ptr< ::lestes::md::instructions::execution_info > exec_info_get() const;
00123 
00124         //! The method exec_info_set sets the field tm_instr_base::exec_info to the given value.
00125         void exec_info_set(const ptr< ::lestes::md::instructions::execution_info > &);
00126 
00127         bool is_jump();
00128 
00129         bool is_load();
00130 
00131         bool is_store();
00132 
00133         bool is_system();
00134 
00135         bool is_copy();
00136 
00137         
00138 
00139         //! for purposes of dumping
00140         virtual ptr<reflection_list> reflection_get() const;
00141         //! for purposes of dumping
00142         virtual ptr<field_list_list> field_values_get() const;
00143         
00144 protected:
00145         //! Generated constructor for class tm_instr_base.
00146         tm_instr_base (
00147                 ulint a__tm_instr_base__id,
00148                 ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > a__tm_instr_base__operands_input,
00149                 ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > a__tm_instr_base__operands_output,
00150                 lstring a__tm_instr_base__asm_output,
00151                 ptr< ::lestes::std::map< ulint, lstring > > a__tm_instr_base__properties,
00152                 ptr< ::lestes::std::set< ulint > > a__tm_instr_base__versions,
00153                 ulint a__tm_instr_base__flags,
00154                 ptr< ::lestes::md::instructions::execution_info > a__tm_instr_base__exec_info);
00155 
00156         //! Marking routine for class tm_instr_base. 
00157         virtual void gc_mark();
00158 
00159 private:
00160         //! The instruction's id.
00161         ulint id;
00162         //! The instruction's input operands.
00163         srp< ::lestes::std::vector< srp< tm_instr_op_base > > >  operands_input;
00164         //! The instruction's output operands.
00165         srp< ::lestes::std::vector< srp< tm_instr_op_base > > >  operands_output;
00166         /*! \brief Assembly code template for the instruction.
00167 
00168         This template is assembly code with tagged substitutions for operands. These tags are replaced with asm code 
00169 for operand during code-generation phase.
00170         */
00171         lstring asm_output;
00172         //! User defined properties.
00173         srp< ::lestes::std::map< ulint, lstring > >  properties;
00174         //! Set of ids of instructions that perform the same operation as current one does but they differ in operand types and execution.
00175         srp< ::lestes::std::set< ulint > >  versions;
00176         //! The instruction's flags.
00177         ulint flags;
00178         //! A description of the instruction's execution parameters.
00179         srp< ::lestes::md::instructions::execution_info > exec_info;
00180         static ptr<reflection_list> reflection;
00181         
00182 }; // tm_instr_base
00183 
00184 
00185 //! Operand of tm_instr instruction.
00186 class tm_instr_op_base : public ::lestes::std::object {
00187 public:
00188         //! Operand kinds.
00189         enum kind_type {
00190                 REGISTER,
00191                 MEMORY,
00192                 IMMEDIATE
00193         };
00194 
00195         //! The method id_get returns the value of the field tm_instr_op_base::id.
00196         ulint id_get() const;
00197 
00198         //! The method id_set sets the field tm_instr_op_base::id to the given value.
00199         void id_set(ulint);
00200 
00201         //! The method allowed_types_get returns the value of the field tm_instr_op_base::allowed_types.
00202         ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > allowed_types_get() const;
00203 
00204         //! The method allowed_types_set sets the field tm_instr_op_base::allowed_types to the given value.
00205         void allowed_types_set(const ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > & );
00206 
00207         //! The method destroyed_by_get returns the value of the field tm_instr_op_base::destroyed_by.
00208         ptr< ::lestes::std::vector< ulint > > destroyed_by_get() const;
00209 
00210         //! The method destroyed_by_set sets the field tm_instr_op_base::destroyed_by to the given value.
00211         void destroyed_by_set(const ptr< ::lestes::std::vector< ulint > > & );
00212 
00213         //! The method destroys_get returns the value of the field tm_instr_op_base::destroys.
00214         ulint destroys_get() const;
00215 
00216         //! The method destroys_set sets the field tm_instr_op_base::destroys to the given value.
00217         void destroys_set(ulint);
00218 
00219         virtual tm_instr_op_base::kind_type kind_get() abstract;
00220 
00221         virtual ptr< ::lestes::backend_v2::intercode::ge_operand > convert_to_ge(ptr< ::lestes::md::types::tm_data_type_base > type) abstract;
00222 
00223         
00224 
00225         //! for purposes of dumping
00226         virtual ptr<reflection_list> reflection_get() const;
00227         //! for purposes of dumping
00228         virtual ptr<field_list_list> field_values_get() const;
00229         
00230 protected:
00231         //! Generated constructor for class tm_instr_op_base.
00232         tm_instr_op_base (
00233                 ulint a__tm_instr_op_base__id,
00234                 ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > a__tm_instr_op_base__allowed_types,
00235                 ptr< ::lestes::std::vector< ulint > > a__tm_instr_op_base__destroyed_by,
00236                 ulint a__tm_instr_op_base__destroys);
00237 
00238         //! Marking routine for class tm_instr_op_base. 
00239         virtual void gc_mark();
00240 
00241 private:
00242         //! The operand's id.
00243         ulint id;
00244         //! A list of types that can be used by current operand.
00245         srp< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > >  allowed_types;
00246         //! If the current operand is input operand, it is an id list of output operands of the parent instruction that destroy value of the current operand (i.e. register overwrite ).
00247         srp< ::lestes::std::vector< ulint > >  destroyed_by;
00248         //! If the current operand if output one, it is id of an input operand that is destroyed by the current operand.
00249         ulint destroys;
00250         static ptr<reflection_list> reflection;
00251         
00252 }; // tm_instr_op_base
00253 
00254 
00255 /*! \brief Memory operand.
00256 
00257 Note: A concrete derived class is target dependent and it is placed in 
00258 /target/machine/${TARGET_CPU}/lestes/md/instructions/ directory. 
00259 */
00260 class tm_instr_op_mem_base : public tm_instr_op_base {
00261 public:
00262         virtual tm_instr_op_base::kind_type kind_get();
00263 
00264         virtual ptr< ::lestes::backend_v2::intercode::ge_operand > convert_to_ge(ptr< ::lestes::md::types::tm_data_type_base > type);
00265 
00266         
00267 
00268         //! for purposes of dumping
00269         virtual ptr<reflection_list> reflection_get() const;
00270         //! for purposes of dumping
00271         virtual ptr<field_list_list> field_values_get() const;
00272         
00273 protected:
00274         //! Generated constructor for class tm_instr_op_mem_base.
00275         tm_instr_op_mem_base (
00276                 ulint a__tm_instr_op_base__id,
00277                 ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > a__tm_instr_op_base__allowed_types,
00278                 ptr< ::lestes::std::vector< ulint > > a__tm_instr_op_base__destroyed_by,
00279                 ulint a__tm_instr_op_base__destroys);
00280 
00281         //! Marking routine for class tm_instr_op_mem_base. 
00282         virtual void gc_mark();
00283 
00284 private:
00285         static ptr<reflection_list> reflection;
00286         
00287 }; // tm_instr_op_mem_base
00288 
00289 
00290 /*! \brief Register operand.
00291 
00292 Note: A concrete derived class is target dependent and it is placed in 
00293 /target/machine/${TARGET_CPU}/lestes/md/instructions/ directory. 
00294 */
00295 class tm_instr_op_reg_base : public tm_instr_op_base {
00296 public:
00297         //! The method allowed_registers_get returns the value of the field tm_instr_op_reg_base::allowed_registers.
00298         ptr< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > > allowed_registers_get() const;
00299 
00300         //! The method allowed_registers_set sets the field tm_instr_op_reg_base::allowed_registers to the given value.
00301         void allowed_registers_set(const ptr< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > > & );
00302 
00303         virtual tm_instr_op_base::kind_type kind_get();
00304 
00305         virtual ptr< ::lestes::backend_v2::intercode::ge_operand > convert_to_ge(ptr< ::lestes::md::types::tm_data_type_base > type);
00306 
00307         
00308 
00309         //! for purposes of dumping
00310         virtual ptr<reflection_list> reflection_get() const;
00311         //! for purposes of dumping
00312         virtual ptr<field_list_list> field_values_get() const;
00313         
00314 protected:
00315         //! Generated constructor for class tm_instr_op_reg_base.
00316         tm_instr_op_reg_base (
00317                 ulint a__tm_instr_op_base__id,
00318                 ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > a__tm_instr_op_base__allowed_types,
00319                 ptr< ::lestes::std::vector< ulint > > a__tm_instr_op_base__destroyed_by,
00320                 ulint a__tm_instr_op_base__destroys,
00321                 ptr< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > > a__tm_instr_op_reg_base__allowed_registers);
00322 
00323         //! Marking routine for class tm_instr_op_reg_base. 
00324         virtual void gc_mark();
00325 
00326 private:
00327         //! A list of registers that can be used by the current operand.
00328         srp< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > >  allowed_registers;
00329         static ptr<reflection_list> reflection;
00330         
00331 }; // tm_instr_op_reg_base
00332 
00333 
00334 /*! \brief Immediate operand.
00335 
00336 Note: A concrete derived class is target dependent and it is placed in 
00337 /target/machine/${TARGET_CPU}/lestes/md/instructions/ directory. 
00338 */
00339 class tm_instr_op_imm_base : public tm_instr_op_base {
00340 public:
00341         virtual tm_instr_op_base::kind_type kind_get();
00342 
00343         virtual ptr< ::lestes::backend_v2::intercode::ge_operand > convert_to_ge(ptr< ::lestes::md::types::tm_data_type_base > type);
00344 
00345         
00346 
00347         //! for purposes of dumping
00348         virtual ptr<reflection_list> reflection_get() const;
00349         //! for purposes of dumping
00350         virtual ptr<field_list_list> field_values_get() const;
00351         
00352 protected:
00353         //! Generated constructor for class tm_instr_op_imm_base.
00354         tm_instr_op_imm_base (
00355                 ulint a__tm_instr_op_base__id,
00356                 ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > a__tm_instr_op_base__allowed_types,
00357                 ptr< ::lestes::std::vector< ulint > > a__tm_instr_op_base__destroyed_by,
00358                 ulint a__tm_instr_op_base__destroys);
00359 
00360         //! Marking routine for class tm_instr_op_imm_base. 
00361         virtual void gc_mark();
00362 
00363 private:
00364         static ptr<reflection_list> reflection;
00365         
00366 }; // tm_instr_op_imm_base
00367 
00368 
00369 end_package(instructions);
00370 end_package(md);
00371 end_package(lestes);
00372 
00373 package(lestes);
00374 package(std);
00375 specialize_objectize_for_enum( ::lestes::md::instructions::intr_flag_type );
00376 specialize_objectize_for_enum( ::lestes::md::instructions::tm_instr_op_base::kind_type );
00377 end_package(std);
00378 end_package(lestes);
00379 
00380 #endif // lestes__md__instructions__tm_instr_base_g_hh__included

Generated on Mon Feb 12 18:23:42 2007 for lestes by doxygen 1.5.1-20070107