From 1e77e520bae91c00c143e190ece4bedab9049fd8 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 4 Mar 2011 12:43:00 +0100 Subject: [PATCH] add compound parameter lower to lower_for_target --- ir/be/TEMPLATE/bearch_TEMPLATE.c | 10 ++++++++++ ir/be/amd64/bearch_amd64.c | 10 ++++++++++ ir/be/arm/bearch_arm.c | 11 +++++++++++ ir/be/ia32/bearch_ia32.c | 10 ++++++++++ ir/be/sparc/bearch_sparc.c | 9 +++++++++ ir/lower/lower_calls.c | 1 + 6 files changed, 51 insertions(+) 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); } + -- 2.20.1