From: Matthias Braun Date: Fri, 4 Mar 2011 11:43:00 +0000 (+0100) Subject: add compound parameter lower to lower_for_target X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1e77e520bae91c00c143e190ece4bedab9049fd8;p=libfirm add compound parameter lower to lower_for_target --- diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index 0dcc1a0bb..035ee588c 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -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(¶ms); } static int TEMPLATE_is_mux_allowed(ir_node *sel, ir_node *mux_false, diff --git a/ir/be/amd64/bearch_amd64.c b/ir/be/amd64/bearch_amd64.c index eb440635a..565eb1d2b 100644 --- a/ir/be/amd64/bearch_amd64.c +++ b/ir/be/amd64/bearch_amd64.c @@ -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(¶ms); } static int amd64_is_mux_allowed(ir_node *sel, ir_node *mux_false, diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index 2dd10466f..89c4a91d4 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -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(¶ms); + for (i = 0; i < n_irgs; ++i) { ir_graph *irg = get_irp_irg(i); lower_switch(irg, 256, true); diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index 4d9a65f33..cacc36c44 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -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(¶ms); /* perform doubleword lowering */ lwrdw_param_t lower_dw_params = { diff --git a/ir/be/sparc/bearch_sparc.c b/ir/be/sparc/bearch_sparc.c index ed89cfd33..8d71fc58f 100644 --- a/ir/be/sparc/bearch_sparc.c +++ b/ir/be/sparc/bearch_sparc.c @@ -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(¶ms); for (i = 0; i < n_irgs; ++i) { ir_graph *irg = get_irp_irg(i); diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c index ea6ede9d7..cd6013ae5 100644 --- a/ir/lower/lower_calls.c +++ b/ir/lower/lower_calls.c @@ -936,3 +936,4 @@ void lower_calls_with_compounds(const lower_params_t *params) if (type_map) pmap_destroy(type_map); } +