From: Matthias Braun Date: Thu, 10 Nov 2011 12:35:54 +0000 (+0100) Subject: be: remove remnants of machine description X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=3f1d2fb001738ccea94f601a71a21d6dbf8ad8a9;p=libfirm be: remove remnants of machine description --- diff --git a/Makefile b/Makefile index a3cdbdda6..b3d85a557 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,6 @@ EMITTER_GENERATOR = $(srcdir)ir/be/scripts/generate_emitter.pl EMITTER_GENERATOR2 = $(srcdir)ir/be/scripts/generate_emitter_new.pl REGALLOC_IF_GENERATOR = $(srcdir)ir/be/scripts/generate_regalloc_if.pl OPCODES_GENERATOR = $(srcdir)ir/be/scripts/generate_new_opcodes.pl -MACHINE_GENERATOR = $(srcdir)ir/be/scripts/generate_machine.pl define backend_template $(1)_SOURCES = $$(wildcard ir/be/$(1)/*.c) @@ -119,12 +118,6 @@ $$(srcdir)ir/be/$(1)/gen_$(1)_regalloc_if.h $$(srcdir)ir/be/$(1)/gen_$(1)_regall $(1)_SOURCES += ir/be/$(1)/gen_$(1)_regalloc_if.c $(1)_GEN_HEADERS += ir/be/$(1)/gen_$(1)_regalloc_if.h -$$(srcdir)ir/be/$(1)/gen_$(1)_machine.h $$(srcdir)ir/be/$(1)/gen_$(1)_machine.c: $$($(1)_SPEC) $$(MACHINE_GENERATOR) - @echo GEN $$@ - $(Q)$$(MACHINE_GENERATOR) $$($(1)_SPEC) $$(srcdir)ir/be/$(1) -$(1)_SOURCES += ir/be/$(1)/gen_$(1)_machine.c -$(1)_GEN_HEADERS += ir/be/$(1)/gen_$(1)_machine.h - $$(srcdir)ir/be/$(1)/gen_$(1)_new_nodes.h $$(srcdir)ir/be/$(1)/gen_$(1)_new_nodes.c.inl: $$($(1)_SPEC) $$(OPCODES_GENERATOR) @echo GEN $$@ $(Q)$$(OPCODES_GENERATOR) $$($(1)_SPEC) $$(srcdir)ir/be/$(1) diff --git a/ir/Makefile.am b/ir/Makefile.am index a060a2b63..f7079bf42 100644 --- a/ir/Makefile.am +++ b/ir/Makefile.am @@ -98,7 +98,6 @@ libfirm_la_SOURCES = \ be/belive.c \ be/beloopana.c \ be/belower.c \ - be/bemachine.c \ be/bemain.c \ be/bemodule.c \ be/benode.c \ @@ -294,7 +293,6 @@ EXTRA_DIST = \ be/belive_t.h \ be/beloopana.h \ be/belower.h \ - be/bemachine.h \ be/bemodule.h \ be/bemodule_t.h \ be/benode.h \ @@ -404,7 +402,6 @@ EXTRA_DIST = \ ir/gen_irio_lex.inl \ be/scripts/generate_emitter_new.pl \ be/scripts/generate_emitter.pl \ - be/scripts/generate_machine.pl \ be/scripts/generate_new_opcodes.pl \ be/scripts/generate_regalloc_if.pl @@ -426,8 +423,6 @@ ia32_sources = \ ia32_built_sources = \ be/ia32/gen_ia32_emitter.c \ be/ia32/gen_ia32_emitter.h \ - be/ia32/gen_ia32_machine.c \ - be/ia32/gen_ia32_machine.h \ be/ia32/gen_ia32_new_nodes.c.inl \ be/ia32/gen_ia32_new_nodes.h \ be/ia32/gen_ia32_regalloc_if.c \ @@ -460,10 +455,6 @@ $(srcdir)/be/ia32/gen_ia32_emitter.c $(srcdir)/be/ia32/gen_ia32_emitter.h: \ be/ia32/ia32_spec.pl be/scripts/generate_emitter.pl $(PERL) $(srcdir)/be/scripts/generate_emitter.pl $(srcdir)/be/ia32/ia32_spec.pl $(srcdir)/be/ia32 -$(srcdir)/be/ia32/gen_ia32_machine.c $(srcdir)/be/ia32/gen_ia32_machine.h: \ - be/ia32/ia32_spec.pl be/scripts/generate_machine.pl - $(PERL) $(srcdir)/be/scripts/generate_machine.pl $(srcdir)/be/ia32/ia32_spec.pl $(srcdir)/be/ia32 - $(srcdir)/be/ia32/gen_ia32_regalloc_if.c $(srcdir)/be/ia32/gen_ia32_regalloc_if.h: \ be/ia32/ia32_spec.pl be/scripts/generate_regalloc_if.pl $(PERL) $(srcdir)/be/scripts/generate_regalloc_if.pl $(srcdir)/be/ia32/ia32_spec.pl $(srcdir)/be/ia32 @@ -481,8 +472,6 @@ arm_sources = \ arm_built_sources = \ be/arm/gen_arm_emitter.c \ be/arm/gen_arm_emitter.h \ - be/arm/gen_arm_machine.c \ - be/arm/gen_arm_machine.h \ be/arm/gen_arm_new_nodes.c.inl \ be/arm/gen_arm_new_nodes.h \ be/arm/gen_arm_regalloc_if.c \ @@ -511,12 +500,8 @@ $(srcdir)/be/arm/gen_arm_emitter.c $(srcdir)/be/arm/gen_arm_emitter.h: \ be/arm/arm_spec.pl be/scripts/generate_emitter.pl $(PERL) $(srcdir)/be/scripts/generate_emitter.pl $(srcdir)/be/arm/arm_spec.pl $(srcdir)/be/arm -$(srcdir)/be/arm/gen_arm_machine.c $(srcdir)/be/arm/gen_arm_machine.h: \ - be/arm/arm_spec.pl be/scripts/generate_machine.pl - $(PERL) $(srcdir)/be/scripts/generate_machine.pl $(srcdir)/be/arm/arm_spec.pl $(srcdir)/be/arm - $(srcdir)/be/arm/gen_arm_regalloc_if.c $(srcdir)/be/arm/gen_arm_regalloc_if.h: \ - be/arm/arm_spec.pl be/scripts/generate_machine.pl + be/arm/arm_spec.pl be/scripts/generate_regalloc_if.pl $(PERL) $(srcdir)/be/scripts/generate_regalloc_if.pl $(srcdir)/be/arm/arm_spec.pl $(srcdir)/be/arm # sparc backend @@ -531,8 +516,6 @@ sparc_sources = \ sparc_built_sources = \ be/sparc/gen_sparc_emitter.c \ be/sparc/gen_sparc_emitter.h \ - be/sparc/gen_sparc_machine.c \ - be/sparc/gen_sparc_machine.h \ be/sparc/gen_sparc_new_nodes.c.inl \ be/sparc/gen_sparc_new_nodes.h \ be/sparc/gen_sparc_regalloc_if.c \ @@ -558,12 +541,8 @@ $(srcdir)/be/sparc/gen_sparc_emitter.c $(srcdir)/be/sparc/gen_sparc_emitter.h: \ be/sparc/sparc_spec.pl be/scripts/generate_emitter.pl $(PERL) $(srcdir)/be/scripts/generate_emitter.pl $(srcdir)/be/sparc/sparc_spec.pl $(srcdir)/be/sparc -$(srcdir)/be/sparc/gen_sparc_machine.c $(srcdir)/be/sparc/gen_sparc_machine.h: \ - be/sparc/sparc_spec.pl be/scripts/generate_machine.pl - $(PERL) $(srcdir)/be/scripts/generate_machine.pl $(srcdir)/be/sparc/sparc_spec.pl $(srcdir)/be/sparc - $(srcdir)/be/sparc/gen_sparc_regalloc_if.c $(srcdir)/be/sparc/gen_sparc_regalloc_if.h: \ - be/sparc/sparc_spec.pl be/scripts/generate_machine.pl + be/sparc/sparc_spec.pl be/scripts/generate_regalloc_if.pl $(PERL) $(srcdir)/be/scripts/generate_regalloc_if.pl $(srcdir)/be/sparc/sparc_spec.pl $(srcdir)/be/sparc # amd64 backend @@ -576,8 +555,6 @@ amd64_sources = \ amd64_built_sources = \ be/amd64/gen_amd64_emitter.c \ be/amd64/gen_amd64_emitter.h \ - be/amd64/gen_amd64_machine.c \ - be/amd64/gen_amd64_machine.h \ be/amd64/gen_amd64_new_nodes.c.inl \ be/amd64/gen_amd64_new_nodes.h \ be/amd64/gen_amd64_regalloc_if.c \ @@ -602,12 +579,8 @@ $(srcdir)/be/amd64/gen_amd64_emitter.c $(srcdir)/be/amd64/gen_amd64_emitter.h: \ be/amd64/amd64_spec.pl be/scripts/generate_emitter.pl $(PERL) $(srcdir)/be/scripts/generate_emitter.pl $(srcdir)/be/amd64/amd64_spec.pl $(srcdir)/be/amd64 -$(srcdir)/be/amd64/gen_amd64_machine.c $(srcdir)/be/amd64/gen_amd64_machine.h: \ - be/amd64/amd64_spec.pl be/scripts/generate_machine.pl - $(PERL) $(srcdir)/be/scripts/generate_machine.pl $(srcdir)/be/amd64/amd64_spec.pl $(srcdir)/be/amd64 - $(srcdir)/be/amd64/gen_amd64_regalloc_if.c $(srcdir)/be/amd64/gen_amd64_regalloc_if.h: \ - be/amd64/amd64_spec.pl be/scripts/generate_machine.pl + be/amd64/amd64_spec.pl be/scripts/generate_regalloc_if.pl $(PERL) $(srcdir)/be/scripts/generate_regalloc_if.pl $(srcdir)/be/amd64/amd64_spec.pl $(srcdir)/be/amd64 @@ -621,8 +594,6 @@ TEMPLATE_sources = \ TEMPLATE_built_sources = \ be/TEMPLATE/gen_TEMPLATE_emitter.c \ be/TEMPLATE/gen_TEMPLATE_emitter.h \ - be/TEMPLATE/gen_TEMPLATE_machine.c \ - be/TEMPLATE/gen_TEMPLATE_machine.h \ be/TEMPLATE/gen_TEMPLATE_new_nodes.c.inl \ be/TEMPLATE/gen_TEMPLATE_new_nodes.h \ be/TEMPLATE/gen_TEMPLATE_regalloc_if.c \ @@ -647,10 +618,6 @@ $(srcdir)/be/TEMPLATE/gen_TEMPLATE_emitter.c $(srcdir)/be/TEMPLATE/gen_TEMPLATE_ be/TEMPLATE/TEMPLATE_spec.pl be/scripts/generate_emitter.pl $(PERL) $(srcdir)/be/scripts/generate_emitter.pl $(srcdir)/be/TEMPLATE/TEMPLATE_spec.pl $(srcdir)/be/TEMPLATE -$(srcdir)/be/TEMPLATE/gen_TEMPLATE_machine.c $(srcdir)/be/TEMPLATE/gen_TEMPLATE_machine.h: \ - be/TEMPLATE/TEMPLATE_spec.pl be/scripts/generate_machine.pl - $(PERL) $(srcdir)/be/scripts/generate_machine.pl $(srcdir)/be/TEMPLATE/TEMPLATE_spec.pl $(srcdir)/be/TEMPLATE - $(srcdir)/be/TEMPLATE/gen_TEMPLATE_regalloc_if.c $(srcdir)/be/TEMPLATE/gen_TEMPLATE_regalloc_if.h: \ - be/TEMPLATE/TEMPLATE_spec.pl be/scripts/generate_machine.pl + be/TEMPLATE/TEMPLATE_spec.pl be/scripts/generate_regalloc_if.pl $(PERL) $(srcdir)/be/scripts/generate_regalloc_if.pl $(srcdir)/be/TEMPLATE/TEMPLATE_spec.pl $(srcdir)/be/TEMPLATE diff --git a/ir/be/TEMPLATE/TEMPLATE_new_nodes.c b/ir/be/TEMPLATE/TEMPLATE_new_nodes.c index 8fea7ce33..d65034f23 100644 --- a/ir/be/TEMPLATE/TEMPLATE_new_nodes.c +++ b/ir/be/TEMPLATE/TEMPLATE_new_nodes.c @@ -98,13 +98,11 @@ TEMPLATE_attr_t *get_TEMPLATE_attr(ir_node *node) */ static void init_TEMPLATE_attributes(ir_node *node, arch_irn_flags_t flags, const arch_register_req_t **in_reqs, - const be_execution_unit_t ***execution_units, int n_res) { ir_graph *irg = get_irn_irg(node); struct obstack *obst = get_irg_obstack(irg); backend_info_t *info; - (void) execution_units; arch_set_irn_flags(node, flags); arch_set_irn_register_reqs_in(node, in_reqs); diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index a163441b7..b6acf7850 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -224,14 +224,12 @@ static const be_abi_callbacks_t TEMPLATE_abi_callbacks = { * @param method_type The type of the method (procedure) in question. * @param abi The abi object to be modified */ -static void TEMPLATE_get_call_abi(const void *self, ir_type *method_type, - be_abi_call_t *abi) +static void TEMPLATE_get_call_abi(ir_type *method_type, be_abi_call_t *abi) { ir_type *tp; ir_mode *mode; int i, n = get_method_n_params(method_type); be_abi_call_flags_t call_flags; - (void) self; /* set abi flags for calls */ call_flags.bits.store_args_sequential = 1; diff --git a/ir/be/amd64/amd64_new_nodes.c b/ir/be/amd64/amd64_new_nodes.c index 27eae4b36..d7068676b 100644 --- a/ir/be/amd64/amd64_new_nodes.c +++ b/ir/be/amd64/amd64_new_nodes.c @@ -118,7 +118,6 @@ amd64_SymConst_attr_t *get_amd64_SymConst_attr(ir_node *node) */ static void init_amd64_attributes(ir_node *node, arch_irn_flags_t flags, const arch_register_req_t **in_reqs, - const be_execution_unit_t ***execution_units, int n_res) { ir_graph *irg = get_irn_irg(node); @@ -126,7 +125,6 @@ static void init_amd64_attributes(ir_node *node, arch_irn_flags_t flags, amd64_attr_t *attr = get_amd64_attr(node); backend_info_t *info; - (void) execution_units; arch_set_irn_flags(node, flags); arch_set_irn_register_reqs_in(node, in_reqs); diff --git a/ir/be/amd64/amd64_spec.pl b/ir/be/amd64/amd64_spec.pl index 87b685b44..4280653b2 100644 --- a/ir/be/amd64/amd64_spec.pl +++ b/ir/be/amd64/amd64_spec.pl @@ -143,12 +143,12 @@ $default_copy_attr = "amd64_copy_attr"; %init_attr = ( amd64_attr_t => - "\tinit_amd64_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", + "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);", amd64_SymConst_attr_t => - "\tinit_amd64_attributes(res, irn_flags_, in_reqs, exec_units, n_res);" + "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);" . "\tinit_amd64_SymConst_attributes(res, entity);", amd64_condcode_attr_t => - "\tinit_amd64_attributes(res, irn_flags_, in_reqs, exec_units, n_res);" + "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);" . "\tinit_amd64_condcode_attributes(res, pnc);", ); diff --git a/ir/be/amd64/bearch_amd64.c b/ir/be/amd64/bearch_amd64.c index 430472eaa..19828fe32 100644 --- a/ir/be/amd64/bearch_amd64.c +++ b/ir/be/amd64/bearch_amd64.c @@ -393,8 +393,7 @@ static const arch_register_t *amd64_get_RegParam_reg(int n) * @param method_type The type of the method (procedure) in question. * @param abi The abi object to be modified */ -static void amd64_get_call_abi(const void *self, ir_type *method_type, - be_abi_call_t *abi) +static void amd64_get_call_abi(ir_type *method_type, be_abi_call_t *abi) { ir_type *tp; ir_mode *mode; @@ -402,8 +401,6 @@ static void amd64_get_call_abi(const void *self, ir_type *method_type, be_abi_call_flags_t call_flags; int no_reg = 0; - (void) self; - /* set abi flags for calls */ call_flags.bits.store_args_sequential = 0; call_flags.bits.try_omit_fp = 1; diff --git a/ir/be/arm/arm_new_nodes.c b/ir/be/arm/arm_new_nodes.c index 61e2f8792..7d422b0f1 100644 --- a/ir/be/arm/arm_new_nodes.c +++ b/ir/be/arm/arm_new_nodes.c @@ -326,14 +326,12 @@ void set_arm_CondJmp_relation(ir_node *node, ir_relation relation) /* Set the ARM machine node attributes to default values. */ static void init_arm_attributes(ir_node *node, arch_irn_flags_t flags, const arch_register_req_t ** in_reqs, - const be_execution_unit_t ***execution_units, int n_res) { ir_graph *irg = get_irn_irg(node); struct obstack *obst = get_irg_obstack(irg); arm_attr_t *attr = get_arm_attr(node); backend_info_t *info; - (void) execution_units; arch_set_irn_flags(node, flags); arch_set_irn_register_reqs_in(node, in_reqs); diff --git a/ir/be/arm/arm_spec.pl b/ir/be/arm/arm_spec.pl index ad3fa643d..16e04d900 100644 --- a/ir/be/arm/arm_spec.pl +++ b/ir/be/arm/arm_spec.pl @@ -70,25 +70,25 @@ $default_attr_type = "arm_attr_t"; $default_copy_attr = "arm_copy_attr"; %init_attr = ( - arm_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", + arm_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);", arm_SymConst_attr_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_arm_SymConst_attributes(res, entity, symconst_offset);", - arm_CondJmp_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", - arm_SwitchJmp_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", - arm_fConst_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", + arm_CondJmp_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);", + arm_SwitchJmp_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);", + arm_fConst_attr_t => "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);", arm_load_store_attr_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_arm_load_store_attributes(res, ls_mode, entity, entity_sign, offset, is_frame_entity);", arm_shifter_operand_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n", + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n", arm_cmp_attr_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n", + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n", arm_farith_attr_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_arm_farith_attributes(res, op_mode);", arm_CopyB_attr_t => - "\tinit_arm_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_arm_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_arm_CopyB_attributes(res, size);", ); diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index 83d92d5b7..89e01fa1a 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -48,7 +48,6 @@ #include "belower.h" #include "besched.h" #include "be.h" -#include "bemachine.h" #include "bemodule.h" #include "beirg.h" #include "bespillslots.h" diff --git a/ir/be/be_types.h b/ir/be/be_types.h index 92b6b0abe..fdeb48cd2 100644 --- a/ir/be/be_types.h +++ b/ir/be/be_types.h @@ -66,10 +66,6 @@ typedef struct be_stack_layout_t be_stack_layout_t; typedef struct be_dom_front_info_t be_dom_front_info_t; -typedef struct be_execution_unit_type_t be_execution_unit_type_t; -typedef struct be_execution_unit_t be_execution_unit_t; -typedef struct be_machine_t be_machine_t; - typedef struct backend_info_t backend_info_t; typedef struct sched_info_t sched_info_t; typedef struct reg_out_info_t reg_out_info_t; diff --git a/ir/be/bearch.h b/ir/be/bearch.h index ba2e37a51..1cc535d70 100644 --- a/ir/be/bearch.h +++ b/ir/be/bearch.h @@ -487,12 +487,10 @@ struct arch_isa_if_t { /** * Get the ABI restrictions for procedure calls. - * @param self The this pointer. * @param call_type The call type of the method (procedure) in question. * @param p The array of parameter locations to be filled. */ - void (*get_call_abi)(const void *self, ir_type *call_type, - be_abi_call_t *abi); + void (*get_call_abi)(ir_type *call_type, be_abi_call_t *abi); /** * A "static" function, returns the frontend settings @@ -589,10 +587,8 @@ struct arch_isa_if_t { #define arch_env_done(env) ((env)->impl->done(env)) #define arch_env_handle_intrinsics(env) \ do { if((env)->impl->handle_intrinsics != NULL) (env)->impl->handle_intrinsics(); } while(0) -#define arch_env_get_call_abi(env,tp,abi) ((env)->impl->get_call_abi((env), (tp), (abi))) +#define arch_env_get_call_abi(env,tp,abi) ((env)->impl->get_call_abi((tp), (abi))) #define arch_env_get_params(env) ((env)->impl->get_params()) -#define arch_env_get_allowed_execution_units(env,irn) ((env)->impl->get_allowed_execution_units((irn))) -#define arch_env_get_machine(env) ((env)->impl->get_machine(env)) #define arch_env_parse_asm_constraint(env,c) ((env)->impl->parse_asm_constraint((c)) #define arch_env_is_valid_clobber(env,clobber) ((env)->impl->is_valid_clobber((clobber)) #define arch_env_mark_remat(env,node) \ diff --git a/ir/be/bemachine.c b/ir/be/bemachine.c deleted file mode 100644 index 3077f1ab6..000000000 --- a/ir/be/bemachine.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. - * - * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -/** - * @file - * @brief Abstract machine interface. - * @author Christian Wuerdig - * @date 01.12.2006 - * @version $Id$ - */ -#include "config.h" - -#include "bemachine.h" - -/* We define a generic dummy unit */ -be_execution_unit_t be_machine_execution_units_DUMMY[1]; - -static be_execution_unit_type_t be_machine_execution_unit_types[] = { - { 1, 1, "DUMMY", be_machine_execution_units_DUMMY }, -}; - -/** - * Initialize generic dummy unit. - */ -void be_machine_init_dummy_unit(void) -{ - be_machine_execution_units_DUMMY[0].name = "GENERIC_DUMMY_UNIT"; - be_machine_execution_units_DUMMY[0].tp = &be_machine_execution_unit_types[0]; -} - -/** - * Returns the generic dummy unit. - */ -be_execution_unit_t *be_machine_get_dummy_unit(void) -{ - return &be_machine_execution_units_DUMMY[0]; -} - -/** - * Check if given unit is the generic dummy unit. - */ -int be_machine_is_dummy_unit(const be_execution_unit_t *unit) -{ - return unit == &be_machine_execution_units_DUMMY[0]; -} - -/** - * Check if given unit is the generic dummy unit type. - */ -int be_machine_is_dummy_unit_type(const be_execution_unit_type_t *tp) -{ - return tp == &be_machine_execution_unit_types[0]; -} diff --git a/ir/be/bemachine.h b/ir/be/bemachine.h deleted file mode 100644 index f106276d6..000000000 --- a/ir/be/bemachine.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. - * - * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -/** - * @file - * @brief Abstract machine interface. - * @author Christian Wuerdig - * @date 23.10.2006 - * @version $Id$ - */ -#ifndef FIRM_BE_BEMACHINE_H -#define FIRM_BE_BEMACHINE_H - -#include "be_types.h" - -struct be_execution_unit_t { - be_execution_unit_type_t *tp; - const char *name; -}; - -struct be_execution_unit_type_t { - unsigned n_units; - unsigned ports_per_unit; - const char *name; - be_execution_unit_t *units; -}; - -struct be_machine_t { - unsigned bundle_size; - unsigned bundels_per_cycle; - unsigned n_unit_types; - be_execution_unit_type_t *unit_types; -}; - -extern be_execution_unit_t be_machine_execution_units_DUMMY[1]; - -/** - * Initialize generic dummy unit. - */ -void be_machine_init_dummy_unit(void); - -/** - * Returns the generic dummy unit. - */ -be_execution_unit_t *be_machine_get_dummy_unit(void); - -/** - * Check if given unit is the generic dummy unit. - */ -int be_machine_is_dummy_unit(const be_execution_unit_t *unit); - -/** - * Check if given unit is the generic dummy unit type. - */ -int be_machine_is_dummy_unit_type(const be_execution_unit_type_t *tp); - -/** - * Get the number of available unit types in the given machine. - */ -#define be_machine_get_n_unit_types(machine) ((machine)->n_unit_types) - -/** - * Get the unit type number @p i from the given machine. - */ -#define be_machine_get_unit_type(machine, i) ((machine)->unit_types[(i)]) - -/** - * Get the name of the given unit type. - */ -#define be_machine_get_unit_type_name(tp) ((tp)->name) - -/** - * Get the number of available execution units from the given unit type. - */ -#define be_machine_get_n_execunits(tp) ((tp)->n_units) - -/** - * Get the execution unit number @p i from the given unit type. - */ -#define be_machine_get_execunit(tp, i) ((tp)->units[(i)]) - -/** - * Get the name of the given execution unit. - */ -#define be_machine_get_execunit_name(unit) ((unit)->name) - -/** - * Get the unit type of the given execution unit. - */ -#define be_machine_get_execunit_type(unit) ((unit)->tp) - -#endif /* FIRM_BE_BEMACHINE_H */ diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index ac98c7d28..11cd891ec 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -65,7 +65,6 @@ #include "beirgmod.h" #include "be_dbgout.h" #include "beblocksched.h" -#include "bemachine.h" #include "bespillutil.h" #include "bespillslots.h" #include "bemodule.h" @@ -81,7 +80,6 @@ #include "ia32_new_nodes.h" #include "gen_ia32_regalloc_if.h" -#include "gen_ia32_machine.h" #include "ia32_common_transform.h" #include "ia32_transform.h" #include "ia32_emitter.h" @@ -1468,7 +1466,6 @@ static ia32_isa_t ia32_isa_template = { false, /* no custom abi handling */ }, NULL, /* tv_ents */ - NULL, /* abstract machine */ IA32_FPU_ARCH_X87, /* FPU architecture */ }; @@ -1538,7 +1535,6 @@ static arch_env_t *ia32_init(const be_main_env_t *env) ia32_create_opcodes(&ia32_irn_ops); isa->tv_ent = pmap_create(); - isa->cpu = ia32_init_machine_description(); /* enter the ISA object into the intrinsic environment */ intrinsic_env.isa = isa; @@ -1649,20 +1645,14 @@ static const arch_register_t *ia32_get_RegParam_reg(unsigned cc, unsigned nr, /** * Get the ABI restrictions for procedure calls. - * @param self The this pointer. - * @param method_type The type of the method (procedure) in question. - * @param abi The abi object to be modified */ -static void ia32_get_call_abi(const void *self, ir_type *method_type, - be_abi_call_t *abi) +static void ia32_get_call_abi(ir_type *method_type, be_abi_call_t *abi) { unsigned cc; int n, i, regnum; int pop_amount = 0; be_abi_call_flags_t call_flags = be_abi_call_get_flags(abi); - (void) self; - /* set abi flags for calls */ call_flags.bits.store_args_sequential = 0; /* call_flags.bits.try_omit_fp not changed: can handle both settings */ diff --git a/ir/be/ia32/bearch_ia32_t.h b/ir/be/ia32/bearch_ia32_t.h index 713bb82db..cb3ad045e 100644 --- a/ir/be/ia32/bearch_ia32_t.h +++ b/ir/be/ia32/bearch_ia32_t.h @@ -33,7 +33,6 @@ #include "pdeq.h" #include "be.h" -#include "bemachine.h" #include "beemitter.h" #include "gen_ia32_regalloc_if.h" @@ -65,7 +64,6 @@ typedef struct ia32_irg_data_t { struct ia32_isa_t { arch_env_t base; /**< must be derived from arch_env_t */ pmap *tv_ent; /**< A map of entities that store const tarvals */ - const be_machine_t *cpu; /**< the abstract machine */ int fpu_arch; /**< FPU architecture */ }; diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c index 8f8ceea72..e05687222 100644 --- a/ir/be/ia32/ia32_new_nodes.c +++ b/ir/be/ia32/ia32_new_nodes.c @@ -53,7 +53,6 @@ #include "ia32_nodes_attr.h" #include "ia32_new_nodes.h" #include "gen_ia32_regalloc_if.h" -#include "gen_ia32_machine.h" /** * Dumper interface for dumping ia32 nodes in vcg. @@ -700,15 +699,6 @@ unsigned get_ia32_copyb_size(const ir_node *node) return attr->size; } -/** - * Get the list of available execution units. - */ -const be_execution_unit_t ***get_ia32_exec_units(const ir_node *node) -{ - const ia32_attr_t *attr = get_ia32_attr_const(node); - return attr->exec_units; -} - /** * Get the exception label attribute. */ @@ -818,7 +808,6 @@ void ia32_swap_left_right(ir_node *node) */ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, const arch_register_req_t **in_reqs, - const be_execution_unit_t ***execution_units, int n_res) { ir_graph *irg = get_irn_irg(node); @@ -829,7 +818,6 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, arch_set_irn_flags(node, flags); arch_set_irn_register_reqs_in(node, in_reqs); - attr->exec_units = execution_units; #ifndef NDEBUG attr->attr_type |= IA32_ATTR_ia32_attr_t; #endif diff --git a/ir/be/ia32/ia32_new_nodes.h b/ir/be/ia32/ia32_new_nodes.h index 67d57d8cd..6c296dfee 100644 --- a/ir/be/ia32/ia32_new_nodes.h +++ b/ir/be/ia32/ia32_new_nodes.h @@ -264,12 +264,6 @@ unsigned get_ia32_copyb_size(const ir_node *node); */ unsigned get_ia32_latency(const ir_node *node); - -/** - * Get the list of available execution units. - */ -const be_execution_unit_t ***get_ia32_exec_units(const ir_node *node); - /** * Get the exception label attribute. */ diff --git a/ir/be/ia32/ia32_nodes_attr.h b/ir/be/ia32/ia32_nodes_attr.h index 340946ba7..cfbc5a49b 100644 --- a/ir/be/ia32/ia32_nodes_attr.h +++ b/ir/be/ia32/ia32_nodes_attr.h @@ -27,7 +27,6 @@ #include "firm_types.h" #include "bearch.h" -#include "bemachine.h" #include "irnode_t.h" /** ia32 condition codes (the numbers correspond to the real encoding order) */ @@ -200,8 +199,6 @@ struct ia32_attr_t { ir_entity *frame_ent; /**< the frame entity attached to this node */ - const be_execution_unit_t ***exec_units; /**< list of units this operation can be executed on */ - ir_label_t exc_label; /**< the exception label iff this instruction can throw an exception */ #ifndef NDEBUG diff --git a/ir/be/ia32/ia32_spec.pl b/ir/be/ia32/ia32_spec.pl index 578bc5ced..f9074514f 100644 --- a/ir/be/ia32/ia32_spec.pl +++ b/ir/be/ia32/ia32_spec.pl @@ -170,31 +170,31 @@ $custom_init_attr_func = \&ia32_custom_init_attr; %init_attr = ( ia32_asm_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_x87_attributes(res);". "\tinit_ia32_asm_attributes(res);", ia32_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);", ia32_call_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_call_attributes(res, pop, call_tp);", ia32_condcode_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_condcode_attributes(res, condition_code);", ia32_switch_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_switch_attributes(res, switch_table);", ia32_copyb_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_copyb_attributes(res, size);", ia32_immediate_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, no_pic_adjust, offset);", ia32_x87_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_x87_attributes(res);", ia32_climbframe_attr_t => - "\tinit_ia32_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + "\tinit_ia32_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_ia32_climbframe_attributes(res, count);", ); diff --git a/ir/be/scripts/generate_machine.pl b/ir/be/scripts/generate_machine.pl deleted file mode 100755 index 92b8ad3fe..000000000 --- a/ir/be/scripts/generate_machine.pl +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/perl -w - -# -# Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. -# -# This file is part of libFirm. -# -# This file may be distributed and/or modified under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation and appearing in the file LICENSE.GPL included in the -# packaging of this file. -# -# Licensees holding valid libFirm Professional Edition licenses may use -# this file in accordance with the libFirm Commercial License. -# Agreement provided with the Software. -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. -# - -# This script generates the data structures for the machine description. -# Creation: 2006/10/20 -# $Id$ - -use strict; -use Data::Dumper; - -my $specfile = $ARGV[0]; -my $target_dir = $ARGV[1]; - -our $arch; -our %cpu; -our %vliw; - -# include spec file - -my $return; - -no strict "subs"; -unless ($return = do $specfile) { - die "Fatal error: couldn't parse $specfile: $@" if $@; - die "Fatal error: couldn't do $specfile: $!" unless defined $return; - die "Fatal error: couldn't run $specfile" unless $return; -} -use strict "subs"; - -my $target_c = $target_dir."/gen_".$arch."_machine.c"; -my $target_h = $target_dir."/gen_".$arch."_machine.h"; - -# stacks for output -my @obst_unit_tp_defs; # stack for execution unit type defines -my @obst_unit_defs; # stack for execution unit defines -my @obst_init; # stack for cpu description initialization -my @obst_execunits; # stack for execunit variables -my @obst_execunits_header; # stack for execunit variables -my @obst_init_unit_types; # stack for unit type variable init - -my $bundle_size = exists($vliw{"bundle_size"}) ? $vliw{"bundle_size"} : 3; -my $bundles_per_cycle = exists($vliw{"bundles_per_cycle"}) ? $vliw{"bundles_per_cycle"} : 1; - -my $tmp = uc($arch); -my $idx = 0; -my $has_desc = defined(%cpu); -my $num_unit_types = scalar(keys(%cpu)); - -if ($has_desc) { - push(@obst_unit_tp_defs, "/* enum for execution unit types */\n"); - push(@obst_unit_tp_defs, "enum $arch\_execunit_tp_vals {\n"); -} - -foreach my $unit_type (keys(%cpu)) { - my $tp_name = "$tmp\_EXECUNIT_TP_$unit_type"; - my @cur_tp = @{ $cpu{"$unit_type"} }; - my $num_units = scalar(@cur_tp) - 1; - - push(@obst_init_unit_types, "\t{ $num_units, ".shift(@cur_tp).", \"$unit_type\", $arch\_execution_units_$unit_type },\n"); - push(@obst_execunits, "be_execution_unit_t $arch\_execution_units_".$unit_type."[$num_units];\n"); - push(@obst_execunits_header, "extern be_execution_unit_t $arch\_execution_units_".$unit_type."[$num_units];\n"); - - push(@obst_unit_tp_defs, "\t$tp_name,\n"); - push(@obst_init, "\n\t\t/* init of execution unit type $tp_name */\n"); - push(@obst_init, "\t\tcur_unit_tp = &$arch\_execution_unit_types[$tp_name];\n"); - - push(@obst_unit_defs, "/* enum for execution units of type $unit_type */\n"); - push(@obst_unit_defs, "enum $arch\_execunit_tp_$unit_type\_vals {\n"); - - foreach my $unit (@cur_tp) { - my $unit_name = "$tp_name\_$unit"; - - push(@obst_unit_defs, "\t$unit_name,\n"); - push(@obst_init, "\t\t$arch\_execution_units_".$unit_type."[".$unit_name."].tp = cur_unit_tp;\n"); - push(@obst_init, "\t\t$arch\_execution_units_".$unit_type."[".$unit_name."].name = \"$unit\";\n"); - } - push(@obst_unit_defs, "};\n\n"); -} - -push(@obst_unit_tp_defs, "};\n\n") if ($has_desc); - -open(OUT, ">$target_h") || die("Fatal error: Could not open $target_h, reason: $!\n"); - -my $creation_time = localtime(time()); - -print OUT<$target_c") || die("Fatal error: Could not open $target_c, reason: $!\n"); - -$creation_time = localtime(time()); - -print OUT< - -#include "gen_$arch\_machine.h" - -EOF - -print OUT @obst_execunits; - -if ($num_unit_types > 0) { -print OUT< 0) { - print OUT "};\n\n"; - $types = "$arch\_execution_unit_types"; -} else { - $types = "NULL"; -} - -print OUT< "\tinit_${arch}_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", + "$default_attr_type" => "\tinit_${arch}_attributes(res, irn_flags_, in_reqs, n_res);", ); } if(!defined($default_cmp_attr)) { @@ -313,15 +313,6 @@ EOF EOF } - # set up static variables for cpu execution unit assigments - if (exists($n->{"units"})) { - $temp .= gen_execunit_list_initializer($n->{"units"}); - } else { - $temp .= < add them all - my $tp_name = "$arch\_execution_units_$unit"; - my $idx = 0; - foreach (@{ $cpu{"$unit"} }) { - next if ($idx++ == 0); # skip first element (it's not a unit) - my $unit_name = "$uc_arch\_EXECUNIT_TP_$unit\_$_"; - push(@{ $init{"$unit"} }, "\t\t&".$tp_name."[".$unit_name."]"); - } - } - else { - # operation can be executed only a certain unit - # -> find corresponding unit type - my $found = 0; -TP_SEARCH: foreach my $cur_type (keys(%cpu)) { - foreach my $cur_unit (@{ $cpu{"$cur_type"} }) { - if ($unit eq $cur_unit) { - my $tp_name = "$arch\_execution_units_$cur_type"; - my $unit_name = "$uc_arch\_EXECUNIT_TP_$cur_type\_$unit"; - push(@{ $init{"$unit"} }, "\t\t&".$tp_name."[".$unit_name."]"); - $found = 1; - last TP_SEARCH; - } - } - } - - if (! $found) { - print STDERR "Invalid execution unit $unit specified!\n"; - } - } - } - - # prepare the 2-dim array init - foreach my $key (keys(%init)) { - $ret .= "\tstatic const be_execution_unit_t *allowed_units_".$key."[] =\n"; - $ret .= "\t{\n"; - foreach (@{ $init{"$key"} }) { - $ret .= "$_,\n"; - } - $ret .= "\t\tNULL\n"; - $ret .= "\t};\n"; - $ret2 .= "\t\tallowed_units_$key,\n"; - } - $ret2 .= "\t\tNULL\n"; - - $ret .= "\tstatic const be_execution_unit_t **exec_units[] =\n"; - $ret .= "\t{\n"; - $ret .= $ret2; - $ret .= "\t};\n"; - - return $ret; -} - sub mangle_requirements { my $reqs = shift; my $class = shift; diff --git a/ir/be/scripts/generate_regalloc_if.pl b/ir/be/scripts/generate_regalloc_if.pl index 755913d7d..981c4f2d9 100755 --- a/ir/be/scripts/generate_regalloc_if.pl +++ b/ir/be/scripts/generate_regalloc_if.pl @@ -310,7 +310,6 @@ print OUT< "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", - sparc_load_store_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", - sparc_jmp_cond_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);", - sparc_switch_jmp_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + sparc_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);", + sparc_load_store_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);", + sparc_jmp_cond_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);", + sparc_switch_jmp_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_sparc_switch_jmp_attributes(res, table, jump_table);\n", - sparc_fp_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);\n". + sparc_fp_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);\n". "\tinit_sparc_fp_attributes(res, fp_mode);\n", - sparc_fp_conv_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, exec_units, n_res);". + sparc_fp_conv_attr_t => "\tinit_sparc_attributes(res, irn_flags_, in_reqs, n_res);". "\tinit_sparc_fp_conv_attributes(res, src_mode, dest_mode);\n", );