add compound parameter lower to lower_for_target
authorMatthias Braun <matze@braunis.de>
Fri, 4 Mar 2011 11:43:00 +0000 (12:43 +0100)
committerMatthias Braun <matze@braunis.de>
Fri, 4 Mar 2011 11:52:41 +0000 (12:52 +0100)
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/amd64/bearch_amd64.c
ir/be/arm/bearch_arm.c
ir/be/ia32/bearch_ia32.c
ir/be/sparc/bearch_sparc.c
ir/lower/lower_calls.c

index 0dcc1a0..035ee58 100644 (file)
@@ -338,6 +338,16 @@ static int TEMPLATE_get_reg_class_alignment(const arch_register_class_t *cls)
 
 static void TEMPLATE_lower_for_target(void)
 {
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       /* lower compound param handling */
+       lower_calls_with_compounds(&params);
 }
 
 static int TEMPLATE_is_mux_allowed(ir_node *sel, ir_node *mux_false,
index eb44063..565eb1d 100644 (file)
@@ -500,6 +500,16 @@ static int amd64_get_reg_class_alignment(const arch_register_class_t *cls)
 
 static void amd64_lower_for_target(void)
 {
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       /* lower compound param handling */
+       lower_calls_with_compounds(&params);
 }
 
 static int amd64_is_mux_allowed(ir_node *sel, ir_node *mux_false,
index 2dd1046..89c4a91 100644 (file)
@@ -541,6 +541,17 @@ static void arm_lower_for_target(void)
        int i;
        int n_irgs = get_irp_n_irgs();
 
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       /* lower compound param handling */
+       lower_calls_with_compounds(&params);
+
        for (i = 0; i < n_irgs; ++i) {
                ir_graph *irg = get_irp_irg(i);
                lower_switch(irg, 256, true);
index 4d9a65f..cacc36c 100644 (file)
@@ -2037,6 +2037,16 @@ static void ia32_lower_for_target(void)
                ia32_create_set,
                0,        /* don't lower direct compares */
        };
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       /* lower compound param handling */
+       lower_calls_with_compounds(&params);
 
        /* perform doubleword lowering */
        lwrdw_param_t lower_dw_params = {
index ed89cfd..8d71fc5 100644 (file)
@@ -543,6 +543,15 @@ static void sparc_lower_for_target(void)
                sparc_create_set,
                0,
        };
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       lower_calls_with_compounds(&params);
 
        for (i = 0; i < n_irgs; ++i) {
                ir_graph *irg = get_irp_irg(i);
index ea6ede9..cd6013a 100644 (file)
@@ -936,3 +936,4 @@ void lower_calls_with_compounds(const lower_params_t *params)
        if (type_map)
                pmap_destroy(type_map);
 }
+