allow_ifconv callback may not be NULL anymore
[libfirm] / ir / be / TEMPLATE / bearch_TEMPLATE.c
index a5d976d..e9466c6 100644 (file)
@@ -85,7 +85,6 @@ static int TEMPLATE_get_sp_bias(const ir_node *irn)
 /* fill register allocator interface */
 
 static const arch_irn_ops_t TEMPLATE_irn_ops = {
-       get_TEMPLATE_in_req,
        TEMPLATE_classify,
        TEMPLATE_get_frame_entity,
        TEMPLATE_set_frame_offset,
@@ -102,12 +101,10 @@ static const arch_irn_ops_t TEMPLATE_irn_ops = {
  * Transforms the standard firm graph into
  * a TEMLPATE firm graph
  */
-static void TEMPLATE_prepare_graph(void *self)
+static void TEMPLATE_prepare_graph(ir_graph *irg)
 {
-       TEMPLATE_code_gen_t *cg = self;
-
        /* transform nodes into assembler instructions */
-       TEMPLATE_transform_graph(cg);
+       TEMPLATE_transform_graph(irg);
 }
 
 
@@ -115,69 +112,27 @@ static void TEMPLATE_prepare_graph(void *self)
 /**
  * Called immediatly before emit phase.
  */
-static void TEMPLATE_finish_irg(void *self)
+static void TEMPLATE_finish_irg(ir_graph *irg)
 {
-       (void) self;
+       (void) irg;
 }
 
 
-static void TEMPLATE_before_ra(void *self)
+static void TEMPLATE_before_ra(ir_graph *irg)
 {
-       (void) self;
+       (void) irg;
        /* Some stuff you need to do after scheduling but before register allocation */
 }
 
-static void TEMPLATE_after_ra(void *self)
+static void TEMPLATE_after_ra(ir_graph *irg)
 {
-       (void) self;
+       (void) irg;
        /* Some stuff you need to do immediatly after register allocation */
 }
 
-
-
-/**
- * Emits the code, closes the output file and frees
- * the code generator interface.
- */
-static void TEMPLATE_emit_and_done(void *self)
+static void TEMPLATE_init_graph(ir_graph *irg)
 {
-       TEMPLATE_code_gen_t *cg = self;
-       ir_graph           *irg = cg->irg;
-
-       TEMPLATE_emit_routine(irg);
-
-       /* de-allocate code generator */
-       free(cg);
-}
-
-static void *TEMPLATE_cg_init(ir_graph *irg);
-
-static const arch_code_generator_if_t TEMPLATE_code_gen_if = {
-       TEMPLATE_cg_init,
-       NULL,                    /* get_pic_base hook */
-       NULL,                    /* before abi introduce hook */
-       TEMPLATE_prepare_graph,
-       NULL,                    /* spill hook */
-       TEMPLATE_before_ra,      /* before register allocation hook */
-       TEMPLATE_after_ra,       /* after register allocation hook */
-       TEMPLATE_finish_irg,
-       TEMPLATE_emit_and_done
-};
-
-/**
- * Initializes the code generator.
- */
-static void *TEMPLATE_cg_init(ir_graph *irg)
-{
-       const arch_env_t    *arch_env = be_get_irg_arch_env(irg);
-       TEMPLATE_isa_t      *isa      = (TEMPLATE_isa_t *) arch_env;
-       TEMPLATE_code_gen_t *cg       = XMALLOC(TEMPLATE_code_gen_t);
-
-       cg->impl = &TEMPLATE_code_gen_if;
-       cg->irg  = irg;
-       cg->isa  = isa;
-
-       return (arch_code_generator_t *)cg;
+       (void) irg;
 }
 
 
@@ -391,49 +346,6 @@ static void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
        }
 }
 
