00001
00002
00003
00004
00005
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
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
00071
00072
00073
00074
00075
00076
00077 class tm_instr_base : public ::lestes::std::object {
00078 public:
00079
00080 ulint id_get() const;
00081
00082
00083 void id_set(ulint);
00084
00085
00086 ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_input_get() const;
00087
00088
00089 void operands_input_set(const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > & );
00090
00091
00092 ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_output_get() const;
00093
00094
00095 void operands_output_set(const ptr< ::lestes::std::vector< srp< tm_instr_op_base > > > & );
00096
00097
00098 lstring asm_output_get() const;
00099
00100
00101 void asm_output_set(lstring);
00102
00103
00104 ptr< ::lestes::std::map< ulint, lstring > > properties_get() const;
00105
00106
00107 void properties_set(const ptr< ::lestes::std::map< ulint, lstring > > & );
00108
00109
00110 ptr< ::lestes::std::set< ulint > > versions_get() const;
00111
00112
00113 void versions_set(const ptr< ::lestes::std::set< ulint > > & );
00114
00115
00116 ulint flags_get() const;
00117
00118
00119 void flags_set(ulint);
00120
00121
00122 ptr< ::lestes::md::instructions::execution_info > exec_info_get() const;
00123
00124
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
00140 virtual ptr<reflection_list> reflection_get() const;
00141
00142 virtual ptr<field_list_list> field_values_get() const;
00143
00144 protected:
00145
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
00157 virtual void gc_mark();
00158
00159 private:
00160
00161 ulint id;
00162
00163 srp< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_input;
00164
00165 srp< ::lestes::std::vector< srp< tm_instr_op_base > > > operands_output;
00166
00167
00168
00169
00170
00171 lstring asm_output;
00172
00173 srp< ::lestes::std::map< ulint, lstring > > properties;
00174
00175 srp< ::lestes::std::set< ulint > > versions;
00176
00177 ulint flags;
00178
00179 srp< ::lestes::md::instructions::execution_info > exec_info;
00180 static ptr<reflection_list> reflection;
00181
00182 };
00183
00184
00185
00186 class tm_instr_op_base : public ::lestes::std::object {
00187 public:
00188
00189 enum kind_type {
00190 REGISTER,
00191 MEMORY,
00192 IMMEDIATE
00193 };
00194
00195
00196 ulint id_get() const;
00197
00198
00199 void id_set(ulint);
00200
00201
00202 ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > allowed_types_get() const;
00203
00204
00205 void allowed_types_set(const ptr< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > & );
00206
00207
00208 ptr< ::lestes::std::vector< ulint > > destroyed_by_get() const;
00209
00210
00211 void destroyed_by_set(const ptr< ::lestes::std::vector< ulint > > & );
00212
00213
00214 ulint destroys_get() const;
00215
00216
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
00226 virtual ptr<reflection_list> reflection_get() const;
00227
00228 virtual ptr<field_list_list> field_values_get() const;
00229
00230 protected:
00231
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
00239 virtual void gc_mark();
00240
00241 private:
00242
00243 ulint id;
00244
00245 srp< ::lestes::std::set< ::lestes::md::types::tm_data_type_base::id_type > > allowed_types;
00246
00247 srp< ::lestes::std::vector< ulint > > destroyed_by;
00248
00249 ulint destroys;
00250 static ptr<reflection_list> reflection;
00251
00252 };
00253
00254
00255
00256
00257
00258
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
00269 virtual ptr<reflection_list> reflection_get() const;
00270
00271 virtual ptr<field_list_list> field_values_get() const;
00272
00273 protected:
00274
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
00282 virtual void gc_mark();
00283
00284 private:
00285 static ptr<reflection_list> reflection;
00286
00287 };
00288
00289
00290
00291
00292
00293
00294
00295 class tm_instr_op_reg_base : public tm_instr_op_base {
00296 public:
00297
00298 ptr< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > > allowed_registers_get() const;
00299
00300
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
00310 virtual ptr<reflection_list> reflection_get() const;
00311
00312 virtual ptr<field_list_list> field_values_get() const;
00313
00314 protected:
00315
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
00324 virtual void gc_mark();
00325
00326 private:
00327
00328 srp< ::lestes::std::set< ::lestes::md::registers::tm_register_base::id_type > > allowed_registers;
00329 static ptr<reflection_list> reflection;
00330
00331 };
00332
00333
00334
00335
00336
00337
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
00348 virtual ptr<reflection_list> reflection_get() const;
00349
00350 virtual ptr<field_list_list> field_values_get() const;
00351
00352 protected:
00353
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
00361 virtual void gc_mark();
00362
00363 private:
00364 static ptr<reflection_list> reflection;
00365
00366 };
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