From 2fc71e6885ece38578a6369ede997b804b092745 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Thu, 2 Nov 2006 09:30:04 +0000 Subject: [PATCH] added callbacks and adapted interfaces for abstract machine specification --- ir/be/arm/arm_new_nodes.c | 2 +- ir/be/arm/arm_new_nodes.h | 3 +-- ir/be/arm/bearch_arm.c | 15 +++++++++++++++ ir/be/firm/bearch_firm.c | 14 ++++++++++++++ ir/be/mips/bearch_mips.c | 15 +++++++++++++++ ir/be/mips/mips_new_nodes.c | 3 ++- ir/be/mips/mips_new_nodes.h | 3 +-- ir/be/ppc32/bearch_ppc32.c | 15 +++++++++++++++ ir/be/ppc32/ppc32_new_nodes.c | 2 +- ir/be/ppc32/ppc32_new_nodes.h | 3 +-- 10 files changed, 66 insertions(+), 9 deletions(-) diff --git a/ir/be/arm/arm_new_nodes.c b/ir/be/arm/arm_new_nodes.c index e1a5b7a83..c8bb884f8 100644 --- a/ir/be/arm/arm_new_nodes.c +++ b/ir/be/arm/arm_new_nodes.c @@ -499,7 +499,7 @@ arm_shift_modifier get_arm_shift_modifier(ir_node *node) { /* Set the ARM machine node attributes to default values. */ void init_arm_attributes(ir_node *node, int flags, const arm_register_req_t ** in_reqs, - const arm_register_req_t ** out_reqs, const be_execution_unit_t **execution_units, + const arm_register_req_t ** out_reqs, const be_execution_unit_t ***execution_units, int n_res, unsigned latency) { arm_attr_t *attr = get_arm_attr(node); attr->in_req = in_reqs; diff --git a/ir/be/arm/arm_new_nodes.h b/ir/be/arm/arm_new_nodes.h index 497d1098e..e453f09a4 100644 --- a/ir/be/arm/arm_new_nodes.h +++ b/ir/be/arm/arm_new_nodes.h @@ -8,7 +8,6 @@ #include "arm_nodes_attr.h" #include "bearch_arm_t.h" -#include "gen_arm_machine.h" /*************************************************************************************************** * _ _ _ __ _ _ _ _ @@ -105,7 +104,7 @@ int get_arm_n_res(const ir_node *node); * Set the ARM machine node attributes to default values. */ void init_arm_attributes(ir_node *node, int flags, const arm_register_req_t ** in_reqs, - const arm_register_req_t ** out_reqs, const be_execution_unit_t **execution_units, int n_res, unsigned latency); + const arm_register_req_t ** out_reqs, const be_execution_unit_t ***execution_units, int n_res, unsigned latency); /** * Returns the tarval diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index 2ba456b8f..78ccaad62 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -27,6 +27,7 @@ #include "../besched_t.h" #include "../be.h" #include "../beabi.h" +#include "../bemachine.h" #include "bearch_arm_t.h" @@ -1074,6 +1075,18 @@ static int arm_get_reg_class_alignment(const void *self, const arch_register_cla return get_mode_size_bytes(mode); } +static const be_execution_unit_t ***arm_get_allowed_execution_units(const void *self, const ir_node *irn) { + /* TODO */ + assert(0); + return NULL; +} + +static const be_machine_t *arm_get_machine(const void *self) { + /* TODO */ + assert(0); + return NULL; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -1148,6 +1161,8 @@ const arch_isa_if_t arm_isa_if = { arm_get_list_sched_selector, arm_get_reg_class_alignment, arm_get_libfirm_params, + arm_get_allowed_execution_units, + arm_get_machine, #ifdef WITH_LIBCORE arm_register_options #endif diff --git a/ir/be/firm/bearch_firm.c b/ir/be/firm/bearch_firm.c index 4d5467667..f940b56ea 100644 --- a/ir/be/firm/bearch_firm.c +++ b/ir/be/firm/bearch_firm.c @@ -610,6 +610,18 @@ static int firm_get_reg_class_alignment(const void *self, const arch_register_cl return get_mode_size_bytes(mode); } +static const be_execution_unit_t ***firm_get_allowed_execution_units(const void *self, const ir_node *irn) { + /* TODO */ + assert(0); + return NULL; +} + +static const be_machine_t *firm_get_machine(const void *self) { + /* TODO */ + assert(0); + return NULL; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -652,6 +664,8 @@ const arch_isa_if_t firm_isa = { firm_get_list_sched_selector, firm_get_reg_class_alignment, firm_get_libfirm_params, + firm_get_allowed_execution_units, + firm_get_machine, #ifdef WITH_LIBCORE firm_register_options, #endif diff --git a/ir/be/mips/bearch_mips.c b/ir/be/mips/bearch_mips.c index e7eb08cb2..a2ce576ca 100644 --- a/ir/be/mips/bearch_mips.c +++ b/ir/be/mips/bearch_mips.c @@ -26,6 +26,7 @@ #include "../besched_t.h" #include "../be.h" #include "../beabi.h" +#include "../bemachine.h" #include "bearch_mips_t.h" @@ -930,6 +931,18 @@ static int mips_get_reg_class_alignment(const void *self, const arch_register_cl return get_mode_size_bytes(mode); } +static const be_execution_unit_t ***mips_get_allowed_execution_units(const void *self, const ir_node *irn) { + /* TODO */ + assert(0); + return NULL; +} + +static const be_machine_t *mips_get_machine(const void *self) { + /* TODO */ + assert(0); + return NULL; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -972,6 +985,8 @@ const arch_isa_if_t mips_isa_if = { mips_get_list_sched_selector, mips_get_reg_class_alignment, mips_get_libfirm_params, + mips_get_allowed_execution_units, + mips_get_machine, #ifdef WITH_LIBCORE mips_register_options #endif diff --git a/ir/be/mips/mips_new_nodes.c b/ir/be/mips/mips_new_nodes.c index 3b5473b35..8522ed1a1 100644 --- a/ir/be/mips/mips_new_nodes.c +++ b/ir/be/mips/mips_new_nodes.c @@ -387,7 +387,8 @@ int get_mips_n_res(const ir_node *node) { * Initializes the nodes attributes. */ void init_mips_attributes(ir_node *node, arch_irn_flags_t flags, const mips_register_req_t **in_reqs, - const mips_register_req_t **out_reqs, const be_execution_unit_t **execution_units, + const mips_register_req_t **out_reqs, + const be_execution_unit_t ***execution_units, int n_res, unsigned latency) { mips_attr_t *attr = get_mips_attr(node); diff --git a/ir/be/mips/mips_new_nodes.h b/ir/be/mips/mips_new_nodes.h index 39721d5b4..370f23ea9 100644 --- a/ir/be/mips/mips_new_nodes.h +++ b/ir/be/mips/mips_new_nodes.h @@ -7,7 +7,6 @@ */ #include "mips_nodes_attr.h" -#include "gen_mips_machine.h" /*************************************************************************************************** * _ _ _ __ _ _ _ _ @@ -100,7 +99,7 @@ int get_mips_n_res(const ir_node *node); * Initializes the nodes attributes. */ void init_mips_attributes(ir_node *node, arch_irn_flags_t flags, const mips_register_req_t **in_reqs, - const mips_register_req_t **out_reqs, const be_execution_unit_t **execution_units, int n_res, unsigned latency); + const mips_register_req_t **out_reqs, const be_execution_unit_t ***execution_units, int n_res, unsigned latency); /** * Initialize transform ops for the mips opcodes diff --git a/ir/be/ppc32/bearch_ppc32.c b/ir/be/ppc32/bearch_ppc32.c index 6dd6b78b9..2fca423fe 100644 --- a/ir/be/ppc32/bearch_ppc32.c +++ b/ir/be/ppc32/bearch_ppc32.c @@ -22,6 +22,7 @@ #include "../besched_t.h" #include "../be.h" #include "../beabi.h" +#include "../bemachine.h" #include "pset.h" @@ -864,6 +865,18 @@ static int ppc32_get_reg_class_alignment(const void *self, const arch_register_c return get_mode_size_bytes(mode); } +static const be_execution_unit_t ***ppc32_get_allowed_execution_units(const void *self, const ir_node *irn) { + /* TODO */ + assert(0); + return NULL; +} + +static const be_machine_t *ppc32_get_machine(const void *self) { + /* TODO */ + assert(0); + return NULL; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -906,6 +919,8 @@ const arch_isa_if_t ppc32_isa_if = { ppc32_get_list_sched_selector, ppc32_get_reg_class_alignment, ppc32_get_libfirm_params, + ppc32_get_allowed_execution_units, + ppc32_get_machine, #ifdef WITH_LIBCORE ppc32_register_options #endif diff --git a/ir/be/ppc32/ppc32_new_nodes.c b/ir/be/ppc32/ppc32_new_nodes.c index d4411d649..70f3d6886 100644 --- a/ir/be/ppc32/ppc32_new_nodes.c +++ b/ir/be/ppc32/ppc32_new_nodes.c @@ -514,7 +514,7 @@ ppc32_attr_offset_mode get_ppc32_offset_mode(const ir_node *node) { */ void init_ppc32_attributes(ir_node *node, int flags, const ppc32_register_req_t **in_reqs, const ppc32_register_req_t **out_reqs, - const be_execution_unit_t **execution_units, + const be_execution_unit_t ***execution_units, int n_res, unsigned latency) { ppc32_attr_t *attr = get_ppc32_attr(node); diff --git a/ir/be/ppc32/ppc32_new_nodes.h b/ir/be/ppc32/ppc32_new_nodes.h index a910e0fff..326e84276 100644 --- a/ir/be/ppc32/ppc32_new_nodes.h +++ b/ir/be/ppc32/ppc32_new_nodes.h @@ -7,7 +7,6 @@ */ #include "ppc32_nodes_attr.h" -#include "gen_ppc32_machine.h" /*************************************************************************************************** * _ _ _ __ _ _ _ _ @@ -120,7 +119,7 @@ ppc32_attr_offset_mode get_ppc32_offset_mode(const ir_node *node); void init_ppc32_attributes(ir_node *node, int flags, const ppc32_register_req_t **in_reqs, const ppc32_register_req_t **out_reqs, - const be_execution_unit_t **execution_units, + const be_execution_unit_t ***execution_units, int n_res, unsigned latency); void ppc32_register_additional_opcodes(int opcode_num); -- 2.20.1