-static int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn)
-{
-       (void) block_env;
-
-       if (!is_TEMPLATE_irn(irn))
-               return -1;
-
-       return 1;
-}
-
-/**
- * Initializes the code generator interface.
- */
-static const arch_code_generator_if_t *TEMPLATE_get_code_generator_if(
-               void *self)
-{
-       (void) self;
-       return &TEMPLATE_code_gen_if;
-}
-
-list_sched_selector_t TEMPLATE_sched_selector;
-
-/**
- * Returns the reg_pressure scheduler with to_appear_in_schedule() overloaded
- */
-static const list_sched_selector_t *TEMPLATE_get_list_sched_selector(
-               const void *self, list_sched_selector_t *selector)
-{
-       (void) self;
-       (void) selector;
-
-       TEMPLATE_sched_selector = trivial_selector;
-       TEMPLATE_sched_selector.to_appear_in_schedule = TEMPLATE_to_appear_in_schedule;
-       return &TEMPLATE_sched_selector;
-}
-
-static const ilp_sched_selector_t *TEMPLATE_get_ilp_sched_selector(
-               const void *self)
-{
-       (void) self;
-       return NULL;
-}
-
 /**
  * Returns the necessary byte alignment for storing a register of given class.
  */
@@ -447,6 +359,15 @@ static void TEMPLATE_lower_for_target(void)
 {
 }
 
+static int TEMPLATE_is_mux_allowed(ir_node *sel, ir_node *mux_false,
+                                   ir_node *mux_true)
+{
+       (void) sel;
+       (void) mux_false;
+       (void) mux_true;
+       return false;
+}
+
 /**
  * Returns the libFirm configuration parameter for this backend.
  */
@@ -458,7 +379,7 @@ static const backend_params *TEMPLATE_get_backend_params(void)
                0,     /* 0: little-endian, 1: big-endian */
                TEMPLATE_lower_for_target,  /* lowering for target */
                NULL,  /* architecture dependent settings, will be set later */
-               NULL,  /* parameter for if conversion */
+               TEMPLATE_is_mux_allowed,  /* parameter for if conversion */
                NULL,  /* float arithmetic mode */
                0,     /* no trampoline support: size 0 */
                0,     /* no trampoline support: align 0 */
@@ -468,21 +389,6 @@ static const backend_params *TEMPLATE_get_backend_params(void)
        return &p;
 }
 
-static const be_execution_unit_t ***TEMPLATE_get_allowed_execution_units(
-               const ir_node *irn)
-{
-       (void) irn;
-       /* TODO */
-       return NULL;
-}
-
-static const be_machine_t *TEMPLATE_get_machine(const void *self)
-{
-       (void) self;
-       /* TODO */
-       return NULL;
-}
-
 static ir_graph **TEMPLATE_get_backend_irg_list(const void *self,
                                                 ir_graph ***irgs)
 {
@@ -511,17 +417,21 @@ const arch_isa_if_t TEMPLATE_isa_if = {
        TEMPLATE_get_reg_class,
        TEMPLATE_get_reg_class_for_mode,
        TEMPLATE_get_call_abi,
-       TEMPLATE_get_code_generator_if,
-       TEMPLATE_get_list_sched_selector,
-       TEMPLATE_get_ilp_sched_selector,
        TEMPLATE_get_reg_class_alignment,
     TEMPLATE_get_backend_params,
-       TEMPLATE_get_allowed_execution_units,
-       TEMPLATE_get_machine,
        TEMPLATE_get_backend_irg_list,
        NULL,                    /* mark remat */
        TEMPLATE_parse_asm_constraint,
-       TEMPLATE_is_valid_clobber
+       TEMPLATE_is_valid_clobber,
+
+       TEMPLATE_init_graph,
+       NULL,   /* get_pic_base */
+       NULL,   /* before_abi */
+       TEMPLATE_prepare_graph,
+       TEMPLATE_before_ra,
+       TEMPLATE_after_ra,
+       TEMPLATE_finish_irg,
+       TEMPLATE_emit_routine,
 };
 
 BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_TEMPLATE);