allow backend to do its own custom abi handling and disable the generic beabi.h/...
authorMatthias Braun <matze@braunis.de>
Fri, 9 Jul 2010 16:17:07 +0000 (16:17 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 9 Jul 2010 16:17:07 +0000 (16:17 +0000)
[r27725]

ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/amd64/bearch_amd64.c
ir/be/arm/bearch_arm.c
ir/be/beabi.c
ir/be/bearch.h
ir/be/ia32/bearch_ia32.c
ir/be/sparc/bearch_sparc.c

index de73a38..dae8636 100644 (file)
@@ -203,6 +203,7 @@ static TEMPLATE_isa_t TEMPLATE_isa_template = {
                NULL,                        /* main environment */
                7,                           /* costs for a spill instruction */
                5,                           /* costs for a reload instruction */
+               false,                       /* no custom abi handling */
        },
 };
 
index d5fd46f..4b43313 100644 (file)
@@ -322,6 +322,7 @@ static amd64_isa_t amd64_isa_template = {
                NULL,                        /* main environment */
                7,                           /* costs for a spill instruction */
                5,                           /* costs for a reload instruction */
+               false,                       /* no custom abi handling */
        },
 };
 
index 5021c4c..023781f 100644 (file)
@@ -667,6 +667,7 @@ static arm_isa_t arm_isa_template = {
                NULL,                  /* main environment */
                7,                     /* spill costs */
                5,                     /* reload costs */
+               false,                 /* no custom abi handling */
        },
        0,                     /* use generic register names instead of SP, LR, PC */
        ARM_FPU_ARCH_FPE,      /* FPU architecture */
index 6f1183f..958b4a3 100644 (file)
@@ -2279,6 +2279,13 @@ be_abi_irg_t *be_abi_introduce(ir_graph *irg)
                sp_req->type |= arch_register_req_type_ignore;
        }
 
+       /* break here if backend provides a custom API.
+        * Note: we shouldn't have to setup any be_abi_irg_t* stuff at all,
+        * but need more cleanup to make this work
+        */
+       if (arch_env->custom_abi)
+               return env;
+
        env->init_sp = dummy = new_r_Dummy(irg, arch_env->sp->reg_class->mode);
 
        env->calls = NEW_ARR_F(ir_node*, 0);
index 82546e1..b673fcc 100644 (file)
@@ -750,6 +750,9 @@ struct arch_env_t {
        const be_main_env_t   *main_env;         /**< the be main environment */
        int                    spill_cost;       /**< cost for a be_Spill node */
        int                    reload_cost;      /**< cost for a be_Reload node */
+       bool                   custom_abi : 1;   /**< backend does all abi handling
+                                                     and does not need the generic stuff
+                                                     from beabi.h/.c */
 };
 
 static inline unsigned arch_irn_get_n_outs(const ir_node *node)
index e23482e..f774fc1 100644 (file)
@@ -1541,6 +1541,7 @@ static ia32_isa_t ia32_isa_template = {
                NULL,                    /* main environment */
                7,                       /* costs for a spill instruction */
                5,                       /* costs for a reload instruction */
+               false,                   /* no custom abi handling */
        },
        NULL,                    /* 16bit register names */
        NULL,                    /* 8bit register names */
index 48ee1d8..e0a3b59 100644 (file)
@@ -341,6 +341,7 @@ static sparc_isa_t sparc_isa_template = {
                NULL,                        /* main environment */
                7,                           /* costs for a spill instruction */
                5,                           /* costs for a reload instruction */
+               false,                       /* no custom abi handling */
        },
        NULL                                            /* current code generator */
 };