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)
$(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)
be/belive.c \
be/beloopana.c \
be/belower.c \
- be/bemachine.c \
be/bemain.c \
be/bemodule.c \
be/benode.c \
be/belive_t.h \
be/beloopana.h \
be/belower.h \
- be/bemachine.h \
be/bemodule.h \
be/bemodule_t.h \
be/benode.h \
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
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 \
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
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 \
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
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 \
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
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 \
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
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 \
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
*/
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);
* @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;
*/
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);
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);
%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);",
);
* @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;
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;
/* 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);
$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);",
);
#include "belower.h"
#include "besched.h"
#include "be.h"
-#include "bemachine.h"
#include "bemodule.h"
#include "beirg.h"
#include "bespillslots.h"
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;
/**
* 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
#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) \
+++ /dev/null
-/*
- * 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];
-}
+++ /dev/null
-/*
- * 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 */
#include "beirgmod.h"
#include "be_dbgout.h"
#include "beblocksched.h"
-#include "bemachine.h"
#include "bespillutil.h"
#include "bespillslots.h"
#include "bemodule.h"
#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"
false, /* no custom abi handling */
},
NULL, /* tv_ents */
- NULL, /* abstract machine */
IA32_FPU_ARCH_X87, /* FPU architecture */
};
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;
/**
* 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 */
#include "pdeq.h"
#include "be.h"
-#include "bemachine.h"
#include "beemitter.h"
#include "gen_ia32_regalloc_if.h"
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 */
};
#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.
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.
*/
*/
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);
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
*/
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.
*/
#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) */
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
%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);",
);
+++ /dev/null
-#!/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<<EOF;
-/**
- * \@file
- * \@brief Function prototypes for the machine description.
- * \@note DO NOT EDIT THIS FILE, your changes will be lost.
- * Edit $specfile instead.
- * created by: $0 $specfile $target_dir
- * \@date $creation_time
- */
-#ifndef FIRM_BE_${tmp}_GEN_${tmp}_MACHINE_H
-#define FIRM_BE_${tmp}_GEN_${tmp}_MACHINE_H
-
-#include "bemachine.h"
-
-/**
- * Returns the $arch machine description.
- */
-const be_machine_t *$arch\_init_machine_description(void);
-
-EOF
-
-print OUT @obst_execunits_header, "\n";
-print OUT @obst_unit_tp_defs;
-print OUT @obst_unit_defs;
-
-print OUT<<EOF;
-
-#endif
-
-EOF
-
-close(OUT);
-
-open(OUT, ">$target_c") || die("Fatal error: Could not open $target_c, reason: $!\n");
-
-$creation_time = localtime(time());
-
-print OUT<<EOF;
-/**
- * \@file
- * \@brief Generated functions for machine description interface.
- * \@note DO NOT EDIT THIS FILE, your changes will be lost.
- * Edit $specfile instead.
- * created by: $0 $specfile $target_dir
- * \@date $creation_time
- */
-#include "config.h"
-
-#include <stdlib.h>
-
-#include "gen_$arch\_machine.h"
-
-EOF
-
-print OUT @obst_execunits;
-
-if ($num_unit_types > 0) {
-print OUT<<EOF;
-
-static be_execution_unit_type_t $arch\_execution_unit_types[] = {
-EOF
-}
-
-print OUT @obst_init_unit_types;
-
-my $types;
-if ($num_unit_types > 0) {
- print OUT "};\n\n";
- $types = "$arch\_execution_unit_types";
-} else {
- $types = "NULL";
-}
-
-print OUT<<EOF;
-static be_machine_t $arch\_cpu = {
- $bundle_size,
- $bundles_per_cycle,
- $num_unit_types,
- $types
-};
-
-/**
- * Returns the $arch machines description
- */
-const be_machine_t *$arch\_init_machine_description(void) {
- static int initialized = 0;
-
- if (! initialized) {
- be_execution_unit_type_t *cur_unit_tp = NULL;
- (void) cur_unit_tp; /* avoid warning */
-
- be_machine_init_dummy_unit();
-EOF
-
-print OUT @obst_init;
-
-print OUT<<EOF;
-
- initialized = 1;
- }
-
- return &$arch\_cpu;
-}
-
-EOF
-
-close(OUT);
}
if(!defined(%init_attr)) {
%init_attr = (
- "$default_attr_type" => "\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)) {
EOF
}
- # set up static variables for cpu execution unit assigments
- if (exists($n->{"units"})) {
- $temp .= gen_execunit_list_initializer($n->{"units"});
- } else {
- $temp .= <<EOF;
- static const be_execution_unit_t ***exec_units = NULL;
-EOF
- }
-
undef my $in_req_var;
undef my $out_req_var;
}
# lookup init function
- my $attr_init_code = "(void)in;(void)exec_units;(void)irn_flags_;(void)in_reqs;(void)n_res;";
+ my $attr_init_code = "(void)in;(void)irn_flags_;(void)in_reqs;(void)n_res;";
if ($attr_type ne "") {
$attr_init_code = $init_attr{$attr_type};
if(!defined($attr_init_code)) {
}
}
-###
-# Return the list of pointers for the given execution units.
-###
-sub gen_execunit_list_initializer {
- my $units = shift;
- my $uc_arch = uc($arch);
- my $ret = "";
- my $ret2 = "";
- my %init;
-
- foreach my $unit (@{ $units }) {
- if ($unit eq "DUMMY") {
- push(@{ $init{"DUMMY"} }, "\t\t&be_machine_execution_units_DUMMY[0]");
- }
- elsif (exists($cpu{"$unit"})) {
- # operation can be executed on all units of this type
- # -> 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;
#include "config.h"
#include "gen_${arch}_regalloc_if.h"
-#include "gen_${arch}_machine.h"
#include "bearch_${arch}_t.h"
#include "irmode.h"
}
EOF
close(OUT);
-
-###
-# Gets the variable name for the execution unit assigned to this register.
-###
-sub get_execunit_variable_name {
- my $unit = shift;
- my $name = "NULL";
- my $uc_arch = uc($arch);
-
- if ($unit) {
- my $found = 0;
-SRCH: 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";
- $name = "&".$tp_name."[".$unit_name."]";
- $found = 1;
- last SRCH;
- }
- }
- }
-
- if (! $found) {
- print STDERR "Invalid execution unit $unit specified!\n";
- }
- }
-
- return $name;
-}
#include "belower.h"
#include "besched.h"
#include "be.h"
-#include "bemachine.h"
#include "bemodule.h"
#include "beirg.h"
#include "begnuas.h"
*/
static void init_sparc_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);
$default_copy_attr = "sparc_copy_attr";
%init_attr = (
- sparc_attr_t => "\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",
);