X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2FTEMPLATE%2Fbearch_TEMPLATE.c;h=d7fa82cde1180eceaa6efcc6e613502a5fe198a9;hb=e1c59206a1d08078fb36e930101eb4b47f959eab;hp=83136e0c9758b964e4c55acc311f1f9255704826;hpb=b2b916ba2adb8cdb20726299593979eb02666e10;p=libfirm diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index 83136e0c9..d7fa82cde 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -263,10 +263,11 @@ static void TEMPLATE_prepare_graph(void *self) { /** * Called immediatly before emit phase. */ -static void TEMPLATE_finish_irg(ir_graph *irg, TEMPLATE_code_gen_t *cg) { - /* TODO: - fix offsets for nodes accessing stack - - ... - */ +static void TEMPLATE_finish_irg(void *self) { + TEMPLATE_code_gen_t *cg = self; + ir_graph *irg = cg->irg; + + dump_ir_block_graph_sched(irg, "-TEMPLATE-finished"); } @@ -301,8 +302,6 @@ static void TEMPLATE_emit_and_done(void *self) { cg->emit_decls = 0; } - TEMPLATE_finish_irg(irg, cg); - dump_ir_block_graph_sched(irg, "-TEMPLATE-finished"); TEMPLATE_gen_routine(out, irg, cg); cur_reg_set = NULL; @@ -320,6 +319,7 @@ static const arch_code_generator_if_t TEMPLATE_code_gen_if = { TEMPLATE_before_sched, /* before scheduling hook */ TEMPLATE_before_ra, /* before register allocation hook */ TEMPLATE_after_ra, /* after register allocation hook */ + TEMPLATE_finish_irg, TEMPLATE_emit_and_done }; @@ -547,6 +547,30 @@ static int TEMPLATE_get_reg_class_alignment(const void *self, const arch_registe return get_mode_size_bytes(mode); } +/** + * Returns the libFirm configuration parameter for this backend. + */ +static const backend_params *TEMPLATE_get_libfirm_params(void) { + static arch_dep_params_t ad = { + 1, /* allow subs */ + 0, /* Muls are fast enough on Firm */ + 31, /* shift would be ok */ + 0, /* no Mulhs */ + 0, /* no Mulhu */ + 0, /* no Mulh */ + }; + static backend_params p = { + NULL, /* no additional opcodes */ + NULL, /* will be set later */ + 0, /* no dword lowering */ + NULL, /* no creator function */ + NULL, /* context for create_intrinsic_fkt */ + }; + + p.dep_param = &ad; + return &p; +} + #ifdef WITH_LIBCORE static void TEMPLATE_register_options(lc_opt_entry_t *ent) { @@ -564,6 +588,7 @@ const arch_isa_if_t TEMPLATE_isa_if = { TEMPLATE_get_code_generator_if, TEMPLATE_get_list_sched_selector, TEMPLATE_get_reg_class_alignment, + TEMPLATE_get_libfirm_params, #ifdef WITH_LIBCORE TEMPLATE_register_options #endif